![]() |
OpenMS
|
Utility class for analyzing modification patterns in open search results. More...
#include <OpenMS/ANALYSIS/ID/OpenSearchModificationAnalysis.h>
Classes | |
struct | FuzzyDoubleComparator |
Comparator for approximate comparison of double values. More... | |
struct | ModificationPattern |
Stores details of a modification pattern found in the data. More... | |
struct | ModificationSummary |
Data structure for modification summary output. More... | |
Public Types | |
using | DeltaMassHistogram = std::map< double, double, FuzzyDoubleComparator > |
Type definitions for delta mass analysis. More... | |
using | DeltaMassToChargeCount = std::map< double, int, FuzzyDoubleComparator > |
Public Member Functions | |
OpenSearchModificationAnalysis ()=default | |
Default constructor. More... | |
~OpenSearchModificationAnalysis ()=default | |
Destructor. More... | |
std::pair< DeltaMassHistogram, DeltaMassToChargeCount > | analyzeDeltaMassPatterns (const PeptideIdentificationList &peptide_ids, bool use_smoothing=false, bool debug=false) const |
Analyze delta mass patterns from peptide identifications. More... | |
std::vector< ModificationSummary > | mapDeltaMassesToModifications (const DeltaMassHistogram &delta_mass_histogram, const DeltaMassToChargeCount &charge_histogram, PeptideIdentificationList &peptide_ids, double precursor_mass_tolerance=5.0, bool precursor_mass_tolerance_unit_ppm=true, const String &output_file="") const |
Map delta masses to known modifications and annotate peptides. More... | |
std::vector< ModificationSummary > | analyzeModifications (PeptideIdentificationList &peptide_ids, double precursor_mass_tolerance=5.0, bool precursor_mass_tolerance_unit_ppm=true, bool use_smoothing=false, const String &output_file="") const |
Complete analysis workflow: analyze patterns and map to modifications. More... | |
Private Member Functions | |
void | writeModificationSummary_ (const std::vector< ModificationSummary > &modifications, const String &output_file) const |
Write modification summary table to file. More... | |
Static Private Member Functions | |
static double | gaussian_ (double x, double sigma) |
Gaussian function for smoothing. More... | |
static DeltaMassHistogram | smoothDeltaMassHistogram_ (const DeltaMassHistogram &histogram, double sigma=0.001) |
Smooth delta mass histogram using Gaussian kernel density estimation. More... | |
static DeltaMassHistogram | findPeaksInHistogram_ (const DeltaMassHistogram &histogram, double count_threshold=0.0, double snr=2.0) |
Find peaks in delta mass histogram based on count threshold and signal-to-noise ratio. More... | |
Utility class for analyzing modification patterns in open search results.
This class provides functionality to analyze delta mass patterns from open search peptide identifications, identify common modifications, and map them to known modifications from the ModificationsDB. Originally extracted from SageAdapter.
struct OpenMS::OpenSearchModificationAnalysis::ModificationPattern |
Stores details of a modification pattern found in the data.
struct OpenMS::OpenSearchModificationAnalysis::ModificationSummary |
Data structure for modification summary output.
Class Members | ||
---|---|---|
int | count | Modification rate (number of occurrences) |
vector< double > | masses | Masses associated with the modification. |
String | name | Modification name. |
int | num_charge_states | Number of charge states. |
using DeltaMassHistogram = std::map<double, double, FuzzyDoubleComparator> |
Type definitions for delta mass analysis.
using DeltaMassToChargeCount = std::map<double, int, FuzzyDoubleComparator> |
|
default |
Default constructor.
|
default |
Destructor.
std::pair<DeltaMassHistogram, DeltaMassToChargeCount> analyzeDeltaMassPatterns | ( | const PeptideIdentificationList & | peptide_ids, |
bool | use_smoothing = false , |
||
bool | debug = false |
||
) | const |
Analyze delta mass patterns from peptide identifications.
peptide_ids | List of peptide identifications containing delta mass information |
use_smoothing | Whether to apply smoothing to the delta mass histogram |
debug | Enable debug output |
std::vector<ModificationSummary> analyzeModifications | ( | PeptideIdentificationList & | peptide_ids, |
double | precursor_mass_tolerance = 5.0 , |
||
bool | precursor_mass_tolerance_unit_ppm = true , |
||
bool | use_smoothing = false , |
||
const String & | output_file = "" |
||
) | const |
Complete analysis workflow: analyze patterns and map to modifications.
peptide_ids | List of peptide identifications (modified in-place) |
precursor_mass_tolerance | Mass tolerance for mapping |
precursor_mass_tolerance_unit_ppm | Whether tolerance is in ppm (true) or Da (false) |
use_smoothing | Whether to apply smoothing to delta mass histogram |
output_file | Optional file path for writing modification summary table |
|
staticprivate |
Find peaks in delta mass histogram based on count threshold and signal-to-noise ratio.
|
staticprivate |
Gaussian function for smoothing.
std::vector<ModificationSummary> mapDeltaMassesToModifications | ( | const DeltaMassHistogram & | delta_mass_histogram, |
const DeltaMassToChargeCount & | charge_histogram, | ||
PeptideIdentificationList & | peptide_ids, | ||
double | precursor_mass_tolerance = 5.0 , |
||
bool | precursor_mass_tolerance_unit_ppm = true , |
||
const String & | output_file = "" |
||
) | const |
Map delta masses to known modifications and annotate peptides.
delta_mass_histogram | Histogram of delta masses |
charge_histogram | Charge state counts for each delta mass |
peptide_ids | List of peptide identifications to annotate (modified in-place) |
precursor_mass_tolerance | Mass tolerance for mapping |
precursor_mass_tolerance_unit_ppm | Whether tolerance is in ppm (true) or Da (false) |
output_file | Optional file path for writing modification summary table |
|
staticprivate |
Smooth delta mass histogram using Gaussian kernel density estimation.
|
private |
Write modification summary table to file.