Skip to main content

mordred-community

Community maintained version of the mordred molecular descriptor calculator which is no longer maintained.

We are accepting pull requests and looking for maintainers! Reach out on the Issues page if you are interested in helping out!

Installation

mordredcommunity is currently available on PyPI with pip install mordredcommunity or via the conda package manager with conda install -c conda-forge mordredcommunity.

mordredcommunity supports Python 3.9 and newer on all platforms.

To add support for pandas and progress bars, use PyPI and call pip install mordredcommunity[full].

Usage of mordredcommunity is the same as mordred.

Packages using mordredcommunity

Number of Descriptors

>>> from mordred import Calculator, descriptors
>>> n_all = len(Calculator(descriptors, ignore_3D=False).descriptors)
>>> n_2D = len(Calculator(descriptors, ignore_3D=True).descriptors)
>>> print("2D:    {:5}\n3D:    {:5}\n------------\ntotal: {:5}".format(n_2D, n_all - n_2D, n_all))
2D:     1613
3D:      213
------------
total:  1826

Examples

calculate all descriptors

$ python -m mordred example.smi
name,ECIndex,WPath,WPol,Zagreb1, (snip)
benzene,36,27,3,24.0, (snip)
chrolobenzene,45,42,5,30.0, (snip)

save to file (display progress bar)

$ python -m mordred example.smi -o example.csv
50%|███████████████████████████████████████▌                                       | 1/2 [00:00<00:00,  7.66it/s]

stream read (low memory, no number of molecules information)

$ python -m mordred example.smi -s -o example.csv
0it [00:00, ?it/s]

only ABCIndex

$ python -m mordred example.smi -d ABCIndex
name,ABC,ABCGG
benzene,4.242640687119286,3.9999999999999996
chlorobenzene,5.059137268047012,4.785854275382693

ABCIndex and AcidBase

$ python -m mordred example.smi -d ABCIndex -d AcidBase
name,ABC,ABCGG,nAcid,nBase
benzene,4.242640687119286,3.9999999999999996,0,0
chlorobenzene,5.059137268047012,4.785854275382693,0,0

multiple input

$ python -m mordred example.smi example2.smi -d ABCIndex
name,ABC,ABCGG
benzene,4.242640687119286,3.9999999999999996
chlorobenzene,5.059137268047012,4.785854275382693
pentane,2.8284271247461903,3.1462643699419726

show help

$ python -m mordred --help
usage: python -m mordred [-h] [--version] [-t {auto,sdf,mol,smi}] [-o OUTPUT]
                            [-p PROCESSES] [-q] [-s] [-d DESC] [-3] [-v]
                            INPUT [INPUT ...]

positional arguments:
    INPUT

optional arguments:
    -h, --help            show this help message and exit
    --version             input molecular file
    -t {auto,sdf,mol,smi}, --type {auto,sdf,mol,smi}
                        input filetype (default: auto)
    -o OUTPUT, --output OUTPUT
                        output file path (default: stdout)
    -p PROCESSES, --processes PROCESSES
                        number of processes (default: number of logical
                        processors)
    -q, --quiet           hide progress bar
    -s, --stream          stream read
    -d DESC, --descriptor DESC
                        descriptors to calculate (default: all)
    -3, --3D              use 3D descriptors (require sdf or mol file)
    -v, --verbosity       verbosity

descriptors: ABCIndex AcidBase AdjacencyMatrix Aromatic AtomCount
Autocorrelation BalabanJ BaryszMatrix BCUT BertzCT BondCount CarbonTypes Chi
Constitutional CPSA DetourMatrix DistanceMatrix EccentricConnectivityIndex
EState ExtendedTopochemicalAtom FragmentComplexity Framework GeometricalIndex
GravitationalIndex HydrogenBond InformationContent KappaShapeIndex Lipinski
McGowanVolume MoeType MolecularDistanceEdge MolecularId MomentOfInertia MoRSE
PathCount Polarizability RingCount RotatableBond SLogP TopologicalCharge
TopologicalIndex TopoPSA VdwVolumeABC VertexAdjacencyInformation WalkCount
Weight WienerIndex ZagrebIndex

as library

>>> from rdkit import Chem
>>> from mordred import Calculator, descriptors

# create descriptor calculator with all descriptors
>>> calc = Calculator(descriptors, ignore_3D=True)

>>> len(calc.descriptors)
1613

>>> len(Calculator(descriptors, ignore_3D=True, version="1.0.0"))
1612

# calculate single molecule
>>> mol = Chem.MolFromSmiles('c1ccccc1')
>>> calc(mol)[:3]
[4.242640687119286, 3.9999999999999996, 0]

# calculate multiple molecule
>>> mols = [Chem.MolFromSmiles(smi) for smi in ['c1ccccc1Cl', 'c1ccccc1O', 'c1ccccc1N']]

# as pandas
>>> df = calc.pandas(mols)
>>> df['SLogP']
0    2.3400
1    1.3922
2    1.2688
Name: SLogP, dtype: float64

Additional Examples

see examples on GitHub.

Citation

Please cite the original publication describing mordred and this repository specifically. Moriwaki H, Tian Y-S, Kawashita N, Takagi T (2018) Mordred: a molecular descriptor calculator. Journal of Cheminformatics 10:4 . doi: 10.1186/s13321-018-0258-y

Metadata

Release files for mordredcommunity 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mordredcommunity 2.1.0
File Size Uploaded Provenance Actions
mordredcommunity-2.1.0.tar.gz 131.5 kB Without provenance Details for mordredcommunity-2.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mordredcommunity 2.1.0
File Interpreter ABI Platform Actions
mordredcommunity-2.1.0-py3-none-any.whl Python 3 none any Details for mordredcommunity-2.1.0-py3-none-any.whl

Total release size: 308.2 kB

Release files / mordredcommunity-2.1.0.tar.gz

Download URL mordredcommunity-2.1.0.tar.gz
Size 131.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1b38dd54d3200a57b5b9de70f8b18cd5550b4bc2091e67f2ad98c76611a598e1
BLAKE2b-256 checksum
How to use checksums
8a7f1fbb9c1ecc62ea7783dbcc39a530de1ddbbe5c1e10b537d85378fa1898be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / mordredcommunity-2.1.0-py3-none-any.whl

Download URL mordredcommunity-2.1.0-py3-none-any.whl
Size 176.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8e585846a256ab9997218a16e8bf816c7455a9e2a54373e98955a7698d91193
BLAKE2b-256 checksum
How to use checksums
5681de34dbd15857fadd3360c303663e9e396b349a346e6c98f5ad1995196b1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for mordredcommunity 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page