Skip to content

Commit

Permalink
feat: support for semi-enzymatic digests (#92)
Browse files Browse the repository at this point in the history
- propagate semi_enzymatic through to output
- add "database.enzyme.semi_enzymatic" parameter, property-based tests for missed cleavages
  • Loading branch information
FriedLabJHU authored and lazear committed Nov 3, 2023
1 parent e35357d commit 7abbb08
Show file tree
Hide file tree
Showing 6 changed files with 322 additions and 52 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Support for semi-enzymatic digests (`database.enzyme.semi_enzymatic` parameter)

## [v0.14.4]
### Added
- **Unstable feature**: Preliminary support for reading Bruker .d folders (ddaPASEF; no MS1/LFQ support yet)
Expand Down
3 changes: 2 additions & 1 deletion DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ For additional information about configuration options and output file formats,
"max_len": 50, // Optional[int] {default=50}, Maximum AA length of peptides to search
"cleave_at": "KR", // Optional[str] {default='KR'}. Amino acids to cleave at
"restrict": "P", // Optional[char/single AA] {default='P'}. Do not cleave if this AA follows the cleavage site
"c_terminal": true // Optional[bool] {default=true}. Cleave at c terminus of matching amino acid
"c_terminal": false, // Optional[bool] {default=true}. Cleave at c terminus of matching amino acid
"semi_enzymatic": false // Optional[bool] {default=false}. Generate semi-enzymatic peptides
},
"fragment_min_mz": 200.0, // Optional[float] {default=150.0}, Minimum mass of fragments to search
"fragment_max_mz": 2000.0, // Optional[float] {default=2000.0}, Maximum mass of fragments to search
Expand Down
18 changes: 18 additions & 0 deletions crates/sage-cli/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ impl Runner {
.format(feature.missed_cleavages)
.as_bytes(),
);
record.push_field(
itoa::Buffer::new()
.format(peptide.semi_enzymatic as u8)
.as_bytes(),
);
record.push_field(ryu::Buffer::new().format(feature.isotope_error).as_bytes());
record.push_field(ryu::Buffer::new().format(feature.delta_mass).as_bytes());
record.push_field(ryu::Buffer::new().format(feature.average_ppm).as_bytes());
Expand Down Expand Up @@ -104,6 +109,7 @@ impl Runner {
"charge",
"peptide_len",
"missed_cleavages",
"semi_enzymatic",
"isotope_error",
"precursor_ppm",
"fragment_ppm",
Expand Down Expand Up @@ -208,6 +214,11 @@ impl Runner {
.format(feature.missed_cleavages)
.as_bytes(),
);
record.push_field(
itoa::Buffer::new()
.format(peptide.semi_enzymatic as u8)
.as_bytes(),
);
record.push_field(ryu::Buffer::new().format(feature.isotope_error).as_bytes());
record.push_field(
ryu::Buffer::new()
Expand Down Expand Up @@ -256,6 +267,11 @@ impl Runner {
.format((-feature.poisson).ln_1p())
.as_bytes(),
);
record.push_field(
ryu::Buffer::new()
.format(feature.posterior_error)
.as_bytes(),
);
record.push_field(peptide.to_string().as_bytes());
record.push_field(
peptide
Expand Down Expand Up @@ -289,6 +305,7 @@ impl Runner {
"z=other",
"peptide_len",
"missed_cleavages",
"semi_enzymatic",
"isotope_error",
"ln(precursor_ppm)",
"fragment_ppm",
Expand All @@ -305,6 +322,7 @@ impl Runner {
"ln(matched_intensity_pct)",
"scored_candidates",
"ln(-poisson)",
"posterior_error",
"Peptide",
"Proteins",
]);
Expand Down
3 changes: 3 additions & 0 deletions crates/sage/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub struct EnzymeBuilder {
pub cleave_at: Option<String>,
pub restrict: Option<char>,
pub c_terminal: Option<bool>,
pub semi_enzymatic: Option<bool>,
}

impl Default for EnzymeBuilder {
Expand All @@ -34,6 +35,7 @@ impl Default for EnzymeBuilder {
cleave_at: Some("KR".into()),
restrict: Some('P'),
c_terminal: Some(true),
semi_enzymatic: Some(false),
}
}
}
Expand All @@ -48,6 +50,7 @@ impl From<EnzymeBuilder> for EnzymeParameters {
&en.cleave_at.unwrap_or_else(|| "KR".into()),
en.restrict,
en.c_terminal.unwrap_or(true),
en.semi_enzymatic.unwrap_or(false),
),
}
}
Expand Down
Loading

0 comments on commit 7abbb08

Please sign in to comment.