Passed
Push — main ( cee75c...37036d )
by Douglas
02:08
created

mandos.entry.entry_commands.EntryPubchemDgi.run()   A

Complexity

Conditions 1

Size

Total Lines 24
Code Lines 13

Duplication

Lines 24
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 13
nop 9
dl 24
loc 24
rs 9.75
c 0
b 0
f 0

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

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

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

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

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

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

Loading history...
best-practice introduced by
Too many arguments (9/5)
Loading history...
437
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
438
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
439
        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...
440
        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...
441
        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...
442
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
443
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
444
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
445
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
446
    ) -> Searcher:
447
        """
448
        Diseases in the CTD.
449
450
        (Comparative Toxicogenomics Database.)
451
452
        OBJECT: The MeSH code of the disease
453
454
        """
455
        built = DiseaseSearch(key, Apis.Pubchem)
456
        return cls._run(built, path, to, check, log, stderr, no_setup)
457
458
459
class _EntryPubchemCoOccurrence(Entry[U], metaclass=abc.ABCMeta):
460
    @classmethod
461
    def cmd(cls) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
462
        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...
463
        return f"lit.pubchem:{me.lower()}"
464
465
    @classmethod
466
    def get_cooccurrence_type(cls) -> CoOccurrenceType:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
467
        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...
468
        return s.cooccurrence_type()
469
470
    @classmethod
471
    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...
472
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
473
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
474
        key: str = EntryArgs.key("<see above>"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
475
        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...
476
        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...
477
        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...
478
        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...
479
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
480
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
481
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
482
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
483
    ) -> Searcher:
484
        """See the docstrings for the individual entries."""
485
        clazz = cls.get_search_type()
486
        built = clazz(key, Apis.Pubchem, min_score=min_score, min_articles=min_articles)
487
        return cls._run(built, path, to, check, log, stderr, no_setup)
488
489
490 View Code Duplication
class EntryPubchemGeneCoOccurrence(_EntryPubchemCoOccurrence[GeneCoOccurrenceSearch]):
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...
491
    @classmethod
492
    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...
493
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
494
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
495
        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...
496
        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...
497
        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...
498
        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...
499
        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...
500
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
501
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
502
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
503
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
504
    ) -> Searcher:
505
        """
506
        Co-occurrences of genes from PubMed articles.
507
508
        https://mandos-chem.readthedocs.io/en/latest/co-occurrences.html
509
510
        OBJECT: The name of the gene
511
512
        WEIGHT: The co-occurrence score (refer to the docs)
513
        """
514
        return super().run(
515
            path=path,
516
            key=key,
517
            to=to,
518
            min_score=min_score,
519
            min_articles=min_articles,
520
            as_of=as_of,
521
            log=log,
522
            check=check,
523
            stderr=stderr,
524
            no_setup=no_setup,
525
        )
526
527
528 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...
529
    @classmethod
530
    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...
531
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
532
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
533
        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...
534
        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...
535
        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...
536
        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...
537
        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...
538
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
539
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
540
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
541
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
542
    ) -> Searcher:
543
        """
544
        Co-occurrences of diseases from PubMed articles.
545
546
        https://mandos-chem.readthedocs.io/en/latest/co-occurrences.html
547
548
        OBJECT: The name of the disease
549
550
        WEIGHT: The co-occurrence score (refer to the docs)
551
        """
552
        return super().run(
553
            path=path,
554
            key=key,
555
            to=to,
556
            min_score=min_score,
557
            min_articles=min_articles,
558
            as_of=as_of,
559
            log=log,
560
            check=check,
561
            stderr=stderr,
562
            no_setup=no_setup,
563
        )
564
565
566 View Code Duplication
class EntryPubchemChemicalCoOccurrence(_EntryPubchemCoOccurrence[ChemicalCoOccurrenceSearch]):
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...
567
    @classmethod
568
    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...
569
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
570
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
571
        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...
572
        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...
573
        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...
574
        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...
575
        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...
576
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
577
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
578
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
579
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
580
    ) -> Searcher:
581
        """
582
        Co-occurrences of chemicals from PubMed articles.
583
584
        https://mandos-chem.readthedocs.io/en/latest/co-occurrences.html
585
586
        OBJECT: The name of the chemical (e.g. "cocaine")
587
588
        WEIGHT: The co-occurrence score (refer to the docs)
589
        """
