Skip to content

Commit

Permalink
update default fp functions values
Browse files Browse the repository at this point in the history
  • Loading branch information
eloyfelix committed Dec 26, 2024
1 parent d9f40bd commit 16117e9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
5 changes: 5 additions & 0 deletions FPSim2/io/backends/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ def create_db_file(

if not fp_params:
fp_params = FP_FUNC_DEFAULTS[fp_type]
else:
if "fpSize" not in fp_params:
if "fpSize" in FP_FUNC_DEFAULTS[fp_type]:
fp_params["fpSize"] = FP_FUNC_DEFAULTS[fp_type]["fpSize"]

supplier = get_mol_supplier(mols_source)
fp_length = get_fp_length(fp_type, fp_params)
filters = tb.Filters(complib="blosc2", complevel=9, fletcher32=False)
Expand Down
35 changes: 15 additions & 20 deletions FPSim2/io/chem.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
}

FP_FUNCS = {
"MACCSKeys": lambda m,
**kwargs: rdMolDescriptors.GetMACCSKeysFingerprint(m),
"MACCSKeys": lambda m, **kwargs: rdMolDescriptors.GetMACCSKeysFingerprint(m),
"Morgan": lambda m, **kwargs: rdFingerprintGenerator.GetMorganGenerator(
**kwargs
).GetFingerprint(m),
Expand All @@ -37,50 +36,46 @@
"RDKit": lambda m, **kwargs: rdFingerprintGenerator.GetRDKitFPGenerator(
**kwargs
).GetFingerprint(m),
"Pattern": lambda m, **kwargs: Chem.PatternFingerprint(m),
"RDKitPattern": lambda m, **kwargs: Chem.PatternFingerprint(m),
}

FP_FUNC_DEFAULTS = {
"MACCSKeys": {},
"Morgan": {
"radius": 3,
"fpSize": 2048,
"countSimulation": False,
"includeChirality": False,
"useBondTypes": True,
"useCountSimulation": False,
"countBounds": None,
"fpSize": 2048,
"radius": 2,
"onlyNonzeroInvariants": False,
"includeRingMembership": True,
"includeRedundantEnvironments": False,
},
"TopologicalTorsion": {
"includeChirality": False,
"fpSize": 2048,
"countSimulation": False,
"countBounds": None,
"includeChirality": False,
"torsionAtomCount": 4,
"countSimulation": True,
},
"AtomPair": {
"includeChirality": False,
"fpSize": 2048,
"countSimulation": False,
"countBounds": None,
"minDistance": 1,
"maxDistance": 30,
"includeChirality": False,
"use2D": True,
"countSimulation": True,
},
"RDKit": {
"fpSize": 2048,
"minPath": 1,
"maxPath": 7,
"countSimulation": False,
"countBounds": None,
"useHs": True,
"branchedPaths": True,
"useBondOrder": True,
},
"Pattern": {
"fpSize": 2048,
"countSimulation": False,
"countBounds": None,
"tautomerFingerprints": False,
"numBitsPerFeature": 2,
},
"RDKitPattern": {"fpSize": 2048, "tautomerFingerprints": False},
}


Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/create_db_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The fingerprints are calculated with [RDKit](https://www.rdkit.org/). Fingerprin
- [TopologicalTorsion](https://www.rdkit.org/docs/source/rdkit.Chem.rdFingerprintGenerator.html#rdkit.Chem.rdFingerprintGenerator.GetTopologicalTorsionGenerator)
- [AtomPair](https://www.rdkit.org/docs/source/rdkit.Chem.rdFingerprintGenerator.html#rdkit.Chem.rdFingerprintGenerator.GetAtomPairGenerator)
- [RDKit](https://www.rdkit.org/docs/source/rdkit.Chem.rdFingerprintGenerator.html#rdkit.Chem.rdFingerprintGenerator.GetRDKitFPGenerator)
- [RDKPatternFingerprint](https://www.rdkit.org/docs/source/rdkit.Chem.rdmolops.html#rdkit.Chem.rdmolops.PatternFingerprint)
- [RDKitPattern](https://www.rdkit.org/docs/source/rdkit.Chem.rdmolops.html#rdkit.Chem.rdmolops.PatternFingerprint)

## From a .sdf file
```python
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/subs_screenout.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Use the `FPSim2.FPSim2Engine.substructure` function to run an optimised Tversky (*a=1*, *b=0*, *threshold=1.0*) substructure screenout. Bear in mind that this is not a full substructure (i.e. with subgraph isomorphism) search.

!!! tip
It's recommended to use **RDKPatternFingerprint** fingerprint type with this kind of searches.
It's recommended to use **RDKitPattern** fingerprint type with this kind of searches.

```python
from FPSim2 import FPSim2Engine
Expand Down

0 comments on commit 16117e9

Please sign in to comment.