Passed
Push — main ( 3a0c28...4b9dc0 )
by Douglas
01:51
created

mandos.entry.entry_commands   B

Complexity

Total Complexity 46

Size/Duplication

Total Lines 1139
Duplicated Lines 35.12 %

Importance

Changes 0
Metric Value
eloc 742
dl 400
loc 1139
rs 8.578
c 0
b 0
f 0
wmc 46

42 Methods

Rating   Name   Duplication   Size   Complexity  
A EntryGoFunction.go_type() 3 3 1
A EntryG2pInteractions.run() 0 24 1
A EntryDeaClass.run() 0 19 1
A EntryPubchemDgi.run() 25 25 1
A _EntryPubchemCoOccurrence.run() 0 19 1
A EntryHmdbComputed.run() 0 24 1
A _EntryChemblGo.go_type() 0 3 1
A EntryChemidPlusLd50.run() 22 22 1
A EntryGoProcess.run() 28 28 1
A EntryPubchemCgi.run() 25 25 1
A EntryDrugbankAdmet.run() 0 14 1
A EntryDrugbankDosage.run() 0 14 1
A EntryGeneralFunction.run() 22 22 1
A EntryPubchemTrials.run() 0 26 1
A EntryChemblMechanism.run() 0 34 1
A EntryChemidPlusAcute.run() 0 25 1
A EntryTransporterGeneralFunction.run() 27 27 1
A EntryPubchemGeneCoOccurrence.run() 26 26 1
A EntryChemblBinding.run() 0 42 1
A EntryGoProcess.go_type() 3 3 1
A EntryDrugbankDdi.run() 25 25 1
A EntryGoComponent.run() 28 28 1
A EntryGoComponent.go_type() 3 3 1
A EntryPubchemDisease.run() 23 23 1
B _EntryChemblGo.run() 0 46 5
A EntryPubchemChemicalCoOccurrence.run() 26 26 1
A _EntryChemblGo.cmd() 0 4 1
A _EntryPubchemCoOccurrence.get_cooccurrence_type() 0 4 1
A EntryPubchemComputed.run() 0 34 1
A EntryDrugbankMetabolites.run() 0 14 1
A EntryGoFunction.run() 28 28 1
A EntryMetaRandom.run() 0 24 1
A EntryDeaSchedule.run() 0 19 1
A EntryPubchemAssay.run() 0 30 1
A EntryDrugbankTransporter.run() 27 27 1
A ChemblQsarPredictions.run() 0 39 1
A EntryPubchemDiseaseCoOccurrence.run() 26 26 1
A EntryChemblTrials.run() 0 21 1
A _EntryPubchemCoOccurrence.cmd() 0 4 1
A EntryDrugbankTarget.run() 22 22 1
A EntryChemblAtc.run() 0 23 1
A EntryHmdbTissue.run() 0 23 1

How to fix   Duplicated Code    Complexity   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

Complexity

 Tip:   Before tackling complexity, make sure that you eliminate any duplication first. This often can reduce the size of classes significantly.

Complex classes like mandos.entry.entry_commands often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

