Skip to main content

CFM-ID Python Package

This package is a Python wrapper to use CFM-ID : https://cfmid.wishartlab.com

CFM-ID provides a method for accurately and efficiently identifying metabolites in spectra generated by electrospray tandem mass spectrometry (ESI-MS/MS). The program uses Competitive Fragmentation Modeling to produce a probabilistic generative model for the MS/MS fragmentation process and machine learning techniques to adapt the model parameters from data.

This package is under devopment and work only for cfm-predict of the CFM-ID version 2.0.

Install

pip install cfm-id

Usage

from cfm_id import CfmId

cfm_id = CfmId("/path/to/cfm_id/folder")
cfm_id.predict("O=C1OC(CO)C(O)=C1O")

The default output format is a list of MatchMS Spectrum, including a "merged" spectrum of the 3 energies.

You can specify the CFM-ID raw text format export with the raw_format param :

cfm_id.predict("O=C1OC(CO)C(O)=C1O", raw_format=True)

Environment variable

You can also use environment variable CFMID_PATH rather than path argument.

export CFMID_PATH=path/to/cfm_id/folder
from cfm_id import CfmId

cfm_id = CfmId()

Param and config files

By default CfmId will use param_output.log and param_config.txt files located at the root of the cfm_id folder as respectively param and config files.

You can specify anoter files location at instantiation with local path as ist of string :

from cfm_id import CfmId

cfm_id = CfmId(
    "/path/to/cfm_id/folder",
    param=["param", "param_output0_neg.log"], conf=["conf", "param_config_neg.txt"]
)

In this example, the cfm_id instance will use /path/to/cfm_id/folder/param/param_output0_neg.log as param file.

Use Docker image

You can use a Docker image for CFM-ID rather than local files by using CfmIdDocker class.

from cfm_id import CfmIdDocker

cfm_id = CfmIdDocker("myrepo/image_name:tag")

In the Docker image, cfm-predict has to be in the PATH environment variable and param_output.log and param_config.txt files must be located at the working directory.

You can also use environment variable CFMID_IMAGE rather than path argument.

export CFMID_IMAGE=myrepo/image_name:tag
from cfm_id import CfmIdDocker

cfm_id = CfmIdDocker()

Metadata

Release files for cfm-id 0.1.7

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

Source distribution (sdist)

Source distribution for cfm-id 0.1.7
File Size Uploaded Provenance
cfm_id-0.1.7.tar.gz 5.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cfm-id 0.1.7
File Interpreter ABI Platform
cfm_id-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 kB

Release files / cfm_id-0.1.7.tar.gz

Download URL cfm_id-0.1.7.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e4add940e81cd582b87c5298fecf04548d07dd8621b236c659c902368ddf160f
BLAKE2b-256 checksum
How to use checksums
f9f565c4aed7d8c2e71ebb032633a243823eff06673a67e47d7ebf26d4129bbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.8.12 Linux/5.4.0-99-generic

Release files / cfm_id-0.1.7-py3-none-any.whl

Download URL cfm_id-0.1.7-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cdce48c493e117a43378b6fe37948d7caac5eaeda7397f125ef517d6939ef120
BLAKE2b-256 checksum
How to use checksums
06162af69588d7a0aba6d2ea796758de886fb7931579090574112ebf4ab76afa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.8.12 Linux/5.4.0-99-generic

Security for cfm-id 0.1.7

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.

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