nerdd-module 0.3.39__tar.gz → 0.3.40__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/PKG-INFO +1 -1
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/preprocessing/__init__.py +1 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/preprocessing/filter_by_weight.py +4 -2
- nerdd_module-0.3.40/nerdd_module/preprocessing/remove_small_fragments.py +26 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/preprocessing/remove_stereochemistry.py +2 -0
- nerdd_module-0.3.40/nerdd_module/preprocessing/sanitize.py +31 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/tests/predictions.py +6 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module.egg-info/PKG-INFO +1 -1
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module.egg-info/SOURCES.txt +1 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/pyproject.toml +1 -1
- nerdd_module-0.3.39/nerdd_module/preprocessing/sanitize.py +0 -21
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/LICENSE +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/README.md +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/__init__.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/cli.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/config/__init__.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/config/configuration.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/config/default_configuration.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/config/dict_configuration.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/config/merged_configuration.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/config/models.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/config/package_configuration.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/config/search_yaml_configuration.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/config/yaml_configuration.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/converters/__init__.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/converters/basic_type_converter.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/converters/converter.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/converters/converter_config.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/converters/mol_converter.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/converters/problem_list_converter.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/converters/representation_converter.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/converters/source_list_converter.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/converters/void_converter.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/input/__init__.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/input/depth_first_explorer.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/input/explorer.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/input/file_reader.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/input/gzip_reader.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/input/inchi_reader.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/input/list_reader.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/input/mol_reader.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/input/reader.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/input/reader_config.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/input/sdf_reader.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/input/smiles_reader.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/input/string_reader.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/input/tar_reader.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/input/zip_reader.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/model/__init__.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/model/assign_name_step.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/model/convert_representations_step.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/model/enforce_schema_step.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/model/model.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/model/prediction_step.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/model/read_input_step.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/model/write_output_step.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/output/__init__.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/output/csv_writer.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/output/file_writer.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/output/iterator_writer.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/output/pandas_writer.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/output/record_list_writer.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/output/sdf_writer.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/output/writer.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/output/writer_config.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/polyfills/__init__.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/polyfills/block_logs.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/polyfills/files.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/polyfills/get_entry_points.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/polyfills/literal.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/polyfills/typed_dict.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/polyfills/types.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/polyfills/version.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/preprocessing/check_valid_smiles.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/preprocessing/chembl_structure_pipeline.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/preprocessing/filter_by_element.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/preprocessing/preprocessing_step.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/problem.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/py.typed +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/steps/__init__.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/steps/map_step.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/steps/output_step.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/steps/step.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/tests/__init__.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/tests/checks.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/tests/files.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/tests/models/AtomicMassModel.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/tests/models/MolWeightModel.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/tests/models/__init__.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/tests/preprocessing/DummyPreprocessingStep.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/tests/preprocessing/__init__.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/tests/representations.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/util/__init__.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/util/call_with_mappings.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/util/package.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/version.py +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module.egg-info/dependency_links.txt +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module.egg-info/requires.txt +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module.egg-info/top_level.txt +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/setup.cfg +0 -0
- {nerdd_module-0.3.39 → nerdd_module-0.3.40}/tests/test_features.py +0 -0
|
@@ -6,12 +6,14 @@ from rdkit.Chem.rdMolDescriptors import CalcExactMolWt
|
|
|
6
6
|
from ..problem import InvalidWeightProblem, Problem
|
|
7
7
|
from .preprocessing_step import PreprocessingStep
|
|
8
8
|
|
|
9
|
+
__all__ = ["FilterByWeight"]
|
|
10
|
+
|
|
9
11
|
|
|
10
12
|
class FilterByWeight(PreprocessingStep):
|
|
11
13
|
def __init__(
|
|
12
14
|
self,
|
|
13
|
-
min_weight: float,
|
|
14
|
-
max_weight: float,
|
|
15
|
+
min_weight: float = 0,
|
|
16
|
+
max_weight: float = float("inf"),
|
|
15
17
|
remove_invalid_molecules: bool = False,
|
|
16
18
|
) -> None:
|
|
17
19
|
super().__init__()
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from typing import List, Optional, Tuple
|
|
2
|
+
|
|
3
|
+
from rdkit.Chem import GetMolFrags, Mol
|
|
4
|
+
from rdkit.Chem.rdMolDescriptors import CalcExactMolWt
|
|
5
|
+
|
|
6
|
+
from ..problem import Problem
|
|
7
|
+
from .preprocessing_step import PreprocessingStep
|
|
8
|
+
|
|
9
|
+
__all__ = ["RemoveSmallFragments"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class RemoveSmallFragments(PreprocessingStep):
|
|
13
|
+
def __init__(
|
|
14
|
+
self,
|
|
15
|
+
) -> None:
|
|
16
|
+
super().__init__()
|
|
17
|
+
|
|
18
|
+
def _preprocess(self, mol: Mol) -> Tuple[Optional[Mol], List[Problem]]:
|
|
19
|
+
fragments = GetMolFrags(mol, asMols=True)
|
|
20
|
+
if len(fragments) > 1:
|
|
21
|
+
# select the largest fragment
|
|
22
|
+
largest_fragment = max(fragments, key=CalcExactMolWt)
|
|
23
|
+
else:
|
|
24
|
+
largest_fragment = mol
|
|
25
|
+
|
|
26
|
+
return largest_fragment, []
|
{nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/preprocessing/remove_stereochemistry.py
RENAMED
|
@@ -6,6 +6,8 @@ from rdkit.Chem import RemoveStereochemistry as remove_stereochemistry
|
|
|
6
6
|
from ..problem import Problem
|
|
7
7
|
from .preprocessing_step import PreprocessingStep
|
|
8
8
|
|
|
9
|
+
__all__ = ["RemoveStereochemistry"]
|
|
10
|
+
|
|
9
11
|
|
|
10
12
|
class RemoveStereochemistry(PreprocessingStep):
|
|
11
13
|
def __init__(self) -> None:
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from typing import List, Optional, Tuple
|
|
3
|
+
|
|
4
|
+
from rdkit.Chem import AtomKekulizeException, KekulizeException, Mol, SanitizeMol
|
|
5
|
+
|
|
6
|
+
from ..problem import Problem
|
|
7
|
+
from .preprocessing_step import PreprocessingStep
|
|
8
|
+
|
|
9
|
+
__all__ = ["Sanitize"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
logger = logging.getLogger(__name__)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Sanitize(PreprocessingStep):
|
|
16
|
+
def __init__(self) -> None:
|
|
17
|
+
super().__init__()
|
|
18
|
+
|
|
19
|
+
def _preprocess(self, mol: Mol) -> Tuple[Optional[Mol], List[Problem]]:
|
|
20
|
+
try:
|
|
21
|
+
SanitizeMol(mol)
|
|
22
|
+
return mol, []
|
|
23
|
+
except KekulizeException:
|
|
24
|
+
return None, [Problem("kekulization_error", "Failed kekulizing the molecule.")]
|
|
25
|
+
except AtomKekulizeException:
|
|
26
|
+
return None, [
|
|
27
|
+
Problem("atom_kekulization_error", "Failed kekulizing an atom in the molecule.")
|
|
28
|
+
]
|
|
29
|
+
except Exception as e:
|
|
30
|
+
logger.exception(e)
|
|
31
|
+
return None, [Problem("sanitization_error", "Failed sanitizing the molecule.")]
|
|
@@ -48,6 +48,12 @@ def predictions_atomic_mass_model(representations, version, multiplier):
|
|
|
48
48
|
output_format="record_list",
|
|
49
49
|
)
|
|
50
50
|
|
|
51
|
+
@when(
|
|
52
|
+
"all results are considered",
|
|
53
|
+
target_fixture="subset",
|
|
54
|
+
)
|
|
55
|
+
def subset_without_none(predictions):
|
|
56
|
+
return predictions
|
|
51
57
|
|
|
52
58
|
@when(
|
|
53
59
|
"the subset of the result where the input was not None is considered",
|
|
@@ -75,6 +75,7 @@ nerdd_module/preprocessing/chembl_structure_pipeline.py
|
|
|
75
75
|
nerdd_module/preprocessing/filter_by_element.py
|
|
76
76
|
nerdd_module/preprocessing/filter_by_weight.py
|
|
77
77
|
nerdd_module/preprocessing/preprocessing_step.py
|
|
78
|
+
nerdd_module/preprocessing/remove_small_fragments.py
|
|
78
79
|
nerdd_module/preprocessing/remove_stereochemistry.py
|
|
79
80
|
nerdd_module/preprocessing/sanitize.py
|
|
80
81
|
nerdd_module/steps/__init__.py
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
from typing import List, Optional, Tuple
|
|
2
|
-
|
|
3
|
-
from rdkit.Chem import Mol, SanitizeMol
|
|
4
|
-
|
|
5
|
-
from ..problem import Problem
|
|
6
|
-
from .preprocessing_step import PreprocessingStep
|
|
7
|
-
|
|
8
|
-
__all__ = ["Sanitize"]
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class Sanitize(PreprocessingStep):
|
|
12
|
-
def __init__(self) -> None:
|
|
13
|
-
super().__init__()
|
|
14
|
-
|
|
15
|
-
def _preprocess(self, mol: Mol) -> Tuple[Optional[Mol], List[Problem]]:
|
|
16
|
-
problems: List[Problem] = []
|
|
17
|
-
|
|
18
|
-
# sanitize molecule
|
|
19
|
-
SanitizeMol(mol)
|
|
20
|
-
|
|
21
|
-
return mol, problems
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/config/search_yaml_configuration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/converters/problem_list_converter.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/converters/representation_converter.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/converters/source_list_converter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/model/convert_representations_step.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/preprocessing/check_valid_smiles.py
RENAMED
|
File without changes
|
{nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/preprocessing/chembl_structure_pipeline.py
RENAMED
|
File without changes
|
|
File without changes
|
{nerdd_module-0.3.39 → nerdd_module-0.3.40}/nerdd_module/preprocessing/preprocessing_step.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|