Skip to main content

Chemical descriptors is a powerful Python package facilitating calculation of fingerprints for CSV files

Project description

Python Library: Chemical_Descriptors

This function generates one of several fingerprint types from the list of molecular fingerprints available, each serving specific tasks in cheminformatics and computational chemistry.

Importance of Fingerprint Types:

  • Distinct Representation: Different fingerprint types capture various aspects of a molecule’s structure, allowing for versatile molecular comparisons.

  • Diverse Applications: Depending on the task (such as similarity searching, classification, or clustering), choosing the right fingerprint type ensures better performance in chemical analysis and predictive modeling.

  • Accuracy in Modeling: The right fingerprint type can significantly improve the accuracy of machine learning models and predictions based on molecular features.

Number of Fingerprints:

Functions

cal_rdkit_descriptor(input_file, output_file, smiles_column)

Description:
This function calculates RDKit molecular descriptors for molecules specified in a CSV file (input_file) using SMILES strings from a specified column (smiles_column). The calculated descriptors are appended as additional columns to the original data and saved in a new CSV file named <input_file_name>_rdkit_descriptor.csv.

Parameters:

  • input_file (str): Path to the input CSV file containing molecular data in SMILES format.
  • output_file (str): Path where the output CSV file will be saved (optional if using the default naming convention).
  • smiles_column (str): The name of the column in the input CSV file that contains the SMILES strings.

Output:
The output will be saved as a CSV file named <input_file_name>_rdkit_descriptor.csv.


cal_lipinski_descriptors(file_path, smiles_column, verbose=False)

Description:
This function calculates Lipinski descriptors for molecules specified in a CSV file (file_path) using SMILES strings from a specified column (smiles_column). It automatically saves the calculated descriptors to an output file named <input_file_name>_lipinski_descriptors.csv.

Parameters:

  • file_path (str): Path to the input CSV file containing molecular data in SMILES format.
  • smiles_column (str): The name of the column in the input CSV file that contains the SMILES strings.
  • verbose (bool, optional): If True, the function will print additional processing details. Default is False.

Output:
The output will be saved as a CSV file named <input_file_name>_lipinski_descriptors.csv.


cal_morgan_fpts(input_file, smiles_column)

Description:
Calculates Morgan fingerprints for molecules specified in a CSV file (input_file) using SMILES strings from a specified column (smiles_column). The function saves the calculated fingerprints to an output file named <input_file_name>_calculate_morgan_fpts.csv.

Parameters:

  • input_file (str): Path to the input CSV file containing molecular data in SMILES format.
  • smiles_column (str): The name of the column in the input CSV file that contains the SMILES strings.

Output:
The output will be saved as a CSV file named <input_file_name>_calculate_morgan_fpts.csv.


cal_mordred_descriptors(input_file, smiles_column)

Description:
Computes Mordred descriptors for molecules specified in a CSV file (input_file) using SMILES strings from a specified column (smiles_column). The function saves the computed descriptors to an output file named <input_file_name>_mordred_descriptors.csv.

Parameters:

  • input_file (str): Path to the input CSV file containing molecular data in SMILES format.
  • smiles_column (str): The name of the column in the input CSV file that contains the SMILES strings.

Output:
The output will be saved as a CSV file named <input_file_name>_mordred_descriptors.csv.


calculate_selected_fingerprints(input_file, smiles_column)

Description:
Before using this function, execute the following code snippet to download and unzip the necessary files:

! wget https://github.com/dataprofessor/padel/raw/main/fingerprints_xml.zip
! unzip fingerprints_xml.zip
## Molecular Fingerprint Calculation

This function calculates 12 different types of molecular fingerprints:

- `AtomPairs2DCount`
- `AtomPairs2D`
- `EState`
- `CDKextended`
- `CDK`
- `CDKgraphonly`
- `KlekotaRothCount`
- `KlekotaRoth`
- `MACCS`
- `PubChem`
- `SubstructureCount`
- `Substructure`

Each enhanced dataset with fingerprints is saved as separate CSV files, appended with the respective fingerprint type name.

### Parameters:
- `input_file` (str): Path to the input CSV file containing molecular data in SMILES format.
- `smiles_column` (str): The name of the column in the input CSV file that contains the SMILES strings.

### Output:
Each fingerprint type will be saved as a separate CSV file with the respective fingerprint type name appended.  
For example: `<input_file_name>_AtomPairs2DCount.csv`.

---

## **fps**(filename, smiles_column, fp_type)

**Description:**  
This function calculates a specified molecular fingerprint (`fp_type`) for each molecule in a CSV file. The user must provide:
- The CSV file (`filename`)
- The SMILES column name in the file (`smiles_column`)
- One of the following fingerprint types:

  - `maccs`
  - `avalon`
  - `pattern`
  - `layered`
  - `map4`
  - `secfp`
  - `erg`
  - `estate`
  - `avalon-count`
  - `ecfp`
  - `fcfp`
  - `topological`
  - `atompair`
  - `rdkit`
  - `ecfp-count`
  - `fcfp-count`
  - `topological-count`
  - `atompair-count`
  - `rdkit-count`

### Parameters:
- `filename` (str): Path to the input CSV file containing molecular data in SMILES format.
- `smiles_column` (str): The name of the column in the input CSV file that contains the SMILES strings.
- `fp_type` (str): The type of molecular fingerprint to calculate (choose from the list of fingerprint types above).

### Output:
The output will be saved as a CSV file named `<input_file_name>_<fp_type>.csv` depending on the fingerprint type chosen.


Ahmed Alhilal
=============

0.0.1 (05/01/2025)
-------------------
- First Release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chemical_descriptors-0.0.1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Chemical_Descriptors-0.0.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file chemical_descriptors-0.0.1.tar.gz.

File metadata

  • Download URL: chemical_descriptors-0.0.1.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.0

File hashes

Hashes for chemical_descriptors-0.0.1.tar.gz
Algorithm Hash digest
SHA256 74724b9afb9f33566e28f76a38b9bb38be83704446dc73ee823a06e2998507b0
MD5 b71a456dc454354d1ea11bc611709dc8
BLAKE2b-256 87f20589fe48d330a62a621344dd074c6c94743937944da92c4c125a3b2b550d

See more details on using hashes here.

File details

Details for the file Chemical_Descriptors-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for Chemical_Descriptors-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ee6c8e06212dc31bd8a173df43dd5c64c155c4bd879010055c90b972a931535
MD5 78661b9afa0f0cd70692103b9dd7c51a
BLAKE2b-256 d440f1c1208f40e3ae37d7b5f281a30e58da8f6877c6798d457d6e9ec2451205

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page