Passed
Push — dependabot/pip/sphinx-copybutt... ( c72176...cfd31d )
by
unknown
07:42 queued 05:46
created

mandos.entries.entries.Entry.describe()   A

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
"""
0 ignored issues
show
coding-style introduced by
Too many lines in module (1125/1000)
Loading history...
2
Run searches and write files.
3
"""
4
5
from __future__ import annotations
6
7
import abc
8
from pathlib import Path
9
from typing import Generic, Mapping, Optional, Sequence, Set, Type, TypeVar, Union
10
11
import typer
0 ignored issues
show
introduced by
Unable to import 'typer'
Loading history...
12
from typer.models import OptionInfo
0 ignored issues
show
introduced by
Unable to import 'typer.models'
Loading history...
13
14
from mandos import logger
15
from mandos.entries import EntryMeta
16
from mandos.entries._entry_args import EntryArgs
17
from mandos.entries.api_singletons import Apis
18
from mandos.entries.common_args import CommonArgs
19
from mandos.entries.searcher import Searcher
20
from mandos.model import InjectionError, ReflectionUtils
21
from mandos.model.apis.chembl_api import ChemblApi
22
from mandos.model.apis.chembl_support import DataValidityComment
23
from mandos.model.apis.chembl_support.chembl_targets import TargetType
24
from mandos.model.apis.pubchem_support.pubchem_models import (
25
    ClinicalTrialsGovUtils,
26
    CoOccurrenceType,
27
    DrugbankTargetType,
28
)
29
from mandos.model.searches import Search
30
from mandos.model.settings import MANDOS_SETTINGS
31
from mandos.model.taxonomy import Taxonomy
32
from mandos.model.taxonomy_caches import TaxonomyFactories
33
from mandos.search.chembl.atc_search import AtcSearch
34
from mandos.search.chembl.binding_search import BindingSearch
35
from mandos.search.chembl.go_search import GoSearch, GoType
36
from mandos.search.chembl.indication_search import IndicationSearch
37
from mandos.search.chembl.mechanism_search import MechanismSearch
38
from mandos.search.g2p.g2p_interaction_search import G2pInteractionSearch
39
from mandos.search.pubchem.acute_effects_search import AcuteEffectSearch, Ld50Search
40
from mandos.search.pubchem.bioactivity_search import BioactivitySearch
41
from mandos.search.pubchem.computed_property_search import ComputedPropertySearch
42
from mandos.search.pubchem.cooccurrence_search import (
43
    ChemicalCoOccurrenceSearch,
44
    CoOccurrenceSearch,
45
    DiseaseCoOccurrenceSearch,
46
    GeneCoOccurrenceSearch,
47
)
48
from mandos.search.pubchem.ctd_gene_search import CtdGeneSearch
49
from mandos.search.pubchem.dgidb_search import DgiSearch
50
from mandos.search.pubchem.disease_search import DiseaseSearch
51
from mandos.search.pubchem.drugbank_ddi_search import DrugbankDdiSearch
52
from mandos.search.pubchem.drugbank_interaction_search import (
53
    DrugbankGeneralFunctionSearch,
54
    DrugbankTargetSearch,
55
)
56
57
S = TypeVar("S", bound=Search, covariant=True)
0 ignored issues
show
Coding Style Naming introduced by
Class name "S" doesn't conform to PascalCase naming style ('[^\\W\\da-z][^\\W_]+$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
58
U = TypeVar("U", covariant=True, bound=CoOccurrenceSearch)
0 ignored issues
show
Coding Style Naming introduced by
Class name "U" doesn't conform to PascalCase naming style ('[^\\W\\da-z][^\\W_]+$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
59
60
61
class Utils:
0 ignored issues
show
Documentation introduced by
Empty class docstring
Loading history...
62
    """ """
63
64
    @staticmethod
65
    def split(st: str) -> Set[str]:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
Coding Style Naming introduced by
Argument name "st" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
66
        return {s.strip() for s in st.split(",")}
67
68
    @staticmethod
69
    def get_taxa(taxa: str) -> Sequence[Taxonomy]:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
70
        return [
71
            TaxonomyFactories.from_uniprot(MANDOS_SETTINGS.taxonomy_cache_path).load(
72
                str(taxon).strip()
73
            )
74
            for taxon in taxa.split(",")
75
        ]
76
77
    @staticmethod
78
    def get_trial_statuses(st: str) -> Set[str]:
0 ignored issues
show
Coding Style Naming introduced by
Argument name "st" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
79
        return ClinicalTrialsGovUtils.resolve_statuses(st)
80
81
    @staticmethod
82
    def get_target_types(st: str) -> Set[str]:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
