A Python wrapper to use CFM-ID : https://cfmid.wishartlab.com
Project description
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)
Environement variable
You can also use environement 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 environement variable
and param_output.log
and param_config.txt
files must be located at the working directory.
You can also use environement variable CFMID_IMAGE
rather than path argument.
export CFMID_IMAGE=myrepo/image_name:tag
from cfm_id import CfmIdDocker
cfm_id = CfmIdDocker()
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
Built Distribution
File details
Details for the file cfm_id-0.1.2.tar.gz
.
File metadata
- Download URL: cfm_id-0.1.2.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.8.5 Linux/5.4.0-89-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 429c196982ab22534fb5ca7b4aca24b63325c86da9ce7a5105c228d4d7615540 |
|
MD5 | 825bfc60d804e44ed91eddb5bf6baf2a |
|
BLAKE2b-256 | 85f81e3cc8a67e4c1a984f7a27985a0869f0e8edb610c319f243bfdbedbdfc6c |
File details
Details for the file cfm_id-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: cfm_id-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.8.5 Linux/5.4.0-89-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b67dce29fd7c4d8336c1e1f7454daa9b8e96bfae00cb8214b82ae40ffc58fb36 |
|
MD5 | 24234e9a0b8d2ada7b514eb8e662cb02 |
|
BLAKE2b-256 | 1ea339446db13a8d9d8d14efe4a776cf829cb68d2ab3fd8ac68a199d0f103ed7 |