diff --git a/README.md b/README.md index 42f486d..b2b27d2 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,28 @@ fingerprints = from_mdl('mols.mdl', fingerprints=True, descriptors=False) _ = from_mdl('mols.mdl', output_csv='descriptors.csv') ``` +### SDF to Descriptors/Fingerprints + +The "from_sdf" function accepts a filepath as an argument, and returns a list. +Each list element is a dictionary with descriptors/fingerprints corresponding to each supplied +molecule (indexed as they appear in the SDF file). + +```python +from padelpy import from_sdf + +# calculate molecular descriptors for molecules in `mols.sdf` +descriptors = from_sdf('mols.sdf') + +# in addition to descriptors, calculate PubChem fingerprints +desc_fp = from_sdf('mols.sdf', fingerprints=True) + +# only calculate fingerprints +fingerprints = from_sdf('mols.sdf', fingerprints=True, descriptors=False) + +# save descriptors to a CSV file +_ = from_sdf('mols.sdf', output_csv='descriptors.csv') +``` + ### Command Line Wrapper Alternatively, you can have more control over PaDEL-Descriptor with the command-line wrapper function. Any combination of arguments supported by PaDEL-Descriptor can be accepted by the "padeldescriptor" function. @@ -84,9 +106,12 @@ from padelpy import padeldescriptor # to supply a configuration file padeldescriptor(config='\\path\\to\\config') -# to supply an input and output file +# to supply an input (MDL) and output file padeldescriptor(mol_dir='molecules.mdl', d_file='descriptors.csv') +# to supply an input (SDF) and output file +padeldescriptor(mol_dir='molecules.sdf', d_file='descriptors.csv') + # a SMILES file can be supplied padeldescriptor(mol_dir='molecules.smi', d_file='descriptors.csv')