-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into use-metadata-params-for-submission
- Loading branch information
Showing
10 changed files
with
940 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
"""Alphapept uses the yaml format to save configuration.""" | ||
import pathlib | ||
|
||
import pandas as pd | ||
import yaml | ||
|
||
from proteobench.io.params import ProteoBenchParameters | ||
|
||
|
||
def extract_params(fname) -> ProteoBenchParameters: | ||
with open(fname) as f: | ||
record = yaml.safe_load(f) | ||
summary = record["summary"] | ||
params = ProteoBenchParameters() | ||
params.software_name = "AlphaPept" | ||
params.software_version = summary["version"] | ||
params.search_engine = params.software_name | ||
params.search_engine_version = params.software_version | ||
fasta = record["fasta"] | ||
params.enzyme = fasta["protease"] | ||
params.allowed_miscleavages = fasta["n_missed_cleavages"] | ||
params.fixed_mods = ",".join(fasta["mods_fixed"]) | ||
params.variable_mods = ",".join(fasta["mods_variable"]) | ||
params.max_mods = fasta["n_modifications_max"] | ||
params.min_peptide_length = fasta["pep_length_min"] | ||
params.max_peptide_length = fasta["pep_length_max"] | ||
search = record["search"] | ||
params.precursor_mass_tolerance = search["prec_tol"] | ||
params.fragment_mass_tolerance = search["frag_tol"] | ||
params.ident_fdr_protein = search["protein_fdr"] | ||
params.ident_fdr_peptide = search["peptide_fdr"] | ||
# params.ident_fdr_psm = search | ||
params.min_precursor_charge = record["features"]["iso_charge_min"] | ||
params.max_precursor_charge = record["features"]["iso_charge_max"] | ||
params.enable_match_between_runs = record["workflow"]["match"] # ! check | ||
|
||
return params | ||
|
||
|
||
if __name__ == "__main__": | ||
for fname in [ | ||
"../../../test/params/alphapept_0.4.9.yaml", | ||
"../../../test/params/alphapept_0.4.9_unnormalized.yaml", | ||
]: | ||
file = pathlib.Path(fname) | ||
params = extract_params(file) | ||
data_dict = params.__dict__ | ||
series = pd.Series(data_dict) | ||
series.to_csv(file.with_suffix(".csv")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
,0 | ||
software_name,Proline | ||
software_version,X! Tandem Vengeance (2015.12.15.2) | ||
search_engine,XTandem | ||
search_engine_version, | ||
ident_fdr_psm,1 | ||
ident_fdr_peptide, | ||
ident_fdr_protein, | ||
enable_match_between_runs,False | ||
precursor_mass_tolerance,10.0 ppm | ||
fragment_mass_tolerance,0.02 Da | ||
enzyme,Trypsin | ||
allowed_miscleavages,2 | ||
min_peptide_length,7 | ||
max_peptide_length, | ||
fixed_mods,Carbamidomethyl (C) | ||
variable_mods,Acetyl (Protein N-term); Gln->pyro-Glu (Any N-term Q); Ammonia-loss (Any N-term C); Glu->pyro-Glu (Any N-term E); Oxidation (M) | ||
max_mods, | ||
min_precursor_charge, | ||
max_precursor_charge, |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
,0 | ||
software_name,AlphaPept | ||
software_version,0.4.9 | ||
search_engine,AlphaPept | ||
search_engine_version,0.4.9 | ||
ident_fdr_psm, | ||
ident_fdr_peptide,0.01 | ||
ident_fdr_protein,0.01 | ||
enable_match_between_runs,False | ||
precursor_mass_tolerance,20 | ||
fragment_mass_tolerance,50 | ||
enzyme,trypsin | ||
allowed_miscleavages,2 | ||
min_peptide_length,7 | ||
max_peptide_length,27 | ||
fixed_mods,cC | ||
variable_mods,oxM | ||
max_mods,3 | ||
min_precursor_charge,1 | ||
max_precursor_charge,6 |
Oops, something went wrong.