590
        return super().run(
591
            path=path,
592
            key=key,
593
            to=to,
594
            min_score=min_score,
595
            min_articles=min_articles,
596
            as_of=as_of,
597
            log=log,
598
            check=check,
599
            stderr=stderr,
600
            no_setup=no_setup,
601
        )
602
603
604
class EntryPubchemDgi(Entry[DgiSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
605 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
606
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (9/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...
607
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
608
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
609
        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...
610
        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...
611
        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...
612
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
613
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
614
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
615
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
616
    ) -> Searcher:
617
        """
618
        Drug/gene interactions in the DGIDB.
619
620
        Drug Gene Interaction Database.
621
        Also see disease.dgidb:int.
622
623
        OBJECT: The name of the gene
624
625
        PREDICATE: "interaction:generic" or "interaction:<type>"
626
        """
627
        built = DgiSearch(key, Apis.Pubchem)
628
        return cls._run(built, path, to, check, log, stderr, no_setup)
629
630
631
class EntryPubchemCgi(Entry[CtdGeneSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
632 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
633
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (9/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...
634
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
635
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
636
        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...
637
        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...
638
        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...
639
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
640
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
641
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
642
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
643
    ) -> Searcher:
644
        """
645
        Compound/gene interactions in the DGIDB.
646
647
        Drug Gene Interaction Database.
648
        Also see ``interact.dgidb:int``.
649
650
        OBJECT: The name of the gene
651
652
        PREDICATE: derived from the interaction type (e.g. "downregulation")
653
        """
654
        built = CtdGeneSearch(key, Apis.Pubchem)
655
        return cls._run(built, path, to, check, log, stderr, no_setup)
656
657
658
class EntryDrugbankTarget(Entry[DrugbankTargetSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
659 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
660
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (9/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...
661
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
662
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
663
        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...
664
        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...
665
        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...
666
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
667
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
668
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
669
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
670
    ) -> Searcher:
671
        """
672
        Protein targets from DrugBank.
673
674
        OBJECT: The target name (e.g. "Solute carrier family 22 member 11")
675
676
        PREDICATE: "<target_type>:<action>"
677
        """
678
        built = DrugbankTargetSearch(key, Apis.Pubchem, {DrugbankTargetType.target})
679
        return cls._run(built, path, to, check, log, stderr, no_setup)
680
681
682
class EntryGeneralFunction(Entry[DrugbankGeneralFunctionSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
683 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
684
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (9/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...
685
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
686
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
687
        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...
688
        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...
689
        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...
690
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
691
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
692
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
693
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
694
    ) -> Searcher:
695
        """
696
        General functions from DrugBank targets.
697
698
        OBJECT: The name of the "general function" (e.g. "Toxic substance binding")
699
700
        PREDICATE: "<target_type>:<action>"
701
        """
702
        built = DrugbankGeneralFunctionSearch(key, Apis.Pubchem, {DrugbankTargetType.target})
703
        return cls._run(built, path, to, check, log, stderr, no_setup)
704
705
706 View Code Duplication
class EntryDrugbankTransporter(Entry[DrugbankTargetSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
707
    @classmethod
708
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (9/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...
709
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
710
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
711
        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...
712
        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...
713
        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...
714
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
715
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
716
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
717
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
718
    ) -> Searcher:
719
        """
720
        PK-related proteins from DrugBank.
721
722
        OBJECT: The transporter name (e.g. "Solute carrier family 22 member 11")
723
724
        PREDICATE: "<target_type>:<action>" (e.g. metabolized, transported, etc.)
725
        """
726
        target_types = {
727
            DrugbankTargetType.transporter,
728
            DrugbankTargetType.carrier,
729
            DrugbankTargetType.enzyme,
730
        }
731
        built = DrugbankTargetSearch(key, Apis.Pubchem, target_types)
732
        return cls._run(built, path, to, check, log, stderr, no_setup)
733
734
735 View Code Duplication
class EntryTransporterGeneralFunction(Entry[DrugbankGeneralFunctionSearch]):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
736
    @classmethod
737
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

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

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

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

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

Loading history...
best-practice introduced by
Too many arguments (9/5)
Loading history...
738
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
739
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
740
        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...
741
        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...
742
        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...
743
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
744
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
745
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
746
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
747
    ) -> Searcher:
748
        """
749
        DrugBank PK-related protein functions.
750
751
        OBJECT: The name of the general function (e.g. "Toxic substance binding")
752
753
        PREDICATE: "<target_type>:<action>" (e.g. metabolized, transported, etc.)
754
        """
755
        target_types = {
756
            DrugbankTargetType.transporter,
757
            DrugbankTargetType.carrier,
758
            DrugbankTargetType.enzyme,
759
        }
760
        built = DrugbankGeneralFunctionSearch(key, Apis.Pubchem, target_types)
761
        return cls._run(built, path, to, check, log, stderr, no_setup)
762
763
764
class EntryDrugbankDdi(Entry[DrugbankDdiSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
765 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
766
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (9/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...
767
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
768
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
769
        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...
770
        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...
771
        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...
772
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
773
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
774
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
775
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
776
    ) -> Searcher:
777
        """
778
        Drug/drug interactions listed by DrugBank.
779
780
        The "description" column includes useful information about the interaction,
781
        such as diseases and whether a risk is increased or decreased.
782
783
        OBJECT: The name of the drug (e.g. "ibuprofen")
784
785
        PREDICATE: typically increase/decrease/change followed by risk/activity/etc.
786
        """
787
        built = DrugbankDdiSearch(key, Apis.Pubchem)
788
        return cls._run(built, path, to, check, log, stderr, no_setup)
789
790
791
class EntryPubchemAssay(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
792
    @classmethod
793
    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...
794
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
795
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
796
        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...
797
        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...
798
        name_must_match: bool = EntryArgs.name_must_match,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
799
        ban_sources: Optional[str] = EntryArgs.banned_sources,
0 ignored issues
show
Unused Code introduced by
The argument ban_sources seems to be unused.
Loading history...
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
800
        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...
801
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
802
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
803
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
804
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
805
    ) -> Searcher:
806
        """
807
        PubChem bioactivity results.
808
809
        Note: The species name, if present, is taken from the target name.
810
        The taxon ID is what was curated in PubChem.
811
812
        OBJECT: The name of the target without species suffix
813
                (e.g. "Slc6a3 - solute carrier family 6 member 3")
814
815
        PREDICATE: "active", "inactive", "inconclusive", or "undetermined"
816
817
        WEIGHT: 2 for confirmatory; 1 otherwise
818
        """
819
        built = BioactivitySearch(key, Apis.Pubchem, compound_name_must_match=name_must_match)
820
        return cls._run(built, path, to, check, log, stderr, no_setup)
821
822
823
class EntryDeaSchedule(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
824
    @classmethod
825
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (9/5)
Loading history...
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

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

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

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

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

Loading history...
826
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
827
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
828
        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...
829
        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...
830
        as_of: Optional[str] = CommonArgs.as_of,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
831
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
832
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
833
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
834
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
835
    ) -> Searcher:
836
        """
837
        DEA schedules (PENDING).
838
839
        OBJECT: The DEA schedule (1 to 4, or "unscheduled")
840
        """
841
        pass
0 ignored issues
show
Unused Code introduced by
Unnecessary pass statement
Loading history...
842
843
844
class EntryDeaClass(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
845
    @classmethod
846
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

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

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

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

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

Loading history...
best-practice introduced by
Too many arguments (9/5)
Loading history...
847
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
848
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
849
        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...
850
        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...
851
        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...
852
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
853
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
854
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
855
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
856
    ) -> Searcher:
857
        """
858
        DEA classes (PENDING).
859
860
        OBJECT: The DEA class name (e.g. "hallucinogen")
861
        """
862
        pass
0 ignored issues
show
Unused Code introduced by
Unnecessary pass statement
Loading history...
863
864
865
class EntryChemidPlusAcute(Entry[AcuteEffectSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
866
    @classmethod
867
    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...
868
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
869
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
870
        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...
871
        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...
872
        level: int = EntryArgs.acute_effect_level,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
873
        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...
874
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
875
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
876
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
877
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
878
    ) -> Searcher:
879
        """
880
        Acute effect codes from ChemIDPlus.
881
882
        OBJECT: The code name (e.g. "behavioral: excitement")
883
        """
884
        built = AcuteEffectSearch(
885
            key,
886
            Apis.Pubchem,
887
            top_level=level == 1,
888
        )
889
        return cls._run(built, path, to, check, log, stderr, no_setup)
890
891
892
class EntryChemidPlusLd50(Entry[Ld50Search]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
893 View Code Duplication
    @classmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
894
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

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

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

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

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

Loading history...
best-practice introduced by
Too many arguments (9/5)
Loading history...
895
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
896
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
897
        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...
898
        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...
899
        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...
900
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
901
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
902
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
903
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
904
    ) -> Searcher:
905
        """
906
        LD50 acute effects from ChemIDPlus.
907
908
        OBJECT: The negative log10 of the dose in mg/kg
909
910
        PREDICATE: "LD50:<route>" (e.g. "LD50:intravenous")
911
        """
912
        built = Ld50Search(key, Apis.Pubchem)
913
        return cls._run(built, path, to, check, log, stderr, no_setup)
914
915
916
class EntryG2pInteractions(Entry[G2pInteractionSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
917
    @classmethod
918
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

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

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

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

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

Loading history...
best-practice introduced by
Too many arguments (9/5)
Loading history...
919
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
920
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
921
        key: str = EntryArgs.key("g2p:interactions"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
922
        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...
923
        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...
924
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
925
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
926
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
927
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
928
    ) -> Searcher:
929
        """
930
        Target interactions with affinities from Guide to Pharmacology.
931
932
        OBJECT: A molecular target
933
934
        PREDICATE: "interaction:agonism", etc.
935
936
        WEIGHT: 1.0
937
        """
938
        built = G2pInteractionSearch(key, Apis.G2p)
939
        return cls._run(built, path, to, check, log, stderr, no_setup)
940
941
942
class EntryHmdbTissue(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
943
    @classmethod
944
    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...
945
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
946
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
947
        key: str = EntryArgs.key("hmdb:tissue"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
948
        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...
949
        min_nanomolar: Optional[float] = EntryArgs.min_nanomolar,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
950
        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...
951
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
952
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
953
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
954
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
955
    ) -> Searcher:
956
        """
957
        Tissue concentrations from HMDB (PENDING).
958
959
        OBJECT:
960
961
        PREDICATE: "tissue:..."
962
        """
963
        pass
0 ignored issues
show
Unused Code introduced by
Unnecessary pass statement
Loading history...
964
965
966
class EntryHmdbComputed(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
967
    @classmethod
968
    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...
969
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
970
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
971
        key: str = EntryArgs.key("hmdb:computed"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
972
        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...
973
        min_nanomolar: Optional[float] = None,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
974
        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...
975
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
976
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
977
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
978
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
979
    ) -> Searcher:
980
        """
981
        Computed properties from HMDB (PENDING).
982
983
        Keys include pKa, logP, logS, etc.
984
985
        OBJECT: A number; booleans are converted to 0/1
986
987
        PREDICATE: The name of the property
988
        """
989
        pass
0 ignored issues
show
Unused Code introduced by
Unnecessary pass statement
Loading history...
990
991
992
class EntryPubchemComputed(Entry[ComputedPropertySearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
993
    @classmethod
994
    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...
995
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
996
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
997
        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...
998
        keys: str = EntryArgs.pubchem_computed_keys,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
999
        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...
1000
        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...
1001
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1002
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1003
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1004
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1005
    ) -> Searcher:
1006
        """
1007
        Computed properties from PubChem.
1008
1009
        OBJECT: Number
1010
1011
        PREDICATE: e.g. "complexity"
1012
        """
1013
        # replace acronyms, etc.
1014
        # ComputedPropertySearch standardizes punctuation and casing
1015
        known = {
1016
            k: v
1017
            for k, v in {
1018
                **EntryArgs.KNOWN_USEFUL_KEYS,
1019
                **EntryArgs.KNOWN_USELESS_KEYS,
1020
            }.items()
1021
            if v is not None
1022
        }
1023
        keys = {known.get(s.strip(), s) for s in keys.split(",")}
1024
        built = ComputedPropertySearch(key, Apis.Pubchem, descriptors=keys)
1025
        return cls._run(built, path, to, check, log, stderr, no_setup)
1026
1027
1028
class EntryDrugbankAdmet(Entry[DrugbankTargetSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
1029
    @classmethod
1030
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (9/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...
1031
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1032
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1033
        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...
1034
        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...
1035
        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...
1036
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1037
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1038
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1039
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1040
    ) -> Searcher:
1041
        """
1042
        Enzyme predictions from DrugBank (PENDING).
1043
1044
        OBJECT: Enzyme name
1045
1046
        PREDICATE: Action
1047
        """
1048
1049
1050
class EntryDrugbankMetabolites(Entry[DrugbankTargetSearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
1051
    @classmethod
1052
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (9/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...
1053
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1054
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1055
        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...
1056
        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...
1057
        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...
1058
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1059
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1060
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1061
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1062
    ) -> Searcher:
1063
        """
1064
        Metabolites from DrugBank (PENDING).
1065
1066
        OBJECT: Compound name (e.g. "norcocaine").
1067
1068
        PREDICATE: "metabolized to"
1069
        """
1070
1071
1072
class EntryDrugbankDosage(Entry[DrugbankTargetSearch]):
0 ignored issues
show
introduced by
Value 'Entry' is unsubscriptable
Loading history...
introduced by
Missing class docstring
Loading history...
1073
    @classmethod
1074
    def run(
0 ignored issues
show
Coding Style Naming introduced by
Argument name "to" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

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

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

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

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

Loading history...
best-practice introduced by
Too many arguments (9/5)
Loading history...
1075
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1076
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1077
        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...
1078
        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...
1079
        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...
1080
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1081
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1082
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1083
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1084
    ) -> Searcher:
1085
        """
1086
        Dosage from DrugBank (PENDING).
1087
1088
        OBJECT: concentration in mg/mL
1089
1090
        PREDICATE: "dosage :: <route>"
1091
1092
        OTHER COLUMNS:
1093
1094
        - form (e.g. liquid)
1095
        """
1096
1097
1098
class EntryMetaRandom(Entry[BioactivitySearch]):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
introduced by
Value 'Entry' is unsubscriptable
Loading history...
1099
    @classmethod
1100
    def run(
0 ignored issues
show
best-practice introduced by
Too many arguments (9/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...
1101
        cls,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1102
        path: Path = CommonArgs.in_compound_table,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1103
        key: str = EntryArgs.key("meta:random"),
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1104
        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...
1105
        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...
1106
        check: bool = EntryArgs.check,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1107
        log: Optional[Path] = CommonArgs.log,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1108
        stderr: str = CommonArgs.stderr,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1109
        no_setup: bool = CommonArgs.no_setup,
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
1110
    ) -> Searcher:
1111
        """
1112
        Random class assignment (PENDING).
1113
1114
        OBJECT: 1 thru n-compounds
1115
1116
        PREDICATE: "random"
1117
        """
1118
        pass
0 ignored issues
show
Unused Code introduced by
Unnecessary pass statement
Loading history...
1119
1120
1121
Entries = [
1122
    EntryChemblBinding,
1123
    EntryChemblMechanism,
1124
    EntryChemblAtc,
1125
    EntryChemblTrials,
1126
    EntryGoFunction,
1127
    EntryGoProcess,
1128
    EntryGoComponent,
1129
    EntryPubchemComputed,
1130
    EntryPubchemDisease,
1131
    EntryPubchemGeneCoOccurrence,
1132
    EntryPubchemDiseaseCoOccurrence,
1133
    EntryPubchemChemicalCoOccurrence,
1134
    EntryPubchemDgi,
1135
    EntryPubchemCgi,
1136
    EntryDrugbankTarget,
1137
    EntryGeneralFunction,
1138
    EntryDrugbankTransporter,
1139
    EntryTransporterGeneralFunction,
1140
    EntryDrugbankDdi,
1141
    EntryPubchemAssay,
1142
    EntryDeaSchedule,
1143
    EntryDeaClass,
1144
    EntryChemidPlusAcute,
1145
    EntryChemidPlusLd50,
1146
    EntryHmdbTissue,
1147
    EntryMetaRandom,
1148
]
1149