scikit-fingerprints


Namescikit-fingerprints JSON
Version 1.9.0 PyPI version JSON
download
home_pagehttps://github.com/scikit-fingerprints/scikit-fingerprints
SummaryLibrary for effective molecular fingerprints calculation
upload_time2024-10-05 14:03:10
maintainerNone
docs_urlNone
authorScikit-Fingerprints Development Team
requires_python<4.0,>=3.9
licenseMIT
keywords molecular fingerprints molecular descriptors cheminformatics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # scikit-fingerprints

[![PyPI version](https://badge.fury.io/py/scikit-fingerprints.svg)](https://badge.fury.io/py/scikit-fingerprints)
[![](https://img.shields.io/pypi/dm/scikit-fingerprints)](https://pypi.org/project/scikit-fingerprints/)
[![Downloads](https://static.pepy.tech/badge/scikit-fingerprints)](https://pepy.tech/project/scikit-fingerprints)
![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/pypi/scikit-fingerprints)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE.md)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/scikit-fingerprints.svg)](https://pypi.org/project/scikit-fingerprints/)
[![Contributors](https://img.shields.io/github/contributors/scikit-fingerprints/scikit-fingerprints)](https://github.com/scikit-fingerprints/scikit-fingerprints/graphs/contributors)
[![check](https://github.com/scikit-fingerprints/scikit-fingerprints/actions/workflows/python-test.yml/badge.svg)](https://github.com/scikit-fingerprints/scikit-fingerprints/actions/workflows/python-test.yml)

[scikit-fingerprints](https://scikit-fingerprints.github.io/scikit-fingerprints/) is a Python library for efficient
computation of molecular fingerprints.

## Table of Contents

- [Description](#description)
- [Supported platforms](#supported-platforms)
- [Installation](#installation)
- [Quickstart](#quickstart)
- [Project overview](#project-overview)
- [Contributing](#contributing)
- [License](#license)

---

## Description

Molecular fingerprints are crucial in various scientific fields, including drug discovery, materials science, and
chemical analysis. However, existing Python libraries for computing molecular fingerprints often lack performance,
user-friendliness, and support for modern programming standards. This project aims to address these shortcomings by
creating an efficient and accessible Python library for molecular fingerprint computation.

You can find the documentation [HERE](https://scikit-fingerprints.github.io/scikit-fingerprints/)

Main features:
- scikit-learn compatible
- feature-rich, with >30 fingerprints
- parallelization
- sparse matrix support
- commercial-friendly MIT license

## Supported platforms

|                      | `python3.9`            | `python3.10` | `python3.11` | `python3.12` |
|----------------------|------------------------|--------------|--------------|--------------|
| **Ubuntu - latest**  | ✅                      | ✅            | ✅            | ✅            |
| **Windows - latest** | ✅                      | ✅            | ✅            | ✅            |
| **macOS - latest**   | only macOS 13 or newer | ✅            | ✅            | ✅            |

## Installation

You can install the library using pip:

```bash
pip install scikit-fingerprints
```

If you need bleeding-edge features and don't mind potentially unstable or undocumented functionalities,
you can also install directly from GitHub:
```bash
pip install git+https://github.com/scikit-fingerprints/scikit-fingerprints.git
```

## Quickstart

Most fingerprints are based on molecular graphs (2D-based), and you can use SMILES
input directly:
```python
from skfp.fingerprints import AtomPairFingerprint

smiles_list = ["O=S(=O)(O)CCS(=O)(=O)O", "O=C(O)c1ccccc1O"]

atom_pair_fingerprint = AtomPairFingerprint()

X = atom_pair_fingerprint.transform(smiles_list)
print(X)
```

For fingerprints using conformers (3D-based), you need to create molecules first
and compute conformers. Those fingerprints have `requires_conformers` attribute set
to `True`.
```python
from skfp.preprocessing import ConformerGenerator, MolFromSmilesTransformer
from skfp.fingerprints import WHIMFingerprint

smiles_list = ["O=S(=O)(O)CCS(=O)(=O)O", "O=C(O)c1ccccc1O"]

mol_from_smiles = MolFromSmilesTransformer()
conf_gen = ConformerGenerator()
fp = WHIMFingerprint()
print(fp.requires_conformers)  # True

mols_list = mol_from_smiles.transform(smiles_list)
mols_list = conf_gen.transform(mols_list)

X = fp.transform(mols_list)
print(X)
```

You can also use scikit-learn functionalities like pipelines, feature unions
etc. to build complex workflows. Popular datasets, e.g. from MoleculeNet benchmark,
can be loaded directly.
```python
from skfp.datasets.moleculenet import load_clintox
from skfp.metrics import multioutput_auroc_score
from skfp.model_selection.scaffold_split import scaffold_train_test_split
from skfp.fingerprints import ECFPFingerprint, MACCSFingerprint
from skfp.preprocessing import MolFromSmilesTransformer

from sklearn.ensemble import RandomForestClassifier
from sklearn.pipeline import make_pipeline, make_union


smiles, y = load_clintox()
smiles_train, smiles_test, y_train, y_test = scaffold_train_test_split(
    smiles, y, test_size=0.2
)

pipeline = make_pipeline(
    MolFromSmilesTransformer(),
    make_union(ECFPFingerprint(count=True), MACCSFingerprint()),
    RandomForestClassifier(random_state=0),
)
pipeline.fit(smiles_train, y_train)

y_pred_proba = pipeline.predict_proba(smiles_test)
auroc = multioutput_auroc_score(y_test, y_pred_proba)
print(f"AUROC: {auroc:.2%}")
```

## Project overview

`scikit-fingerprint` brings molecular fingerprints and related functionalities into
the scikit-learn ecosystem. With familiar class-based design and `.transform()` method,
fingerprints can be computed from SMILES strings or RDKit `Mol` objects. Resulting NumPy
arrays or SciPy sparse arrays can be directly used in ML pipelines.

Main features:

1. **Scikit-learn compatible:** `scikit-fingerprints` uses familiar scikit-learn
   interface  and conforms to its API requirements. You can include molecular
   fingerprints in pipelines, concatenate them with feature unions, and process with
   ML algorithms.

2. **Performance optimization:** both speed and memory usage are optimized, by
   utilizing parallelism (with Joblib) and sparse CSR matrices (with SciPy). Heavy
   computation is typically relegated to C++ code of RDKit.

3. **Feature-rich:** in addition to computing fingerprints, you can load popular
   benchmark  datasets (e.g. from MoleculeNet), perform splitting (e.g. scaffold
   split), generate conformers, and optimize hyperparameters with optimized cross-validation.

4. **Well-documented:** each public function and class has extensive documentation,
   including relevant implementation details, caveats, and literature references.

5. **Extensibility:** any functionality can be easily modified or extended by
   inheriting from existing classes.

6. **High code quality:** pre-commit hooks scan each commit for code quality (e.g. `black`,
   `flake8`), typing (`mypy`), and security (e.g. `bandit`, `safety`). CI/CD process with
   GitHub Actions also includes over 250 unit and integration tests.

## Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) for details on our code of
conduct, and the process for submitting pull requests to us.

## Citing

If you use scikit-fingerprints in your work, please cite [our paper, available on ArXiv](https://arxiv.org/abs/2407.13291):
```
@misc{scikit-fingeprints,
      title={Scikit-fingerprints: easy and efficient computation of molecular fingerprints in Python}, 
      author={Jakub Adamczyk and Piotr Ludynia},
      year={2024},
      eprint={2407.13291},
      archivePrefix={arXiv},
      primaryClass={cs.SE},
      url={https://arxiv.org/abs/2407.13291}, 
}
```

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/scikit-fingerprints/scikit-fingerprints",
    "name": "scikit-fingerprints",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "molecular fingerprints, molecular descriptors, cheminformatics",
    "author": "Scikit-Fingerprints Development Team",
    "author_email": "scikitfingerprints@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/95/e1/0425c6ebc71519ee8c8d39b24631c42edca4bd04f86a8581146c97e89454/scikit_fingerprints-1.9.0.tar.gz",
    "platform": null,
    "description": "# scikit-fingerprints\n\n[![PyPI version](https://badge.fury.io/py/scikit-fingerprints.svg)](https://badge.fury.io/py/scikit-fingerprints)\n[![](https://img.shields.io/pypi/dm/scikit-fingerprints)](https://pypi.org/project/scikit-fingerprints/)\n[![Downloads](https://static.pepy.tech/badge/scikit-fingerprints)](https://pepy.tech/project/scikit-fingerprints)\n![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/pypi/scikit-fingerprints)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE.md)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/scikit-fingerprints.svg)](https://pypi.org/project/scikit-fingerprints/)\n[![Contributors](https://img.shields.io/github/contributors/scikit-fingerprints/scikit-fingerprints)](https://github.com/scikit-fingerprints/scikit-fingerprints/graphs/contributors)\n[![check](https://github.com/scikit-fingerprints/scikit-fingerprints/actions/workflows/python-test.yml/badge.svg)](https://github.com/scikit-fingerprints/scikit-fingerprints/actions/workflows/python-test.yml)\n\n[scikit-fingerprints](https://scikit-fingerprints.github.io/scikit-fingerprints/) is a Python library for efficient\ncomputation of molecular fingerprints.\n\n## Table of Contents\n\n- [Description](#description)\n- [Supported platforms](#supported-platforms)\n- [Installation](#installation)\n- [Quickstart](#quickstart)\n- [Project overview](#project-overview)\n- [Contributing](#contributing)\n- [License](#license)\n\n---\n\n## Description\n\nMolecular fingerprints are crucial in various scientific fields, including drug discovery, materials science, and\nchemical analysis. However, existing Python libraries for computing molecular fingerprints often lack performance,\nuser-friendliness, and support for modern programming standards. This project aims to address these shortcomings by\ncreating an efficient and accessible Python library for molecular fingerprint computation.\n\nYou can find the documentation [HERE](https://scikit-fingerprints.github.io/scikit-fingerprints/)\n\nMain features:\n- scikit-learn compatible\n- feature-rich, with >30 fingerprints\n- parallelization\n- sparse matrix support\n- commercial-friendly MIT license\n\n## Supported platforms\n\n|                      | `python3.9`            | `python3.10` | `python3.11` | `python3.12` |\n|----------------------|------------------------|--------------|--------------|--------------|\n| **Ubuntu - latest**  | \u2705                      | \u2705            | \u2705            | \u2705            |\n| **Windows - latest** | \u2705                      | \u2705            | \u2705            | \u2705            |\n| **macOS - latest**   | only macOS 13 or newer | \u2705            | \u2705            | \u2705            |\n\n## Installation\n\nYou can install the library using pip:\n\n```bash\npip install scikit-fingerprints\n```\n\nIf you need bleeding-edge features and don't mind potentially unstable or undocumented functionalities,\nyou can also install directly from GitHub:\n```bash\npip install git+https://github.com/scikit-fingerprints/scikit-fingerprints.git\n```\n\n## Quickstart\n\nMost fingerprints are based on molecular graphs (2D-based), and you can use SMILES\ninput directly:\n```python\nfrom skfp.fingerprints import AtomPairFingerprint\n\nsmiles_list = [\"O=S(=O)(O)CCS(=O)(=O)O\", \"O=C(O)c1ccccc1O\"]\n\natom_pair_fingerprint = AtomPairFingerprint()\n\nX = atom_pair_fingerprint.transform(smiles_list)\nprint(X)\n```\n\nFor fingerprints using conformers (3D-based), you need to create molecules first\nand compute conformers. Those fingerprints have `requires_conformers` attribute set\nto `True`.\n```python\nfrom skfp.preprocessing import ConformerGenerator, MolFromSmilesTransformer\nfrom skfp.fingerprints import WHIMFingerprint\n\nsmiles_list = [\"O=S(=O)(O)CCS(=O)(=O)O\", \"O=C(O)c1ccccc1O\"]\n\nmol_from_smiles = MolFromSmilesTransformer()\nconf_gen = ConformerGenerator()\nfp = WHIMFingerprint()\nprint(fp.requires_conformers)  # True\n\nmols_list = mol_from_smiles.transform(smiles_list)\nmols_list = conf_gen.transform(mols_list)\n\nX = fp.transform(mols_list)\nprint(X)\n```\n\nYou can also use scikit-learn functionalities like pipelines, feature unions\netc. to build complex workflows. Popular datasets, e.g. from MoleculeNet benchmark,\ncan be loaded directly.\n```python\nfrom skfp.datasets.moleculenet import load_clintox\nfrom skfp.metrics import multioutput_auroc_score\nfrom skfp.model_selection.scaffold_split import scaffold_train_test_split\nfrom skfp.fingerprints import ECFPFingerprint, MACCSFingerprint\nfrom skfp.preprocessing import MolFromSmilesTransformer\n\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.pipeline import make_pipeline, make_union\n\n\nsmiles, y = load_clintox()\nsmiles_train, smiles_test, y_train, y_test = scaffold_train_test_split(\n    smiles, y, test_size=0.2\n)\n\npipeline = make_pipeline(\n    MolFromSmilesTransformer(),\n    make_union(ECFPFingerprint(count=True), MACCSFingerprint()),\n    RandomForestClassifier(random_state=0),\n)\npipeline.fit(smiles_train, y_train)\n\ny_pred_proba = pipeline.predict_proba(smiles_test)\nauroc = multioutput_auroc_score(y_test, y_pred_proba)\nprint(f\"AUROC: {auroc:.2%}\")\n```\n\n## Project overview\n\n`scikit-fingerprint` brings molecular fingerprints and related functionalities into\nthe scikit-learn ecosystem. With familiar class-based design and `.transform()` method,\nfingerprints can be computed from SMILES strings or RDKit `Mol` objects. Resulting NumPy\narrays or SciPy sparse arrays can be directly used in ML pipelines.\n\nMain features:\n\n1. **Scikit-learn compatible:** `scikit-fingerprints` uses familiar scikit-learn\n   interface  and conforms to its API requirements. You can include molecular\n   fingerprints in pipelines, concatenate them with feature unions, and process with\n   ML algorithms.\n\n2. **Performance optimization:** both speed and memory usage are optimized, by\n   utilizing parallelism (with Joblib) and sparse CSR matrices (with SciPy). Heavy\n   computation is typically relegated to C++ code of RDKit.\n\n3. **Feature-rich:** in addition to computing fingerprints, you can load popular\n   benchmark  datasets (e.g. from MoleculeNet), perform splitting (e.g. scaffold\n   split), generate conformers, and optimize hyperparameters with optimized cross-validation.\n\n4. **Well-documented:** each public function and class has extensive documentation,\n   including relevant implementation details, caveats, and literature references.\n\n5. **Extensibility:** any functionality can be easily modified or extended by\n   inheriting from existing classes.\n\n6. **High code quality:** pre-commit hooks scan each commit for code quality (e.g. `black`,\n   `flake8`), typing (`mypy`), and security (e.g. `bandit`, `safety`). CI/CD process with\n   GitHub Actions also includes over 250 unit and integration tests.\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) for details on our code of\nconduct, and the process for submitting pull requests to us.\n\n## Citing\n\nIf you use scikit-fingerprints in your work, please cite [our paper, available on ArXiv](https://arxiv.org/abs/2407.13291):\n```\n@misc{scikit-fingeprints,\n      title={Scikit-fingerprints: easy and efficient computation of molecular fingerprints in Python}, \n      author={Jakub Adamczyk and Piotr Ludynia},\n      year={2024},\n      eprint={2407.13291},\n      archivePrefix={arXiv},\n      primaryClass={cs.SE},\n      url={https://arxiv.org/abs/2407.13291}, \n}\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Library for effective molecular fingerprints calculation",
    "version": "1.9.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/scikit-fingerprints/scikit-fingerprints/issues",
        "Documentation": "https://scikit-fingerprints.github.io/scikit-fingerprints/",
        "Homepage": "https://github.com/scikit-fingerprints/scikit-fingerprints",
        "Repository": "https://github.com/scikit-fingerprints/scikit-fingerprints"
    },
    "split_keywords": [
        "molecular fingerprints",
        " molecular descriptors",
        " cheminformatics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c1c2df4851c82307e2b8c583361a646bd99868d41d0d1aac25f305d35e4bac44",
                "md5": "71d1626ade473bc30242f3f7f5dd28f3",
                "sha256": "4e7f2ebcf71780b564015ce4618a663f01c2a66a169d02eeef778e2175f23159"
            },
            "downloads": -1,
            "filename": "scikit_fingerprints-1.9.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "71d1626ade473bc30242f3f7f5dd28f3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 228591,
            "upload_time": "2024-10-05T14:03:08",
            "upload_time_iso_8601": "2024-10-05T14:03:08.266771Z",
            "url": "https://files.pythonhosted.org/packages/c1/c2/df4851c82307e2b8c583361a646bd99868d41d0d1aac25f305d35e4bac44/scikit_fingerprints-1.9.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "95e10425c6ebc71519ee8c8d39b24631c42edca4bd04f86a8581146c97e89454",
                "md5": "a808f97812cfb694e51784b7bfe2d621",
                "sha256": "4b4a0cf8a802d722c12dce47feb09fe04883937af3bcc63175643c25a3c8a7e6"
            },
            "downloads": -1,
            "filename": "scikit_fingerprints-1.9.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a808f97812cfb694e51784b7bfe2d621",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 134616,
            "upload_time": "2024-10-05T14:03:10",
            "upload_time_iso_8601": "2024-10-05T14:03:10.218433Z",
            "url": "https://files.pythonhosted.org/packages/95/e1/0425c6ebc71519ee8c8d39b24631c42edca4bd04f86a8581146c97e89454/scikit_fingerprints-1.9.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-05 14:03:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "scikit-fingerprints",
    "github_project": "scikit-fingerprints",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "scikit-fingerprints"
}
        
Elapsed time: 0.40465s