| @@ 99-114 (lines=16) @@ | ||
| 96 | h = self.get_h() |
|
| 97 | return [h(**data, object_id=best_target.chembl, object_name=best_target.name)] |
|
| 98 | ||
| 99 | def find(self, lookup: str) -> Sequence[H]: |
|
| 100 | """ |
|
| 101 | ||
| 102 | Args: |
|
| 103 | lookup: |
|
| 104 | ||
| 105 | Returns:e |
|
| 106 | ||
| 107 | """ |
|
| 108 | form = ChemblUtils(self.api).get_compound(lookup) |
|
| 109 | results = self.query(form) |
|
| 110 | hits = [] |
|
| 111 | for result in results: |
|
| 112 | result = NestedDotDict(result) |
|
| 113 | hits.extend(self.process(lookup, form, result)) |
|
| 114 | return hits |
|
| 115 | ||
| 116 | def process(self, lookup: str, compound: ChemblCompound, data: NestedDotDict) -> Sequence[H]: |
|
| 117 | """ |
|
| @@ 67-82 (lines=16) @@ | ||
| 64 | super().__init__(chembl_api) |
|
| 65 | self.taxon = tax |
|
| 66 | ||
| 67 | def find(self, lookup: str) -> Sequence[H]: |
|
| 68 | """ |
|
| 69 | ||
| 70 | Args: |
|
| 71 | lookup: |
|
| 72 | ||
| 73 | Returns:e |
|
| 74 | ||
| 75 | """ |
|
| 76 | form = ChemblUtils(self.api).get_compound(lookup) |
|
| 77 | results = self.query(form) |
|
| 78 | hits = [] |
|
| 79 | for result in results: |
|
| 80 | result = NestedDotDict(result) |
|
| 81 | hits.extend(self.process(lookup, form, result)) |
|
| 82 | return hits |
|
| 83 | ||
| 84 | def process(self, lookup: str, compound: ChemblCompound, data: NestedDotDict) -> Sequence[H]: |
|
| 85 | """ |
|