CPred: Charge State Prediction for Modified and Unmodified Peptides in Electrospray Ionization
CPred is a neural network capable of predicting the charge state distribution for modified and unmodified peptides in electrospray ionisation. By summarising the modifications as measures of mass and atomic compositions, the model is capable of generalising unseen modifications during training.
The model is available as a Python package, installable through Pypi and conda. This also makes it possible to use from the command-line-interface.
Install with conda, using the bioconda and conda-forge channels:
conda install -c bioconda -c conda-forge CPred
Or install with pip:
pip install CPred
A reproducible example is shown in the tests folder.
from CPred import FeatureEngineering
from CPred import CPred_NN
import pandas as pd
test_dictionary = {
"Peptide_sequence": ["PEPTIDE", "EDITPEP"],
"Modifications": ["1|Carbamidomethyl", "2|Oxidation"]
}
# Turn dictionary into a Pandas dataframe for feature engineering
test_df = pd.DataFrame(test_dictionary)
# Do feature engineering
test_features = FeatureEngineering.feature_engineering(test_df)
# Saving to parquet
test_features.to_parquet(f"tests/tests_input/test.parquet", index=False)
# Neural network predictions
input_model = "tests/tests_input/test.parquet"
model_directory = "CPred/Data/Models/CPred_model_v1.keras"
output_directory = "tests/tests_output/"
CPred_NN.prediction_model(input_model, model_directory, output_directory)
The feature_engineering function returns a pandas dataframe with the generated features. As the CPred neural network requires the data in Parquet format, it is firstly saved.
In order to use CPred from the command-line interface, run:
python CPred_main.py FeatureEngineering --help
python CPred_main.py prediction --help
python CPred_main.py retraining --help
In order to run CPred, all arguments may be specificied as documented.
python CPred_main.py FeatureEngineering -i ..\tests\tests_input\test.xlsx
Enter citation here