1
"""
0 ignored issues
show
coding-style introduced by
Too many lines in module (1139/1000)
Loading history...
2
Run searches and write files.
3
"""
4
5
from __future__ import annotations
6
7
import abc
8
import inspect
9
from pathlib import Path
10
from typing import Optional, TypeVar
11
12
from pocketutils.core.exceptions import InjectionError
0 ignored issues
show
introduced by
Unable to import 'pocketutils.core.exceptions'
Loading history...
13
from pocketutils.tools.reflection_tools import ReflectionTools
0 ignored issues
show
introduced by
Unable to import 'pocketutils.tools.reflection_tools'
Loading history...
14
15
from mandos.entry.abstract_entries import Entry
16
from mandos.entry.api_singletons import Apis
17
from mandos.entry.tools.searchers import Searcher
18
from mandos.entry.utils._arg_utils import ArgUtils
19
from mandos.entry.utils._common_args import CommonArgs
20
from mandos.entry.utils._entry_args import EntryArgs
21
from mandos.model.apis.chembl_api import ChemblApi
22
from mandos.model.apis.pubchem_support.pubchem_models import (
23
    ClinicalTrialsGovUtils,
24
    CoOccurrenceType,
25
    DrugbankTargetType,
26
)
27
from mandos.model.concrete_hits import GoType
28
from mandos.model.utils.setup import logger
29
from mandos.search.chembl.atc_search import AtcSearch
30
from mandos.search.chembl.binding_search import BindingSearch
31
from mandos.search.chembl.go_search import GoSearch
32
from mandos.search.chembl.indication_search import IndicationSearch
33
from mandos.search.chembl.mechanism_search import MechanismSearch
34
from mandos.search.chembl.target_prediction_search import TargetPredictionSearch
35
from mandos.search.g2p.g2p_interaction_search import G2pInteractionSearch
36
from mandos.search.hmdb.tissue_concentration_search import TissueConcentrationSearch
37
from mandos.search.meta.random_search import RandomSearch
38
from mandos.search.pubchem.acute_effects_search import AcuteEffectSearch, Ld50Search
39
from mandos.search.pubchem.bioactivity_search import BioactivitySearch
40
from mandos.search.pubchem.computed_property_search import ComputedPropertySearch
41
from mandos.search.pubchem.cooccurrence_search import (
42
    ChemicalCoOccurrenceSearch,
43
    CoOccurrenceSearch,
44
    DiseaseCoOccurrenceSearch,
45
    GeneCoOccurrenceSearch,
46
)
47
from mandos.search.pubchem.ctd_gene_search import CtdGeneSearch
48
from mandos.search.pubchem.dgidb_search import DgiSearch
49
from mandos.search.pubchem.disease_search import DiseaseSearch
50
from mandos.search.pubchem.drugbank_ddi_search import DrugbankDdiSearch
51
from mandos.search.pubchem.drugbank_interaction_search import (
52
    DrugbankGeneralFunctionSearch,
53
    DrugbankTargetSearch,
54
)
55
from mandos.search.pubchem.trials_search import TrialSearch
56
57
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...
58
59
60
class EntryChemblBinding(Entry[BindingSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
61
    @classmethod
62
    def run(
0 ignored issues
show
Comprehensibility introduced by
This function exceeds the maximum number of variables (18/15).
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...
best-practice introduced by
Too many arguments (16/5)
Loading history...
63
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
64
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
65
        key: str = EntryArgs.key("chembl:binding"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
66
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
67
        taxa: str = CommonArgs.taxa,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
68
        traversal: str = EntryArgs.traversal,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
69
        target_types: str = EntryArgs.target_types,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
70
        confidence: int = EntryArgs.min_confidence,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
71
        binding: float = EntryArgs.binds_cutoff,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
72
        pchembl: float = EntryArgs.min_pchembl,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
73
        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...
74
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
75
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
76
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
77
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
78
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
79
    ) -> Searcher:
80
        """
81
        Binding data from ChEMBL.
82
83
        These are 'activity' annotations of the type 'B' that have a pCHEMBL value.
84
        https://mandos-chem.readthedocs.io/en/latest/binding.html
85
86
        OBJECT: The target name
87
88
        WEIGHT: The PCHEMBL value
89
        """
90
        tax = ArgUtils.get_taxonomy(taxa)
91
        built = BindingSearch(
92
            key=key,
93
            api=Apis.Chembl,
94
            taxa=tax,
95
            traversal=traversal,
96
            target_types=ArgUtils.get_target_types(target_types),
97
            min_conf_score=confidence,
98
            relations={"<", "<=", "="},  # there are no others with pchembl
99
            min_pchembl=pchembl,
100
            binds_cutoff=binding,
101
        )
102
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
103
104
105
class EntryChemblMechanism(Entry[MechanismSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
106
    @classmethod
107
    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...
Comprehensibility introduced by
This function exceeds the maximum number of variables (16/15).
Loading history...
108
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
109
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
110
        key: str = EntryArgs.key("chembl:mechanism"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
111
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
112
        taxa: str = CommonArgs.taxa,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
113
        traversal: str = EntryArgs.traversal,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
114
        target_types: str = EntryArgs.target_types,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
115
        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...
116
        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...
117
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
118
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
119
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
120
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
121
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
122
    ) -> Searcher:
123
        """
124
        Mechanism of action (MOA) data from ChEMBL.
125
126
        OBJECT: The target name
127
128
        PREDICATE: The target action (e.g. "agonist")
129
        """
130
        tax = ArgUtils.get_taxonomy(taxa)
131
        built = MechanismSearch(
132
            key=key,
133
            api=Apis.Chembl,
134
            taxa=tax,
135
            traversal=traversal,
136
            allowed_target_types=ArgUtils.get_target_types(target_types),
137
            min_confidence_score=min_confidence,
138
        )
139
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
140
141
142
class ChemblQsarPredictions(Entry[TargetPredictionSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
143
    @classmethod
144
    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...
Comprehensibility introduced by
This function exceeds the maximum number of variables (16/15).
Loading history...
145
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
146
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
147
        key: str = EntryArgs.key("chembl:predictions"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
148
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
149
        taxa: str = CommonArgs.taxa,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
150
        traversal: str = EntryArgs.traversal,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
151
        target_types: str = EntryArgs.target_types,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
152
        min_threshold: float = EntryArgs.min_threshold,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
153
        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...
154
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
155
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
156
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
157
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
158
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
159
    ) -> Searcher:
160
        """
161
        Predicted target binding from ChEMBL.
162
163
        https://mandos-chem.readthedocs.io/en/latest/binding.html
164
        These are from a QSAR model by ChEMBL.
165
166
        OBJECT: The target name
167
168
        WEIGHT: The square root of the PCHEMBL threshold
169
                multiplied by a prediction odds-ratio, normalized
170
        """
171
        tax = ArgUtils.get_taxonomy(taxa)
172
        built = TargetPredictionSearch(
173
            key=key,
174
            api=Apis.Chembl,
175
            scrape=Apis.ChemblScrape,
176
            taxa=tax,
177
            traversal=traversal,
178
            target_types=ArgUtils.get_target_types(target_types),
179
            min_threshold=min_threshold,
180
        )
181
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
182
183
184
class EntryChemblTrials(Entry[IndicationSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
185
    @classmethod
186
    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...
187
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
188
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
189
        key: str = EntryArgs.key("chembl:trial"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
190
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
191
        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...
192
        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...
193
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
194
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
195
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
196
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
197
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
198
    ) -> Searcher:
199
        """
200
        Diseases from clinical trials listed in ChEMBL.
201
202
        OBJECT: The name of the disease (in MeSH)
203
        """
204
        built = IndicationSearch(key=key, api=Apis.Chembl, min_phase=min_phase)
205
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
206
207
208
class EntryChemblAtc(Entry[AtcSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
209
    @classmethod
210
    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...
211
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
212
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
213
        key: str = EntryArgs.key("chembl:atc"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
214
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
215
        levels: str = EntryArgs.atc_level,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
216
        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...
217
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
218
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
219
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
220
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
221
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
222
    ) -> Searcher:
223
        """
224
        ATC codes from ChEMBL.
225
226
        OBJECT: The ATC code name
227
        """
228
        built = AtcSearch(
229
            key=key, api=Apis.Chembl, levels={int(x.strip()) for x in levels.split(",")}
230
        )
231
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
232
233
234
class _EntryChemblGo(Entry[GoSearch], metaclass=abc.ABCMeta):
235
    @classmethod
236
    def go_type(cls) -> GoType:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
237
        raise NotImplementedError()
238
239
    @classmethod
240
    def cmd(cls) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
241
        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...
242
        return f"chembl:go.{me.lower()}"
243
244
    @classmethod
245
    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 (16/5)
Loading history...
Comprehensibility introduced by
This function exceeds the maximum number of variables (20/15).
Loading history...
246
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
247
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
248
        key: str = EntryArgs.key("<see above>"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
249
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
250
        taxa: str = CommonArgs.taxa,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
251
        traversal: str = EntryArgs.traversal,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
252
        target_types: str = EntryArgs.target_types,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
253
        confidence: Optional[int] = EntryArgs.min_confidence,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
254
        pchembl: float = EntryArgs.min_pchembl,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
255
        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...
256
        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...
257
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
258
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
259
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
260
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
261
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
262
    ) -> Searcher:
263
        """
264
        See the docs for the specific entries.
265
        """
266
        if key is None or key == "<see above>":
267
            key = cls.cmd()
268
        api = ChemblApi.wrap(Apis.Chembl)
269
        if binding_search is None:
270
            binding_clazz = BindingSearch
271
        else:
272
            binding_clazz = ReflectionTools.injection(binding_search, BindingSearch)
273
            logger.info(f"Passing parameters to {binding_clazz.__qualname__}")
274
        try:
275
            tax = ArgUtils.get_taxonomy(taxa)
276
            binding_search = binding_clazz(
277
                key=key,
278
                api=Apis.Chembl,
279
                taxa=tax,
280
                traversal=traversal,
281
                target_types=ArgUtils.get_target_types(target_types),
282
                min_conf_score=confidence,
283
                relations={"<", "<=", "="},
284
                min_pchembl=pchembl,
285
            )
286
        except (TypeError, ValueError):
287
            raise InjectionError(f"Failed to build {binding_clazz.__qualname__}")
288
        built = GoSearch(key, api, cls.go_type(), binding_search)
289
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
290
291
292 View Code Duplication
class EntryGoFunction(_EntryChemblGo):
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...
293
    @classmethod
294
    def go_type(cls) -> GoType:
295
        return GoType.function
296
297
    @classmethod
298
    def run(
0 ignored issues
show
Comprehensibility introduced by
This function exceeds the maximum number of variables (19/15).
Loading history...
best-practice introduced by
Too many arguments (16/5)
Loading history...
299
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
300
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
301
        key: str = EntryArgs.key("chembl:go.function"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
302
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
303
        taxa: str = CommonArgs.taxa,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
304
        traversal: str = EntryArgs.traversal,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
305
        target_types: str = EntryArgs.target_types,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
306
        confidence: Optional[int] = EntryArgs.min_confidence,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
307
        pchembl: float = EntryArgs.min_pchembl,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
308
        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...
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...
310
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
311
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
312
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
313
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
314
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
315
    ) -> Searcher:
316
        """
317
        GO Function terms associated with ChEMBL binding targets.
318
319
        OBJECT: The GO Function term name
320
321
        WEIGHT: The sum of the PCHEMBL values
322
        """
323
        args, _, _, locs = inspect.getargvalues(inspect.currentframe())
324
        return super().run(**{a: locs[a] for a in args if a != "cls"})
325
326
327 View Code Duplication
class EntryGoProcess(_EntryChemblGo):
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...
328
    @classmethod
329
    def go_type(cls) -> GoType:
330
        return GoType.process
331
332
    @classmethod
333
    def run(
0 ignored issues
show
Comprehensibility introduced by
This function exceeds the maximum number of variables (19/15).
Loading history...
best-practice introduced by
Too many arguments (16/5)
Loading history...
334
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
335
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
336
        key: str = EntryArgs.key("chembl:go.process"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
337
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
338
        taxa: str = CommonArgs.taxa,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
339
        traversal: str = EntryArgs.traversal,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
340
        target_types: str = EntryArgs.target_types,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
341
        confidence: Optional[int] = EntryArgs.min_confidence,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
342
        pchembl: float = EntryArgs.min_pchembl,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
343
        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...
344
        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...
345
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
346
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
347
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
348
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
349
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
350
    ) -> Searcher:
351
        """
352
        GO Process terms associated with ChEMBL binding targets.
353
354
        OBJECT: The GO Process term name
355
356
        WEIGHT: The sum of the PCHEMBL values
357
        """
358
        args, _, _, locs = inspect.getargvalues(inspect.currentframe())
359
        return super().run(**{a: locs[a] for a in args if a != "cls"})
360
361
362 View Code Duplication
class EntryGoComponent(_EntryChemblGo):
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...
363
    @classmethod
364
    def go_type(cls) -> GoType:
365
        return GoType.component
366
367
    @classmethod
368
    def run(
0 ignored issues
show
Comprehensibility introduced by
This function exceeds the maximum number of variables (19/15).
Loading history...
best-practice introduced by
Too many arguments (16/5)
Loading history...
369
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
370
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
371
        key: str = EntryArgs.key("chembl:go.component"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
372
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
373
        taxa: str = CommonArgs.taxa,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
374
        traversal: str = EntryArgs.traversal,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
375
        target_types: str = EntryArgs.target_types,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
376
        confidence: Optional[int] = EntryArgs.min_confidence,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
377
        pchembl: float = EntryArgs.min_pchembl,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
378
        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...
379
        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...
380
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
381
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
382
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
383
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
384
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
385
    ) -> Searcher:
386
        """
387
        GO Component terms associated with ChEMBL binding targets.
388
389
        OBJECT: The GO Component term name
390
391
        WEIGHT: The sum of the PCHEMBL values
392
        """
393
        args, _, _, locs = inspect.getargvalues(inspect.currentframe())
394
        return super().run(**{a: locs[a] for a in args if a != "cls"})
395
396
397
class EntryPubchemTrials(Entry[TrialSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
398
    @classmethod
399
    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 (13/5)
Loading history...
400
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
401
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
402
        key: str = EntryArgs.key("pubchem:trial"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
403
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
404
        min_phase: Optional[int] = EntryArgs.pubchem_trial_phase,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
405
        statuses: str = EntryArgs.pubchem_trial_statuses,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
406
        req_explicit: bool = EntryArgs.req_explicit,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
407
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
408
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
409
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
410
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
411
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
412
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
413
    ) -> Searcher:
414
        """
415
        Diseases from clinical trials listed in clinicaltrials.gov.
416
417
        OBJECT: The name of the disease (in MeSH)
418
        """
419
        statuses = ClinicalTrialsGovUtils.resolve_statuses(statuses)
420
        built = TrialSearch(
421
            key=key, api=Apis.Pubchem, min_phase=min_phase, statuses=statuses, explicit=req_explicit
422
        )
423
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
424
425
426
class EntryPubchemDisease(Entry[DiseaseSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
427 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
428
    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...
429
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
430
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
431
        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...
432
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
433
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
434
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
435
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
436
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
437
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
438
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
439
    ) -> Searcher:
440
        """
441
        Diseases in the CTD.
442
443
        (Comparative Toxicogenomics Database.)
444
445
        OBJECT: The MeSH code of the disease
446
447
        """
448
        built = DiseaseSearch(key, Apis.Pubchem)
449
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
450
451
452
class _EntryPubchemCoOccurrence(Entry[U], metaclass=abc.ABCMeta):
453
    @classmethod
454
    def cmd(cls) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
455
        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...
456
        return f"lit.pubchem:{me.lower()}"
457
458
    @classmethod
459
    def get_cooccurrence_type(cls) -> CoOccurrenceType:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
460
        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...
461
        return s.cooccurrence_type()
462
463
    @classmethod
464
    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...
465
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
466
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
467
        key: str = EntryArgs.key("<see above>"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
468
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
469
        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...
470
        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...
471
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
472
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
473
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
474
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
475
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
476
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
477
    ) -> Searcher:
478
        """See the docstrings for the individual entries."""
479
        clazz = cls.get_search_type()
480
        built = clazz(key, Apis.Pubchem, min_score=min_score, min_articles=min_articles)
481
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
482
483
484 View Code Duplication
class EntryPubchemGeneCoOccurrence(_EntryPubchemCoOccurrence[GeneCoOccurrenceSearch]):
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...
485
    @classmethod
486
    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...
487
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
488
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument path seems to be unused.
Loading history...
489
        key: str = EntryArgs.key(f"lit.pubchem:{CoOccurrenceType.gene.name.lower()}"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Bug introduced by
The Instance of auto does not seem to have a member named name.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Unused Code introduced by
The argument key seems to be unused.
Loading history...
490
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument to seems to be unused.
Loading history...
491
        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...
Unused Code introduced by
The argument min_score seems to be unused.
Loading history...
492
        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...
Unused Code introduced by
The argument min_articles seems to be unused.
Loading history...
493
        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...
494
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument replace seems to be unused.
Loading history...
495
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument proceed seems to be unused.
Loading history...
496
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument check seems to be unused.
Loading history...
497
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument log seems to be unused.
Loading history...
498
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument stderr seems to be unused.
Loading history...
499
    ) -> Searcher:
500
        """
501
        Co-occurrences of genes from PubMed articles.
502
503
        https://mandos-chem.readthedocs.io/en/latest/co-occurrences.html
504
505
        OBJECT: The name of the gene
506
507
        WEIGHT: The co-occurrence score (refer to the docs)
508
        """
509
        args, _, _, locs = inspect.getargvalues(inspect.currentframe())
510
        return super().run(**{a: locs[a] for a in args if a != "cls"})
511
512
513 View Code Duplication
class EntryPubchemDiseaseCoOccurrence(_EntryPubchemCoOccurrence[DiseaseCoOccurrenceSearch]):
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...
514
    @classmethod
515
    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...
516
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
517
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument path seems to be unused.
Loading history...
518
        key: str = EntryArgs.key(f"lit.pubchem:{CoOccurrenceType.disease.name.lower()}"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Bug introduced by
The Instance of auto does not seem to have a member named name.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Unused Code introduced by
The argument key seems to be unused.
Loading history...
519
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument to seems to be unused.
Loading history...
520
        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...
Unused Code introduced by
The argument min_score seems to be unused.
Loading history...
521
        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...
Unused Code introduced by
The argument min_articles seems to be unused.
Loading history...
522
        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...
523
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument replace seems to be unused.
Loading history...
524
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument proceed seems to be unused.
Loading history...
525
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument check seems to be unused.
Loading history...
526
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument log seems to be unused.
Loading history...
527
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument stderr seems to be unused.
Loading history...
528
    ) -> Searcher:
529
        """
530
        Co-occurrences of diseases from PubMed articles.
531
532
        https://mandos-chem.readthedocs.io/en/latest/co-occurrences.html
533
534
        OBJECT: The name of the disease
535
536
        WEIGHT: The co-occurrence score (refer to the docs)
537
        """
538
        args, _, _, locs = inspect.getargvalues(inspect.currentframe())
539
        return super().run(**{a: locs[a] for a in args if a != "cls"})
540
541
542 View Code Duplication
class EntryPubchemChemicalCoOccurrence(_EntryPubchemCoOccurrence[ChemicalCoOccurrenceSearch]):
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...
543
    @classmethod
544
    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...
545
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
546
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument path seems to be unused.
Loading history...
547
        key: str = EntryArgs.key(f"lit.pubchem:{CoOccurrenceType.chemical.name.lower()}"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Bug introduced by
The Instance of auto does not seem to have a member named name.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Unused Code introduced by
The argument key seems to be unused.
Loading history...
548
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument to seems to be unused.
Loading history...
549
        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...
Unused Code introduced by
The argument min_score seems to be unused.
Loading history...
550
        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...
Unused Code introduced by
The argument min_articles seems to be unused.
Loading history...
551
        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...
552
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Unused Code introduced by
The argument replace seems to be unused.
Loading history...
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
553
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Unused Code introduced by
The argument proceed seems to be unused.
Loading history...
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
554
        check: bool = EntryArgs.check,
0 ignored issues
show
Unused Code introduced by
The argument check seems to be unused.
Loading history...
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
555
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument log seems to be unused.
Loading history...
556
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Unused Code introduced by
The argument stderr seems to be unused.
Loading history...
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
557
    ) -> Searcher:
558
        """
559
        Co-occurrences of chemicals from PubMed articles.
560
561
        https://mandos-chem.readthedocs.io/en/latest/co-occurrences.html
562
563
        OBJECT: The name of the chemical (e.g. "cocaine")
564
565
        WEIGHT: The co-occurrence score (refer to the docs)
566
        """
567
        args, _, _, locs = inspect.getargvalues(inspect.currentframe())
568
        return super().run(**{a: locs[a] for a in args if a != "cls"})
569
570
571
class EntryPubchemDgi(Entry[DgiSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
572 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
573
    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...
574
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
575
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
576
        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...
577
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
578
        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...
579
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
580
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
581
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
582
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
583
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
584
    ) -> Searcher:
585
        """
586
        Drug/gene interactions in the DGIDB.
587
588
        Drug Gene Interaction Database.
589
        Also see disease.dgidb:int.
590
591
        OBJECT: The name of the gene
592
593
        PREDICATE: "interaction:generic" or "interaction:<type>"
594
        """
595
        built = DgiSearch(key, Apis.Pubchem)
596
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
597
598
599
class EntryPubchemCgi(Entry[CtdGeneSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
600 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
601
    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...
602
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
603
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
604
        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...
605
        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...
606
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
607
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
608
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
609
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
610
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
611
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
612
    ) -> Searcher:
613
        """
614
        Compound/gene interactions in the DGIDB.
615
616
        Drug Gene Interaction Database.
617
        Also see ``interact.dgidb:int``.
618
619
        OBJECT: The name of the gene
620
621
        PREDICATE: derived from the interaction type (e.g. "downregulation")
622
        """
623
        built = CtdGeneSearch(key, Apis.Pubchem)
624
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
625
626
627
class EntryDrugbankTarget(Entry[DrugbankTargetSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
628 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
629
    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...
630
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
631
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
632
        key: str = EntryArgs.key("inter.drugbank:targ"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
633
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
634
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
635
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
636
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
637
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
638
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
639
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
640
    ) -> Searcher:
641
        """
642
        Protein targets from DrugBank.
643
644
        OBJECT: The target name (e.g. "Solute carrier family 22 member 11")
645
646
        PREDICATE: "<target_type>:<action>"
647
        """
648
        built = DrugbankTargetSearch(key, Apis.Pubchem, {DrugbankTargetType.target})
649
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
650
651
652
class EntryGeneralFunction(Entry[DrugbankGeneralFunctionSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
653 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
654
    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...
655
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
656
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
657
        key: str = EntryArgs.key("inter.drugbank:targ-fn"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
658
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
659
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
660
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
661
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
662
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
663
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
664
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
665
    ) -> Searcher:
666
        """
667
        General functions from DrugBank targets.
668
669
        OBJECT: The name of the "general function" (e.g. "Toxic substance binding")
670
671
        PREDICATE: "<target_type>:<action>"
672
        """
673
        built = DrugbankGeneralFunctionSearch(key, Apis.Pubchem, {DrugbankTargetType.target})
674
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
675
676
677 View Code Duplication
class EntryDrugbankTransporter(Entry[DrugbankTargetSearch]):
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...
678
    @classmethod
679
    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...
680
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
681
        path: Path = CommonArgs.in_compound_table,
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:pk"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
683
        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...
684
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
685
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
686
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
687
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
688
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
689
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
690
    ) -> Searcher:
691
        """
692
        PK-related proteins from DrugBank.
693
694
        OBJECT: The transporter name (e.g. "Solute carrier family 22 member 11")
695
696
        PREDICATE: "<target_type>:<action>" (e.g. metabolized, transported, etc.)
697
        """
698
        target_types = {
699
            DrugbankTargetType.transporter,
700
            DrugbankTargetType.carrier,
701
            DrugbankTargetType.enzyme,
702
        }
703
        built = DrugbankTargetSearch(key, Apis.Pubchem, target_types)
704
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
705
706
707 View Code Duplication
class EntryTransporterGeneralFunction(Entry[DrugbankGeneralFunctionSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
708
    @classmethod
709
    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...
710
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
711
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
712
        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...
713
        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...
714
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
715
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
716
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
717
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
718
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
719
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
720
    ) -> Searcher:
721
        """
722
        DrugBank PK-related protein functions.
723
724
        OBJECT: The name of the general function (e.g. "Toxic substance binding")
725
726
        PREDICATE: "<target_type>:<action>" (e.g. metabolized, transported, etc.)
727
        """
728
        target_types = {
729
            DrugbankTargetType.transporter,
730
            DrugbankTargetType.carrier,
731
            DrugbankTargetType.enzyme,
732
        }
733
        built = DrugbankGeneralFunctionSearch(key, Apis.Pubchem, target_types)
734
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
735
736
737
class EntryDrugbankDdi(Entry[DrugbankDdiSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
738 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
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.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
742
        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...
743
        to: Optional[Path] = CommonArgs.out_annotations_file,
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...
Unused Code introduced by
The argument as_of seems to be unused.
Loading history...
745
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
746
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
747
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
748
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
749
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
750
    ) -> Searcher:
751
        """
752
        Drug/drug interactions listed by DrugBank.
753
754
        The "description" column includes useful information about the interaction,
755
        such as diseases and whether a risk is increased or decreased.
756
757
        OBJECT: The name of the drug (e.g. "ibuprofen")
758
759
        PREDICATE: typically increase/decrease/change followed by risk/activity/etc.
760
        """
761
        built = DrugbankDdiSearch(key, Apis.Pubchem)
762
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
763
764
765
class EntryPubchemAssay(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
766
    @classmethod
767
    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...
768
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
769
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
770
        key: str = EntryArgs.key("assay.pubchem:act"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
771
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
772
        match_name: bool = EntryArgs.match_name,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
773
        ban_sources: Optional[str] = EntryArgs.banned_sources,
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...
774
        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...
775
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
776
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
777
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
778
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
779
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
780
    ) -> Searcher:
781
        """
782
        PubChem bioactivity results.
783
784
        Note: The species name, if present, is taken from the target name.
785
        The taxon ID is what was curated in PubChem.
786
787
        OBJECT: The name of the target without species suffix
788
                (e.g. "Slc6a3 - solute carrier family 6 member 3")
789
790
        PREDICATE: "active", "inactive", "inconclusive", or "undetermined"
791
792
        WEIGHT: 2 for confirmatory; 1 otherwise
793
        """
794
        built = BioactivitySearch(key, Apis.Pubchem, compound_name_must_match=match_name)
795
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
796
797
798
class EntryDeaSchedule(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
799
    @classmethod
800
    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...
801
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
802
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
803
        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...
804
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
805
        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...
806
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
807
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
808
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
809
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
810
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
811
    ) -> Searcher:
812
        """
813
        DEA schedules (PENDING).
814
815
        OBJECT: The DEA schedule (1 to 4, or "unscheduled")
816
        """
817
        pass
0 ignored issues
show
Unused Code introduced by
Unnecessary pass statement
Loading history...
818
819
820
class EntryDeaClass(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
821
    @classmethod
822
    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...
823
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
824
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
825
        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...
826
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
827
        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...
828
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
829
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
830
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
831
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
832
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
833
    ) -> Searcher:
834
        """
835
        DEA classes (PENDING).
836
837
        OBJECT: The DEA class name (e.g. "hallucinogen")
838
        """
839
        pass
0 ignored issues
show
Unused Code introduced by
Unnecessary pass statement
Loading history...
840
841
842
class EntryChemidPlusAcute(Entry[AcuteEffectSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
843
    @classmethod
844
    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...
845
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
846
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
847
        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...
848
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
849
        level: int = EntryArgs.acute_effect_level,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
850
        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...
851
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
852
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
853
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
854
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
855
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
856
    ) -> Searcher:
857
        """
858
        Acute effect codes from ChemIDPlus.
859
860
        OBJECT: The code name (e.g. "behavioral: excitement")
861
        """
862
        built = AcuteEffectSearch(
863
            key,
864
            Apis.Pubchem,
865
            top_level=level == 1,
866
        )
867
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
868
869
870
class EntryChemidPlusLd50(Entry[Ld50Search]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
871 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
872
    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...
873
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
874
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
875
        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...
876
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
877
        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...
878
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
879
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
880
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
881
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
882
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
883
    ) -> Searcher:
884
        """
885
        LD50 acute effects from ChemIDPlus.
886
887
        OBJECT: The negative of the dose in mg/kg
888
889
        PREDICATE: "LD50:<route>" (e.g. "LD50:intravenous")
890
        """
891
        built = Ld50Search(key, Apis.Pubchem)
892
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
893
894
895
class EntryPubchemComputed(Entry[ComputedPropertySearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
896
    @classmethod
897
    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...
898
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
899
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
900
        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...
901
        keys: str = EntryArgs.pubchem_computed_keys,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
902
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
903
        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...
904
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
905
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
906
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
907
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
908
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
909
    ) -> Searcher:
910
        """
911
        Computed properties from PubChem.
912
913
        OBJECT: Number
914
915
        PREDICATE: e.g. "complexity"
916
        """
917
        # replace acronyms, etc.
918
        # ComputedPropertySearch standardizes punctuation and casing
919
        known = {
920
            k: v
921
            for k, v in {
922
                **EntryArgs.KNOWN_USEFUL_KEYS,
923
                **EntryArgs.KNOWN_USELESS_KEYS,
924
            }.items()
925
            if v is not None
926
        }
927
        keys = {known.get(s.strip(), s) for s in keys.split(",")}
928
        built = ComputedPropertySearch(key, Apis.Pubchem, descriptors=keys)
929
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
930
931
932
class EntryG2pInteractions(Entry[G2pInteractionSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
933
    @classmethod
934
    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...
935
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
936
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
937
        key: str = EntryArgs.key("g2p:interactions"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
938
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
939
        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...
940
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
941
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
942
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
943
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
944
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
945
    ) -> Searcher:
946
        """
947
        Target interactions with affinities from Guide to Pharmacology.
948
949
        OBJECT: A molecular target
950
951
        PREDICATE: "interaction:agonism", etc.
952
953
        WEIGHT: 1.0
954
        """
955
        built = G2pInteractionSearch(key, Apis.G2p)
956
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
957
958
959
class EntryHmdbTissue(Entry[TissueConcentrationSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
960
    @classmethod
961
    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...
962
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
963
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
964
        key: str = EntryArgs.key("hmdb:tissue"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
965
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
966
        min_nm: Optional[float] = EntryArgs.min_nanomolar,
0 ignored issues
show
Unused Code introduced by
The argument min_nm seems to be unused.
Loading history...
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
967
        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...
968
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
969
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
970
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
971
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
972
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
973
    ) -> Searcher:
974
        """
975
        Tissue concentrations from HMDB.
976
977
        OBJECT:
978
979
        PREDICATE: "tissue:..."
980
        """
981
        built = TissueConcentrationSearch(key, Apis.Hmdb)
982
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
983
984
985
class EntryHmdbComputed(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
986
    @classmethod
987
    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...
988
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
989
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
990
        key: str = EntryArgs.key("hmdb:computed"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
991
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
992
        min_nm: Optional[float] = None,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
993
        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...
994
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
995
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
996
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
997
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
998
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
999
    ) -> Searcher:
1000
        """
1001
        Computed properties from HMDB (PENDING).
1002
1003
        Keys include pKa, logP, logS, etc.
1004
1005
        OBJECT: A number; booleans are converted to 0/1
1006
1007
        PREDICATE: The name of the property
1008
        """
1009
        pass
0 ignored issues
show
Unused Code introduced by
Unnecessary pass statement
Loading history...
1010
1011
1012
class EntryDrugbankAdmet(Entry[DrugbankTargetSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
1013
    @classmethod
1014
    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...
1015
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1016
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1017
        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...
1018
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1019
        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...
1020
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1021
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1022
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1023
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1024
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1025
    ) -> Searcher:
1026
        """
1027
        Enzyme predictions from DrugBank (PENDING).
1028
1029
        OBJECT: Enzyme name
1030
1031
        PREDICATE: Action
1032
        """
1033
1034
1035
class EntryDrugbankMetabolites(Entry[DrugbankTargetSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
1036
    @classmethod
1037
    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...
1038
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1039
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1040
        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...
1041
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1042
        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...
1043
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1044
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1045
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1046
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1047
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1048
    ) -> Searcher:
1049
        """
1050
        Metabolites from DrugBank (PENDING).
1051
1052
        OBJECT: Compound name (e.g. "norcocaine").
1053
1054
        PREDICATE: "metabolized to"
1055
        """
1056
1057
1058
class EntryDrugbankDosage(Entry[DrugbankTargetSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
1059
    @classmethod
1060
    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...
1061
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1062
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1063
        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...
1064
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1065
        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...
1066
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1067
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1068
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1069
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1070
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1071
    ) -> Searcher:
1072
        """
1073
        Dosage from DrugBank (PENDING).
1074
1075
        OBJECT: concentration in mg/mL
1076
1077
        PREDICATE: "dosage :: <route>"
1078
1079
        OTHER COLUMNS:
1080
1081
        - form (e.g. liquid)
1082
        """
1083
1084
1085
class EntryMetaRandom(Entry[RandomSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
1086
    @classmethod
1087
    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...
Coding Style Naming introduced by
Argument name "n" 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...
1088
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1089
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1090
        key: str = EntryArgs.key("meta:random"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1091
        to: Optional[Path] = CommonArgs.out_annotations_file,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1092
        n: int = EntryArgs.random_n,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1093
        seed: int = CommonArgs.seed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1094
        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...
1095
        replace: bool = CommonArgs.replace,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1096
        proceed: bool = CommonArgs.proceed,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1097
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1098
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1099
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1100
    ) -> Searcher:
1101
        r"""
1102
        Random class assignment.
1103
1104
        OBJECT: 0 thru n (inclusive-exclusive).
1105
1106
        PREDICATE: "random"
1107
        """
1108
        built = RandomSearch(key, seed, n)
1109
        return cls._run(built, path, to, replace, proceed, check, log, stderr)
1110
1111
1112
Entries = [
1113
    EntryChemblBinding,
1114
    EntryChemblMechanism,
1115
    EntryChemblAtc,
1116
    EntryChemblTrials,
1117
    EntryGoFunction,
1118
    EntryGoProcess,
1119
    EntryGoComponent,
1120
    EntryPubchemComputed,
1121
    EntryPubchemDisease,
1122
    EntryPubchemGeneCoOccurrence,
1123
    EntryPubchemDiseaseCoOccurrence,
1124
    EntryPubchemChemicalCoOccurrence,
1125
    EntryPubchemDgi,
1126
    EntryPubchemCgi,
1127
    EntryDrugbankTarget,
1128
    EntryGeneralFunction,
1129
    EntryDrugbankTransporter,
1130
    EntryTransporterGeneralFunction,
1131
    EntryDrugbankDdi,
1132
    EntryPubchemAssay,
1133
    EntryDeaSchedule,
1134
    EntryDeaClass,
1135
    EntryChemidPlusAcute,
1136
    EntryChemidPlusLd50,
1137
    EntryHmdbTissue,
1138
    EntryMetaRandom,
1139
]
1140