![]() |
OpenMS
|
A helper class that is used by several OpenSWATH tools. More...
#include <OpenMS/ANALYSIS/OPENSWATH/OpenSwathHelper.h>
Static Public Member Functions | |
| static String | computePrecursorId (const String &transition_group_id, int isotope) |
| Compute unique precursor identifier. More... | |
| static String | computeTransitionGroupId (const String &precursor_id) |
| Compute transition group id. More... | |
| static void | selectSwathTransitions (const OpenMS::TargetedExperiment &targeted_exp, OpenMS::TargetedExperiment &selected_transitions, double min_upper_edge_dist, double lower, double upper) |
| Select transitions between lower and upper and write them into the new TargetedExperiment. More... | |
| static void | selectSwathTransitions (const OpenSwath::LightTargetedExperiment &targeted_exp, OpenSwath::LightTargetedExperiment &selected_transitions, double min_upper_edge_dist, double lower, double upper) |
| Select transitions between lower and upper and write them into the new TargetedExperiment. More... | |
| static void | selectSwathTransitionsPasef (const OpenSwath::LightTargetedExperiment &transition_exp, std::vector< int > &tr_win_map, double min_upper_edge_dist, const std::vector< OpenSwath::SwathMap > &swath_maps) |
| Match transitions with their "best" window across m/z and ion mobility, save results in a vector. More... | |
| static void | checkSwathMap (const OpenMS::PeakMap &swath_map, double &lower, double &upper, double ¢er) |
| Get the lower / upper offset for this SWATH map and do some sanity checks. More... | |
| template<class TargetedExperimentT > | |
| static bool | checkSwathMapAndSelectTransitions (const OpenMS::PeakMap &exp, const TargetedExperimentT &targeted_exp, TargetedExperimentT &selected_transitions, double min_upper_edge_dist) |
| Check the map and select transition in one function. More... | |
| static std::pair< double, double > | estimateRTRange (const OpenSwath::LightTargetedExperiment &exp) |
| Computes the min and max retention time value. More... | |
| static OpenSwath::LightTargetedExperiment | sampleExperiment (const OpenSwath::LightTargetedExperiment &exp, Size bins, Size peptides_per_bin, unsigned int seed=0, bool sort_by_intensity=false, double top_fraction=1.0, const std::unordered_set< std::string > &priority_peptides=std::unordered_set< std::string >()) |
| Sample a subset of peptides uniformly across the RT range. More... | |
| static std::map< std::string, double > | simpleFindBestFeature (const OpenMS::MRMFeatureFinderScoring::TransitionGroupMapType &transition_group_map, bool useQualCutoff=false, double qualCutoff=0.0) |
| Returns the feature with the highest score for each transition group. More... | |
A helper class that is used by several OpenSWATH tools.
|
static |
Get the lower / upper offset for this SWATH map and do some sanity checks.
Sanity check for the whole map:
| [in] | swath_map | Input SWATH map to check |
| [out] | lower | Lower edge of SWATH window (in Th) |
| [out] | upper | Upper edge of SWATH window (in Th) |
| [out] | center | Center of SWATH window (in Th) |
| IllegalArgument | exception if the sanity checks fail. |
Referenced by OpenSwathHelper::checkSwathMapAndSelectTransitions().
|
inlinestatic |
Check the map and select transition in one function.
Computes lower and upper offset for the SWATH map and performs some sanity checks (see checkSwathMap()). Then selects transitions.
| [in] | exp | Input SWATH map to check |
| [in] | targeted_exp | Transition list for selection |
| [out] | selected_transitions | Selected transitions for SWATH window |
| [in] | min_upper_edge_dist | Distance in Th to the upper edge |
References OpenSwathHelper::checkSwathMap(), MSExperiment::empty(), DocumentIdentifier::getLoadedFilePath(), and OpenSwathHelper::selectSwathTransitions().
Compute unique precursor identifier.
Uses transition_group_id and isotope number to compute a unique precursor id of the form "groupID_Precursor_ix" where x is the isotope number, e.g. the monoisotopic precursor would become "groupID_Precursor_i0".
| [in] | transition_group_id | Unique id of the transition group (peptide/compound) |
| [in] | isotope | Precursor isotope number |
Compute transition group id.
Uses the unique precursor identifier to compute the transition group id (peptide/compound identifier), reversing the operation performed by computePrecursorId().
| [in] | precursor_id | Precursor identifier as computed by computePrecursorId() |
References OpenMS::Constants::k, String::prefix(), and String::split().
Referenced by ChromatogramExtractor::return_chromatogram().
|
static |
Computes the min and max retention time value.
Estimate the retention time span of a targeted experiment by returning the min/max values in retention time as a pair.
|
static |
Sample a subset of peptides uniformly across the RT range.
Splits the RT span (min→max) into bins and randomly picks up to peptides_per_bin compounds from each bin. Useful for on-the-fly iRT calibration without external .irt files.
| [in] | exp | Full LightTargetedExperiment (the input peptide query parameter assay list for targeted extraction) |
| [in] | bins | Number of retention‐time bins (i.e. 10 bins across the RT range for linear iRT, 500-1000 bins across the RT for nonlinear iRT) |
| [in] | peptides_per_bin | How many peptides to draw per bin (i.e. 5 peptides for linear iRT, 25 - 50 for non-linear iRT) |
| [in] | seed | If non‐zero, used to seed the RNG (deterministic). If zero, will use std::random_device for non-deterministic. |
| [in] | sort_by_intensity | Whether to sort the assays by the highest cumulative intense transitions. This is useful for sampling the most intense peptides for iRTs. |
| [in] | top_fraction | Only sample from the top N fraction of sorted assays to narrow down on only really intense peptides. This is useful for selecting a few "high quality" peptides to use for linear iRTs. |
| [in] | priority_peptides | Optional set of peptide sequences to prioritize during sampling. If provided, these peptides will be sampled first if found in exp, before the remaining quota is filled with regular sampling. Useful for ensuring common iRT peptides (e.g., from irtkit or cirtkit) are included when present. |
|
static |
Select transitions between lower and upper and write them into the new TargetedExperiment.
Version for the OpenMS TargetedExperiment
| [in] | targeted_exp | Transition list for selection |
| [out] | selected_transitions | Selected transitions for SWATH window |
| [in] | min_upper_edge_dist | Distance in Th to the upper edge |
| [in] | lower | Lower edge of SWATH window (in Th) |
| [in] | upper | Upper edge of SWATH window (in Th) |
Referenced by OpenSwathHelper::checkSwathMapAndSelectTransitions().
|
static |
Select transitions between lower and upper and write them into the new TargetedExperiment.
Version for the LightTargetedExperiment
| [in] | targeted_exp | Transition list for selection |
| [out] | selected_transitions | Selected transitions for SWATH window |
| [in] | min_upper_edge_dist | Distance in Th to the upper edge |
| [in] | lower | Lower edge of SWATH window (in Th) |
| [in] | upper | Upper edge of SWATH window (in Th) |
|
static |
Match transitions with their "best" window across m/z and ion mobility, save results in a vector.
| [in] | transition_exp | Transition list for selection |
| [out] | tr_win_map | Mapping from transition (index) to the best matching entry in swath_maps |
| [in] | min_upper_edge_dist | Distance in Th to the upper edge |
| [in] | swath_maps | vector of SwathMap objects defining mz and im bounds |
|
static |
Returns the feature with the highest score for each transition group.
Simple method to extract the best feature for each transition group (e.g. for RT alignment). A quality cutoff can be used to skip some low-quality features altogether.
| [in] | transition_group_map | Input data containing the picked and scored map |
| useQualCutoff | Whether to apply a quality cutoff to the data | |
| qualCutoff | What quality cutoff should be applied (all data above the cutoff will be kept) |