| @@ 68-83 (lines=16) @@ | ||
| 65 | super().__init__(chembl_api) |
|
| 66 | self.taxon = tax |
|
| 67 | ||
| 68 | def find(self, lookup: str) -> Sequence[H]: |
|
| 69 | """ |
|
| 70 | ||
| 71 | Args: |
|
| 72 | lookup: |
|
| 73 | ||
| 74 | Returns:e |
|
| 75 | ||
| 76 | """ |
|
| 77 | form = ChemblUtils(self.api).get_compound(lookup) |
|
| 78 | results = self.query(form) |
|
| 79 | hits = [] |
|
| 80 | for result in results: |
|
| 81 | result = NestedDotDict(result) |
|
| 82 | hits.extend(self.process(lookup, form, result)) |
|
| 83 | return hits |
|
| 84 | ||
| 85 | def process(self, lookup: str, compound: ChemblCompound, data: NestedDotDict) -> Sequence[H]: |
|
| 86 | """ |
|
| @@ 121-136 (lines=16) @@ | ||
| 118 | h = self.get_h() |
|
| 119 | return [h(**data, object_id=best_target.chembl, object_name=best_target.name)] |
|
| 120 | ||
| 121 | def find(self, lookup: str) -> Sequence[H]: |
|
| 122 | """ |
|
| 123 | ||
| 124 | Args: |
|
| 125 | lookup: |
|
| 126 | ||
| 127 | Returns:e |
|
| 128 | ||
| 129 | """ |
|
| 130 | form = ChemblUtils(self.api).get_compound(lookup) |
|
| 131 | results = self.query(form) |
|
| 132 | hits = [] |
|
| 133 | for result in results: |
|
| 134 | result = NestedDotDict(result) |
|
| 135 | hits.extend(self.process(lookup, form, result)) |
|
| 136 | return hits |
|
| 137 | ||
| 138 | def process(self, lookup: str, compound: ChemblCompound, data: NestedDotDict) -> Sequence[H]: |
|
| 139 | """ |
|