Coding Style Naming introduced by
Argument name "st" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
83
        return {s.name for s in TargetType.resolve(st)}
84
85
    @staticmethod
86
    def get_flags(st: str) -> Set[str]:
0 ignored issues
show
Coding Style Naming introduced by
Argument name "st" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
87
        return {s.name for s in DataValidityComment.resolve(st)}
88
89
90
class Entry(Generic[S], metaclass=abc.ABCMeta):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
91
    @classmethod
92
    def cmd(cls) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
93
        key = cls._get_default_key()
94
        if isinstance(key, typer.models.OptionInfo):
95
            key = key.default
96
        if key is None or not isinstance(key, str):
97
            raise AssertionError(f"Key for {cls.__name__} is {key}")
98
        return key
99
100
    @classmethod
101
    def describe(cls) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
102
        lines = [line.strip() for line in cls.run.__doc__.splitlines() if line.strip() != ""]
103
        return lines[0]
104
105
    @classmethod
106
    def run(cls, path: Path, **params) -> None:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
107
        raise NotImplementedError()
108
109
    @classmethod
110
    def get_search_type(cls) -> Type[S]:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
111
        # noinspection PyTypeChecker
112
        return ReflectionUtils.get_generic_arg(cls, Search)
113
114
    # noinspection PyUnusedLocal
115
    @classmethod
116
    def test(cls, path: Path, **params) -> None:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
117
        cls.run(path, **{**params, **dict(check=True)})
118
119
    @classmethod
120
    def _run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (9/5)
Loading history...
121
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
122
        built: S,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
123
        path: Path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
124
        to: Optional[Path],
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
125
        check: bool,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
126
        log: Optional[Path],
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
127
        quiet: bool,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
128
        verbose: bool,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
129
        no_setup: bool,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
130
    ):
131
        if not no_setup:
132
            level = EntryMeta.set_logging(verbose, quiet, log)
133
            logger.notice(f"Ready. Set log level to {level}")
134
        searcher = cls._get_searcher(built, path, to)
135
        logger.notice(f"Searching {built.key} [{built.search_class}] on {path}")
136
        out = searcher.output_paths[built.key]
137
        if not check:
138
            searcher.search()
139
        logger.notice(f"Done! Wrote to {out}")
140
        return searcher
141
142
    @classmethod
143
    def _get_searcher(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
144
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
145
        built: S,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
146
        path: Path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
147
        to: Optional[Path],
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
148
    ):
149
        return Searcher([built], [to], path)
150
151
    @classmethod
152
    def default_param_values(cls) -> Mapping[str, Union[str, float, int, Path]]:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
153
        return {
154
            param: (value.default if isinstance(value, OptionInfo) else value)
155
            for param, value in ReflectionUtils.default_arg_values(cls.run).items()
156
            if param not in {"key", "path"}
157
        }
158
159
    @classmethod
160
    def _get_default_key(cls) -> str:
161
        vals = ReflectionUtils.default_arg_values(cls.run)
162
        try:
163
            return vals["key"]
164
        except KeyError:
165
            logger.error(f"key not in {vals.keys()} for {cls.__name__}")
166
            raise
167
168
169
class EntryChemblBinding(Entry[BindingSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
170
    @classmethod
171
    def run(
0 ignored issues
show
Comprehensibility introduced by
This function exceeds the maximum number of variables (20/15).
Loading history...
best-practice introduced by
Too many arguments (19/5)
Loading history...
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
172
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
173
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
174
        key: str = EntryArgs.key("chembl:binding"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
175
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
176
        taxa: str = CommonArgs.taxa,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
177
        traversal: str = EntryArgs.traversal_strategy,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
178
        target_types: str = EntryArgs.target_types,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
179
        confidence: int = EntryArgs.min_confidence,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
180
        binding: float = EntryArgs.binds_cutoff,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
181
        nonbinding: float = EntryArgs.does_not_bind_cutoff,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
182
        relations: str = EntryArgs.relations,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
183
        min_pchembl: float = EntryArgs.min_pchembl,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
184
        banned_flags: str = EntryArgs.banned_flags,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
185
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
186
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
187
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
188
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
189
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
190
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
191
    ) -> Searcher:
192
        """
193
        Binding data from ChEMBL.
194
        These are 'activity' annotations of the type 'B' that have a pCHEMBL value.
195
        There is extended documentation on this search; see:
196
197
        https://mandos-chem.readthedocs.io/en/latest/binding.html
198
199
        OBJECT: ChEMBL preferred target name
200
201
        PREDICATE: Either "binds", "does not bind", or "binding <relation> at"
202
203
        OTHER COLUMNS:
204
205
        - taxon_id: From UniProt
206
207
        - taxon_name: From Uniprot (scientific name)
208
209
        - pchembl: Negative base-10 log of activity value (see docs on ChEMBL)
210
211
        - standard_relation: One of '<', '<=', '=', '>=', '>', '~'. Consider using <, <=, and = to indicate hits.
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (113/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
212
213
        - std_type: e.g. EC50, Kd
214
        """
215
        built = BindingSearch(
216
            key=key,
217
            api=Apis.Chembl,
218
            taxa=Utils.get_taxa(taxa),
219
            traversal=traversal,
220
            target_types=Utils.get_target_types(target_types),
221
            min_conf_score=confidence,
222
            allowed_relations=Utils.split(relations),
223
            min_pchembl=min_pchembl,
224
            banned_flags=Utils.get_flags(banned_flags),
225
            binds_cutoff=binding,
226
            does_not_bind_cutoff=nonbinding,
227
        )
228
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
229
230
231
class EntryChemblMechanism(Entry[MechanismSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
232
    @classmethod
233
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (14/5)
Loading history...
234
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
235
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
236
        key: str = EntryArgs.key("chembl:mechanism"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
237
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
238
        taxa: Optional[str] = CommonArgs.taxa,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
239
        traversal: str = EntryArgs.traversal_strategy,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
240
        target_types: str = EntryArgs.target_types,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
241
        min_confidence: Optional[int] = EntryArgs.min_confidence,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
242
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
243
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
244
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
245
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
246
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
247
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
248
    ) -> Searcher:
249
        """
250
        Mechanism of action (MoA) data from ChEMBL.
251
252
        OBJECT: ChEMBL preferred target name
253
254
        PREDICATE: Target action; e.g. "agonist of" or "positive allosteric modulator of"
255
256
        OTHER COLUMNS:
257
258
        - direct_interaction: true or false
259
260
        - description: From ChEMBL
261
262
        - exact_target_id: the specifically annotated target, before traversal
263
        """
264
        built = MechanismSearch(
265
            key=key,
266
            api=Apis.Chembl,
267
            taxa=Utils.get_taxa(taxa),
268
            traversal_strategy=traversal,
269
            allowed_target_types=Utils.get_target_types(target_types),
270
            min_confidence_score=min_confidence,
271
        )
272
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
273
274
275
class EntryChemblTrials(Entry[IndicationSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
276
    @classmethod
277
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (11/5)
Loading history...
278
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
279
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
280
        key: str = EntryArgs.key("chembl:trial"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
281
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
282
        min_phase: Optional[int] = EntryArgs.chembl_trial,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
283
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
284
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
285
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
286
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
287
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
288
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
289
    ) -> Searcher:
290
        """
291
        Diseases from clinical trials listed in ChEMBL.
292
293
        OBJECT: MeSH code
294
295
        PREDICATE: "phase <level> trial"
296
        """
297
        built = IndicationSearch(key=key, api=Apis.Chembl, min_phase=min_phase)
298
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
299
300
301
class EntryChemblAtc(Entry[AtcSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
302
    @classmethod
303
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (11/5)
Loading history...
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
304
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
305
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
306
        key: str = EntryArgs.key("chembl:atc"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
307
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
308
        levels: str = EntryArgs.atc_level,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
309
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
310
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
311
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
312
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
313
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
314
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
315
    ) -> Searcher:
316
        """
317
        ATC codes from ChEMBL.
318
319
        OBJECT: ATC Code
320
321
        PREDICATE: "ATC L<leveL> code"
322
        """
323
        built = AtcSearch(
324
            key=key, api=Apis.Chembl, levels={int(x.strip()) for x in levels.split(",")}
325
        )
326
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
327
328
329
class _EntryChemblGo(Entry[GoSearch], metaclass=abc.ABCMeta):
330
    @classmethod
331
    def go_type(cls) -> GoType:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
332
        raise NotImplementedError()
333
334
    @classmethod
335
    def cmd(cls) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
336
        me = str(cls.go_type().name)
0 ignored issues
show
Coding Style Naming introduced by
Variable name "me" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
337
        return f"chembl:go.{me.lower()}"
338
339
    @classmethod
340
    def run(
0 ignored issues
show
Comprehensibility introduced by
This function exceeds the maximum number of variables (21/15).
Loading history...
best-practice introduced by
Too many arguments (18/5)
Loading history...
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
341
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
342
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
343
        key: str = EntryArgs.key("<see above>"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
344
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
345
        taxa: Optional[str] = CommonArgs.taxa,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
346
        traversal_strategy: str = EntryArgs.traversal_strategy,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
347
        target_types: str = EntryArgs.target_types,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
348
        confidence: Optional[int] = EntryArgs.min_confidence,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
349
        relations: str = EntryArgs.relations,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
350
        min_pchembl: float = EntryArgs.min_pchembl,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
351
        banned_flags: Optional[str] = EntryArgs.banned_flags,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
352
        binding_search: Optional[str] = EntryArgs.binding_search_name,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
353
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
354
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
355
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
356
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
357
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
358
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
359
    ) -> Searcher:
360
        """
361
        GO terms associated with ChEMBL binding targets.
362
363
        OBJECT: GO Term name
364
365
        PREDICATE: "associated with ""Function"|"Process"|"Component"" term"
366
367
        OTHER COLUMNS:
368
            See the docs for ``mandos chembl:binding``
369
370
        Note:
371
372
            By default, the key is the "chembl:go.function", "chembl:go.process", or "chembl:go.component".
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (107/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
373
374
        """
375
        if key is None or key == "<see above>":
376
            key = cls.cmd()
377
        api = ChemblApi.wrap(Apis.Chembl)
378
        if binding_search is None:
379
            binding_clazz = BindingSearch
380
        else:
381
            binding_clazz = ReflectionUtils.injection(binding_search, BindingSearch)
382
            logger.info(f"NOTICE: Passing parameters to {binding_clazz.__qualname__}")
383
        try:
384
            binding_search = binding_clazz(
385
                key=key,
386
                api=Apis.Chembl,
387
                taxa=Utils.get_taxa(taxa),
388
                traversal=traversal_strategy,
389
                target_types=Utils.get_target_types(target_types),
390
                min_conf_score=confidence,
391
                allowed_relations=Utils.split(relations),
392
                min_pchembl=min_pchembl,
393
                banned_flags=Utils.get_flags(banned_flags),
394
            )
395
        except (TypeError, ValueError):
396
            raise InjectionError(f"Failed to build {binding_clazz.__qualname__}")
397
        built = GoSearch(key, api, cls.go_type(), binding_search)
398
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
399
400
401
class EntryGoFunction(_EntryChemblGo):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
402
    @classmethod
403
    def go_type(cls) -> GoType:
404
        return GoType.function
405
406
407
class EntryGoProcess(_EntryChemblGo):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
408
    @classmethod
409
    def go_type(cls) -> GoType:
410
        return GoType.process
411
412
413
class EntryGoComponent(_EntryChemblGo):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
414
    @classmethod
415
    def go_type(cls) -> GoType:
416
        return GoType.component
417
418
419
class EntryPubchemDisease(Entry[DiseaseSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
420 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
421
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (10/5)
Loading history...
422
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
423
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
424
        key: str = EntryArgs.key("disease.ctd:mesh"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
425
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
426
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
427
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
428
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
429
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
430
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
431
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
432
    ) -> Searcher:
433
        """
434
        Diseases in the CTD.
435
436
        Comparative Toxicogenomics Database.
437
438
        OBJECT: MeSH code of disease
439
440
        PREDICATE: "marker/mechanism evidence for" or "disease evidence for"
441
        """
442
        built = DiseaseSearch(key, Apis.Pubchem)
443
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
444
445
446
class _EntryPubchemCoOccurrence(Entry[U], metaclass=abc.ABCMeta):
447
    @classmethod
448
    def cmd(cls) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
449
        me = str(cls.get_cooccurrence_type().name)
0 ignored issues
show
Coding Style Naming introduced by
Variable name "me" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
450
        return f"lit.pubchem:{me.lower()}"
451
452
    @classmethod
453
    def get_cooccurrence_type(cls) -> CoOccurrenceType:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
454
        s: CoOccurrenceSearch = cls.get_search_type()
0 ignored issues
show
Coding Style Naming introduced by
Variable name "s" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
455
        return s.cooccurrence_type()
456
457
    @classmethod
458
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (12/5)
Loading history...
459
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
460
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
461
        key: str = EntryArgs.key("<see above>"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
462
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
463
        min_score: float = EntryArgs.min_cooccurrence_score,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
464
        min_articles: int = EntryArgs.min_cooccurring_articles,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
465
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
466
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
467
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
468
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
469
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
470
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
471
    ) -> Searcher:
472
        """
473
        Co-occurrences from PubMed articles.
474
        There is extended documentation on this search.
475
        Also refer to https://pubchemdocs.ncbi.nlm.nih.gov/knowledge-panels
476
477
        OBJECT: Name of gene/chemical/disease
478
479
        PREDICATE: "co-occurs with <gene/chemical/disease>"
480
481
        OTHER COLUMNS:
482
483
        - score: enrichment score; see PubChem docs
484
485
        - intersect_count: Number of articles co-occurring
486
487
        - query_count: Total number of articles for query compound
488
489
        - neighbor_count: Total number of articles for target (co-occurring) compound
490
        """
491
        if key is None or key == "<see above>":
492
            key = cls.cmd()
493
        clazz = cls.get_search_type()
494
        built = clazz(key, Apis.Pubchem, min_score=min_score, min_articles=min_articles)
495
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
496
497
498
class EntryPubchemGeneCoOccurrence(_EntryPubchemCoOccurrence[GeneCoOccurrenceSearch]):
0 ignored issues
show
Documentation introduced by
Empty class docstring
Loading history...
499
    """ """
500
501
502
class EntryPubchemDiseaseCoOccurrence(_EntryPubchemCoOccurrence[DiseaseCoOccurrenceSearch]):
0 ignored issues
show
Documentation introduced by
Empty class docstring
Loading history...
503
    """ """
504
505
506
class EntryPubchemChemicalCoOccurrence(_EntryPubchemCoOccurrence[ChemicalCoOccurrenceSearch]):
0 ignored issues
show
Documentation introduced by
Empty class docstring
Loading history...
507
    """ """
508
509
510
class EntryPubchemDgi(Entry[DgiSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
511 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
512
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (10/5)
Loading history...
513
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
514
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
515
        key: str = EntryArgs.key("inter.dgidb:gene"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
516
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
517
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
518
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
519
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
520
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
521
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
522
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
523
    ) -> Searcher:
524
        """
525
        Drug/gene interactions in the DGIDB.
526
527
        Drug Gene Interaction Database.
528
        Also see ``disease.dgidb:int``.
529
530
        OBJECT: Name of the gene
531
532
        PREDICATE: "interacts with gene"
533
        """
534
        built = DgiSearch(key, Apis.Pubchem)
535
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
536
537
538
class EntryPubchemCgi(Entry[CtdGeneSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
539 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
540
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (10/5)
Loading history...
541
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
542
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
543
        key: str = EntryArgs.key("inter.ctd:gene"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
544
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
545
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
546
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
547
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
548
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
549
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
550
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
551
    ) -> Searcher:
552
        """
553
        Compound/gene interactions in the DGIDB.
554
555
        Drug Gene Interaction Database.
556
        Also see ``interact.dgidb:int``.
557
558
        OBJECT: Name of the gene
559
560
        PREDICATE: "compound/gene interaction"
561
562
        """
563
        built = CtdGeneSearch(key, Apis.Pubchem)
564
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
565
566
567 View Code Duplication
class EntryDrugbankTarget(Entry[DrugbankTargetSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
568
    @classmethod
569
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (10/5)
Loading history...
570
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
571
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
572
        key: str = EntryArgs.key("inter.drugbank:target"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
573
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
574
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
575
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
576
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
577
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
578
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
579
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
580
    ) -> Searcher:
581
        """
582
        Protein targets from DrugBank.
583
584
        OBJECT: Target name (e.g. "Solute carrier family 22 member 11") from DrugBank
585
586
        PREDICATE: Action (e.g. "binder", "downregulator", or "agonist")
587
        """
588
        built = DrugbankTargetSearch(key, Apis.Pubchem, {DrugbankTargetType.target})
589
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
590
591
592 View Code Duplication
class EntryGeneralFunction(Entry[DrugbankGeneralFunctionSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
593
    @classmethod
594
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (10/5)
Loading history...
595
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
596
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
597
        key: str = EntryArgs.key("inter.drugbank:target-fn"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
598
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
599
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
600
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
601
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
602
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
603
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
604
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
605
    ) -> Searcher:
606
        """
607
        General functions from DrugBank targets.
608
609
        OBJECT: Name of the general function (e.g. "Toxic substance binding")
610
611
        PREDICATE: against on target (e.g. "binder", "downregulator", or "agonist").
612
        """
613
        built = DrugbankGeneralFunctionSearch(key, Apis.Pubchem, {DrugbankTargetType.target})
614
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
615
616
617 View Code Duplication
class EntryDrugbankTransporter(Entry[DrugbankTargetSearch]):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
618
    @classmethod
619
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (10/5)
Loading history...
620
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
621
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
622
        key: str = EntryArgs.key("inter.drugbank:pk"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
623
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
624
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
625
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
626
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
627
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
628
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
629
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
630
    ) -> Searcher:
631
        """
632
        PK-related proteins from DrugBank.
633
634
        OBJECT: Transporter name (e.g. "Solute carrier family 22 member 11") from DrugBank
635
636
        PREDICATE: "transported by", "carried by", or "metabolized by"
637
        """
638
        target_types = {
639
            DrugbankTargetType.transporter,
640
            DrugbankTargetType.carrier,
641
            DrugbankTargetType.enzyme,
642
        }
643
        built = DrugbankTargetSearch(key, Apis.Pubchem, target_types)
644
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
645
646
647 View Code Duplication
class EntryTransporterGeneralFunction(Entry[DrugbankGeneralFunctionSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
648
    @classmethod
649
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (10/5)
Loading history...
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
650
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
651
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
652
        key: str = EntryArgs.key("inter.drugbank:pk-fn"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
653
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
654
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
655
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
656
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
657
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
658
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
659
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
660
    ) -> Searcher:
661
        """
662
        DrugBank PK-related protein functions.
663
664
        OBJECT: Name of the general function (e.g. "Toxic substance binding")
665
666
        PREDICATE: "transported by", "carried by", or "metabolized by"
667
        """
668
        target_types = {
669
            DrugbankTargetType.transporter,
670
            DrugbankTargetType.carrier,
671
            DrugbankTargetType.enzyme,
672
        }
673
        built = DrugbankGeneralFunctionSearch(key, Apis.Pubchem, target_types)
674
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
675
676
677
class EntryDrugbankDdi(Entry[DrugbankDdiSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
678 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
679
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (10/5)
Loading history...
680
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
681
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
682
        key: str = EntryArgs.key("inter.drugbank:ddi"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
683
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
684
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
685
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
686
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
687
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
688
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
689
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
690
    ) -> Searcher:
691
        """
692
        Drug/drug interactions listed by DrugBank.
693
694
        The 'description' column includes useful information about the interaction,
695
        such as diseases and whether a risk is increased or decreased.
696
697
        OBJECT: name of the drug (e.g. "ibuprofen")
698
699
        PREDICATE: "ddi"
700
        """
701
        built = DrugbankDdiSearch(key, Apis.Pubchem)
702
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
703
704
705
class EntryPubchemAssay(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
706
    @classmethod
707
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (12/5)
Loading history...
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
708
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
709
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
710
        key: str = EntryArgs.key("assay.pubchem:activity"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
711
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
712
        name_must_match: bool = EntryArgs.name_must_match,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
713
        ban_sources: Optional[str] = None,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument ban_sources seems to be unused.
Loading history...
714
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
715
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
716
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
717
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
718
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
719
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
720
    ) -> Searcher:
721
        """
722
        PubChem bioactivity results.
723
724
        Note: The species name, if present, is taken from the target name.
725
        The taxon ID is what was curated in PubChem.
726
727
        OBJECT: Name of the target without species suffix (e.g. "Slc6a3 - solute carrier family 6 member 3")
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (108/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
728
729
        PREDICATE: "active"|"inactive"|"inconclusive"|"undetermined"
730
731
        SOURCE: "PubChem: <referrer> "(""confirmatory"|"literature"|"other"")"
732
        """
733
        built = BioactivitySearch(key, Apis.Pubchem, compound_name_must_match=name_must_match)
734
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
735
736
737
class EntryDeaSchedule(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
738
    @classmethod
739
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (10/5)
Loading history...
740
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
741
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
742
        key: str = EntryArgs.key("drug.dea:schedule"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
743
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
744
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
745
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
746
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
747
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
748
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
749
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
750
    ) -> Searcher:
751
        """
752
        DEA schedules (PENDING).
753
754
        OBJECT: (1 to 4, or "unscheduled")
755
756
        PREDICATE: "has DEA schedule"
757
        """
758
        pass
0 ignored issues
show
Unused Code introduced by
Unnecessary pass statement
Loading history...
759
760
761
class EntryDeaClass(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
762
    @classmethod
763
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (10/5)
Loading history...
764
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
765
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
766
        key: str = EntryArgs.key("drug.dea:class"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
767
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
768
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
769
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
770
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
771
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
772
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
773
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
774
    ) -> Searcher:
775
        """
776
        DEA classes (PENDING).
777
778
        OBJECT: e.g. "hallucinogen"
779
780
        PREDICATE: "is in DEA class"
781
        """
782
        pass
0 ignored issues
show
Unused Code introduced by
Unnecessary pass statement
Loading history...
783
784
785
class EntryChemidPlusAcute(Entry[AcuteEffectSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
786
    @classmethod
787
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (11/5)
Loading history...
788
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
789
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
790
        key: str = EntryArgs.key("tox.chemidplus:acute"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
791
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
792
        level: int = EntryArgs.acute_effect_level,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
793
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
794
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
795
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
796
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
797
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
798
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
799
    ) -> Searcher:
800
        """
801
        Acute effect codes from ChemIDPlus.
802
803
        OBJECT: E.g. "behavioral: excitement"
804
805
        PREDICATE: "causes acute effect"
806
807
        OTHER COLUMNS:
808
809
            - organism: e.g. 'women', 'infant', 'men', 'human', 'dog', 'domestic animals - sheep and goats'
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (107/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
810
            - human: true or false
811
            - test_type: e.g. 'TDLo'
812
            - route: e.g. 'skin'
813
            - mg_per_kg: e.g. 17.5
814
        """
815
        built = AcuteEffectSearch(
816
            key,
817
            Apis.Pubchem,
818
            top_level=level == 1,
819
        )
820
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
821
822
823
class EntryChemidPlusLd50(Entry[Ld50Search]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
824 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
825
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (10/5)
Loading history...
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
826
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
827
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
828
        key: str = EntryArgs.key("tox.chemidplus:ld50"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
829
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
830
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
831
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
832
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
833
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
834
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
835
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
836
    ) -> Searcher:
837
        """
838
        LD50 acute effects from ChemIDPlus.
839
840
        OBJECT: A dose in mg/kg (e.g. 3100)
841
842
        PREDICATE: "LD50 :: <route>" (e.g. "LD50 :: intravenous)
843
844
        OTHER COLUMNS:
845
846
            - organism: e.g. 'women', 'infant', 'men', 'human', 'dog', 'domestic animals - sheep and goats'
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (107/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
847
            - human: true or false
848
        """
849
        built = Ld50Search(key, Apis.Pubchem)
850
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
851
852
853
class EntryG2pInteractions(Entry[G2pInteractionSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
854 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
855
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (10/5)
Loading history...
856
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
857
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
858
        key: str = EntryArgs.key("g2p:interactions"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
859
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
860
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
861
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
862
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
863
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
864
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
865
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
866
    ) -> Searcher:
867
        """
868
        Target interactions with affinities from Guide to Pharmacology.
869
870
        OBJECT: A molecular target
871
872
        PREDICATE: "agonism at", etc.
873
874
        OTHER COLUMNS:
875
876
            - affinity: log affinity value
877
            - measurement: e.g. pIC50
878
            - primary: whether it is the primary target of the drug
879
            - selective: whether it is selective for that target
880
            - endogenous: whether the interaction is endogenous
881
            - organism: e.g. 'human', 'pig'
882
        """
883
        built = G2pInteractionSearch(key, Apis.G2p)
884
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
885
886
887
class EntryHmdbTissue(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
888
    @classmethod
889
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (11/5)
Loading history...
890
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
891
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
892
        key: str = EntryArgs.key("hmdb:tissue"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
893
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
894
        min_nanomolar: Optional[float] = None,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
895
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
896
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
897
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
898
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
899
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
900
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
901
    ) -> Searcher:
902
        """
903
        Tissue concentrations from HMDB (PENDING).
904
905
        OBJECT:
906
907
        PREDICATE: "tissue"
908
        """
909
        pass
0 ignored issues
show
Unused Code introduced by
Unnecessary pass statement
Loading history...
910
911
912
class EntryHmdbComputed(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
913
    @classmethod
914
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (11/5)
Loading history...
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
915
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
916
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
917
        key: str = EntryArgs.key("hmdb:computed"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
918
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
919
        min_nanomolar: Optional[float] = None,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
920
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
921
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
922
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
923
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
924
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
925
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
926
    ) -> Searcher:
927
        """
928
        Computed properties from HMDB (PENDING).
929
930
        Keys include pKa, logP, logS, etc.
931
932
        OBJECT: A number; booleans are converted to 0/1
933
934
        PREDICATE: The name of the property
935
        """
936
        pass
0 ignored issues
show
Unused Code introduced by
Unnecessary pass statement
Loading history...
937
938
939
class EntryPubchemReact(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
940
    @classmethod
941
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (10/5)
Loading history...
942
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
943
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
944
        key: str = EntryArgs.key("inter.pubchem:react"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
945
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
946
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
947
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
948
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
949
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
950
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
951
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
952
    ) -> Searcher:
953
        """
954
        Metabolic reactions (PENDING).
955
956
        OBJECT: Equation
957
958
        PREDICATE: "<pathway>"
959
        """
960
        pass
0 ignored issues
show
Unused Code introduced by
Unnecessary pass statement
Loading history...
961
962
963
class EntryPubchemComputed(Entry[ComputedPropertySearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
964
    @classmethod
965
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (11/5)
Loading history...
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
966
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
967
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
968
        key: str = EntryArgs.key("chem.pubchem:computed"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
969
        keys: str = EntryArgs.pubchem_computed_keys,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
970
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
971
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
972
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
973
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
974
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
975
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
976
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
977
    ) -> Searcher:
978
        """
979
        Computed properties from PubChem.
980
981
        OBJECT: Number
982
983
        PREDICATE: e.g. "complexity"
984
        """
985
        # replace acronyms, etc.
986
        # ComputedPropertySearch standardizes punctuation and casing
987
        known = {
988
            k: v
989
            for k, v in {
990
                **EntryArgs.KNOWN_USEFUL_KEYS,
991
                **EntryArgs.KNOWN_USELESS_KEYS,
992
            }.items()
993
            if v is not None
994
        }
995
        keys = {known.get(s.strip(), s) for s in keys.split(",")}
996
        built = ComputedPropertySearch(key, Apis.Pubchem, descriptors=keys)
997
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
998
999
1000
class EntryDrugbankAdmet(Entry[DrugbankTargetSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
1001
    @classmethod
1002
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (10/5)
Loading history...
1003
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1004
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1005
        key: str = EntryArgs.key("drugbank.admet:properties"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1006
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1007
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1008
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1009
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1010
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1011
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1012
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1013
    ) -> Searcher:
1014
        """
1015
        Enzyme predictions from DrugBank (PENDING).
1016
1017
        OBJECT: Enzyme name
1018
1019
        PREDICATE: Action
1020
        """
1021
1022
1023
class EntryDrugbankMetabolites(Entry[DrugbankTargetSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
1024
    @classmethod
1025
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (10/5)
Loading history...
1026
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1027
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1028
        key: str = EntryArgs.key("drugbank.admet:metabolites"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1029
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1030
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1031
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1032
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1033
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1034
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1035
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1036
    ) -> Searcher:
1037
        """
1038
        Metabolites from DrugBank (PENDING).
1039
1040
        OBJECT: Compound name (e.g. "norcocaine").
1041
1042
        PREDICATE: "metabolized to"
1043
        """
1044
1045
1046
class EntryDrugbankDosage(Entry[DrugbankTargetSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
1047
    @classmethod
1048
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
best-practice introduced by
Too many arguments (10/5)
Loading history...
1049
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1050
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1051
        key: str = EntryArgs.key("drugbank.admet:dosage"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1052
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1053
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1054
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1055
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1056
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1057
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1058
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1059
    ) -> Searcher:
1060
        """
1061
        Dosage from DrugBank (PENDING).
1062
1063
        OBJECT: concentration in mg/mL
1064
1065
        PREDICATE: "dosage :: <route>"
1066
1067
        OTHER COLUMNS:
1068
1069
        - form (e.g. liquid)
1070
        """
1071
1072
1073
class EntryMetaRandom(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
1074
    @classmethod
1075
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (10/5)
Loading history...
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
1076
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1077
        path: Path = CommonArgs.compounds,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1078
        key: str = EntryArgs.key("meta:random"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1079
        to: Optional[Path] = CommonArgs.to_single,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1080
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1081
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1082
        log: Optional[Path] = CommonArgs.log_path,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1083
        quiet: bool = CommonArgs.quiet,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1084
        verbose: bool = CommonArgs.verbose,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1085
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1086
    ) -> Searcher:
1087
        """
1088
        Random class assignment (PENDING).
1089
1090
        OBJECT: 1 thru n-compounds
1091
1092
        PREDICATE: "random"
1093
        """
1094
        pass
0 ignored issues
show
Unused Code introduced by
Unnecessary pass statement
Loading history...
1095
1096
1097
Entries = [
1098
    EntryChemblBinding,
1099
    EntryChemblMechanism,
1100
    EntryChemblAtc,
1101
    EntryChemblTrials,
1102
    EntryGoFunction,
1103
    EntryGoProcess,
1104
    EntryGoComponent,
1105
    EntryPubchemComputed,
1106
    EntryPubchemDisease,
1107
    EntryPubchemGeneCoOccurrence,
1108
    EntryPubchemDiseaseCoOccurrence,
1109
    EntryPubchemChemicalCoOccurrence,
1110
    EntryPubchemDgi,
1111
    EntryPubchemCgi,
1112
    EntryDrugbankTarget,
1113
    EntryGeneralFunction,
1114
    EntryDrugbankTransporter,
1115
    EntryTransporterGeneralFunction,
1116
    EntryDrugbankDdi,
1117
    EntryPubchemAssay,
1118
    EntryDeaSchedule,
1119
    EntryDeaClass,
1120
    EntryChemidPlusAcute,
1121
    EntryChemidPlusLd50,
1122
    EntryHmdbTissue,
1123
    EntryPubchemReact,
1124
    EntryMetaRandom,
1125
]
1126