![]() |
OpenMS
|
Generates from a set of Fasta files a 2D-datastructure which stores all theoretical masses of all b and y ions from all peptides generated from the Fasta file. The datastructure is build such that on one axis the fragments are sorted by their own mass and the axis by the mass of their precursor/protein. The FI has two options: Bottom-up and Top Down. In later digestion is skiped and the fragments have a direct reference to the mass of the proteins instead of digested peptides. More...
#include <OpenMS/ANALYSIS/ID/FragmentIndex.h>
Classes | |
struct | Fragment |
One entry in the fragment index. More... | |
struct | Hit |
struct | Peptide |
Compact descriptor of a peptide instance held by the FragmentIndex. More... | |
struct | SpectrumMatch |
Match between a query peak and an entry in the DB. More... | |
struct | SpectrumMatchesTopN |
container for SpectrumMatch. Also keeps count of total number of candidates and total number of matches. More... | |
Public Member Functions | |
FragmentIndex () | |
Default constructor. More... | |
~FragmentIndex () override=default | |
Default destructor. More... | |
bool | isBuild () const |
Indicates whether the fragment index has been built. More... | |
const std::vector< Peptide > & | getPeptides () const |
Returns a reference to the internal peptide container. More... | |
void | build (const std::vector< FASTAFile::FASTAEntry > &fasta_entries) |
Given a set of Fasta files, builds the Fragment Index datastructure (FID). First all fragments are sorted by their own mass. Next they are placed in buckets. The min-fragment mass is stored for each bucket, whereupon the fragments are sorted within the buckets by their originating precursor mass. More... | |
void | clear () |
Delete fragment index. Sets is_build=false. More... | |
std::pair< size_t, size_t > | getPeptidesInPrecursorRange (float precursor_mass, const std::pair< float, float > &window) |
std::vector< Hit > | query (const Peak1D &peak, const std::pair< size_t, size_t > &peptide_idx_range, uint16_t peak_charge) |
Queries one peak. More... | |
void | querySpectrum (const MSSpectrum &spectrum, SpectrumMatchesTopN &sms) |
: queries one complete experimental spectra against the Database. Loops over all precursor charges Starts at min_precursor_charge and iteratively goes to max_precursor_charge. We query all peaks multiple times with all the different precursor charges and corresponding precursor masses More... | |
![]() | |
DefaultParamHandler (const String &name) | |
Constructor with name that is displayed in error messages. More... | |
DefaultParamHandler (const DefaultParamHandler &rhs) | |
Copy constructor. More... | |
virtual | ~DefaultParamHandler () |
Destructor. More... | |
DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
Assignment operator. More... | |
virtual bool | operator== (const DefaultParamHandler &rhs) const |
Equality operator. More... | |
void | setParameters (const Param ¶m) |
Sets the parameters. More... | |
const Param & | getParameters () const |
Non-mutable access to the parameters. More... | |
const Param & | getDefaults () const |
Non-mutable access to the default parameters. More... | |
const String & | getName () const |
Non-mutable access to the name. More... | |
void | setName (const String &name) |
Mutable access to the name. More... | |
const std::vector< String > & | getSubsections () const |
Non-mutable access to the registered subsections. More... | |
Protected Member Functions | |
void | updateMembers_ () override |
This method is used to update extra member variables at the end of the setParameters() method. More... | |
void | generatePeptides (const std::vector< FASTAFile::FASTAEntry > &fasta_entries) |
Generates all peptides from given fasta entries. If Bottom-up is set to false skips digestion. If set to true the Digestion enzyme can be set in the parameters. Additionally introduces fixed and variable modifications for restrictive PSM search. More... | |
![]() | |
void | defaultsToParam_ () |
Updates the parameters after the defaults have been set in the constructor. More... | |
Protected Attributes | |
bool | is_build_ {false} |
true, if the database has been populated with fragments More... | |
std::vector< Peptide > | fi_peptides_ |
vector of all (digested) peptides More... | |
std::vector< Fragment > | fi_fragments_ |
vector of all theoretical fragments (b- and y- ions) More... | |
float | fragment_min_mz_ |
smallest fragment mz More... | |
float | fragment_max_mz_ |
largest fragment mz More... | |
size_t | bucketsize_ |
number of fragments per outer node More... | |
std::vector< float > | bucket_min_mz_ |
vector of the smalles fragment mz of each bucket More... | |
float | precursor_mz_tolerance_ |
bool | precursor_mz_tolerance_unit_ppm_ {true} |
float | fragment_mz_tolerance_ |
bool | fragment_mz_tolerance_unit_ppm_ {true} |
![]() | |
Param | param_ |
Container for current parameters. More... | |
Param | defaults_ |
Container for default parameters. This member should be filled in the constructor of derived classes! More... | |
std::vector< String > | subsections_ |
Container for registered subsections. This member should be filled in the constructor of derived classes! More... | |
String | error_name_ |
Name that is displayed in error messages during the parameter checking. More... | |
bool | check_defaults_ |
If this member is set to false no checking if parameters in done;. More... | |
bool | warn_empty_defaults_ |
If this member is set to false no warning is emitted when defaults are empty;. More... | |
Private Member Functions | |
void | queryPeaks (SpectrumMatchesTopN &candidates, const MSSpectrum &spectrum, const std::pair< size_t, size_t > &candidates_range, const int16_t isotope_error, const uint16_t precursor_charge) |
queries peaks for a given experimental spectrum with a set range of potential peptides, isotope error and precursor charge. Hits are transferred into a PSM list. Technically an adapter between query(...) and openSearch(...)/searchDifferentPrecursorRanges(...) More... | |
void | searchDifferentPrecursorRanges (const MSSpectrum &spectrum, float precursor_mass, SpectrumMatchesTopN &sms, uint16_t charge) |
If closed search loops over all isotope errors. For each iteration loop over all peaks with queryPeaks. More... | |
void | trimHits (SpectrumMatchesTopN &init_hits) const |
places the k-largest elements in the front of the input array. Inside of the k-largest elements and outside the elements are not sorted More... | |
bool | isOpenSearchMode_ () const |
Helper function to determine if open search should be used based on tolerance. More... | |
Private Attributes | |
bool | add_b_ions_ |
bool | add_y_ions_ |
bool | add_a_ions_ |
bool | add_c_ions_ |
bool | add_x_ions_ |
bool | add_z_ions_ |
std::string | digestion_enzyme_ |
size_t | missed_cleavages_ |
number of missed cleavages More... | |
float | peptide_min_mass_ |
float | peptide_max_mass_ |
size_t | peptide_min_length_ |
size_t | peptide_max_length_ |
StringList | modifications_fixed_ |
Modification that are one all peptides. More... | |
StringList | modifications_variable_ |
Variable Modification -> all possible comibnations are created. More... | |
size_t | max_variable_mods_per_peptide_ |
uint16_t | min_matched_peaks_ |
PSM with less hits are discarded. More... | |
int16_t | min_isotope_error_ |
Minimal possible isotope error. More... | |
int16_t | max_isotope_error_ |
Maximal possible isotope error (both only used for closed search) More... | |
uint16_t | min_precursor_charge_ |
minimal possible precursor charge (usually always 1) More... | |
uint16_t | max_precursor_charge_ |
maximal possible precursor charge More... | |
uint16_t | max_fragment_charge_ |
The maximal possible charge of the fragments. More... | |
uint32_t | max_processed_hits_ |
The amount of PSM that will be used. the rest is filtered out. More... | |
float | open_precursor_window_lower_ |
Defines the lower bound of the precursor-mass range. More... | |
float | open_precursor_window_upper_ |
Defines the upper bound of the precursor-mass range. More... | |
Additional Inherited Members | |
![]() | |
static void | writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="") |
Writes all parameters to meta values. More... | |
Generates from a set of Fasta files a 2D-datastructure which stores all theoretical masses of all b and y ions from all peptides generated from the Fasta file. The datastructure is build such that on one axis the fragments are sorted by their own mass and the axis by the mass of their precursor/protein. The FI has two options: Bottom-up and Top Down. In later digestion is skiped and the fragments have a direct reference to the mass of the proteins instead of digested peptides.
struct OpenMS::FragmentIndex::SpectrumMatch |
Match between a query peak and an entry in the DB.
FragmentIndex | ( | ) |
Default constructor.
Initializes an empty FragmentIndex. Call build() before using any query functions. After clear(), the index returns to this unbuilt state.
Thread-safety: constructing the object is thread-safe as long as the instance is not shared across threads before initialization completes.
|
overridedefault |
Default destructor.
Releases owned memory. If the index was built, all internal buffers and fragment buckets are freed. No exceptions are thrown.
void build | ( | const std::vector< FASTAFile::FASTAEntry > & | fasta_entries | ) |
Given a set of Fasta files, builds the Fragment Index datastructure (FID). First all fragments are sorted by their own mass. Next they are placed in buckets. The min-fragment mass is stored for each bucket, whereupon the fragments are sorted within the buckets by their originating precursor mass.
fasta_entries |
void clear | ( | ) |
Delete fragment index. Sets is_build=false.
|
protected |
Generates all peptides from given fasta entries. If Bottom-up is set to false skips digestion. If set to true the Digestion enzyme can be set in the parameters. Additionally introduces fixed and variable modifications for restrictive PSM search.
fasta_entries |
const std::vector<Peptide>& getPeptides | ( | ) | const |
Returns a reference to the internal peptide container.
Provides read-only access to all peptides currently held by the index, typically populated during build().
Preconditions: The vector may be empty if build() has not been called yet. Thread-safety: read-only view; safe to access concurrently as long as no thread mutates the index (e.g., build()/clear()).
std::pair<size_t, size_t> getPeptidesInPrecursorRange | ( | float | precursor_mass, |
const std::pair< float, float > & | window | ||
) |
Return index range of all possible Peptides/Proteins, such that a vector can be created fitting that range (safe some memory)
precursor_mass | The mono-charged precursor mass (M+H) |
window | Defines the lower and upper bound for the precusor mass. For closed search it only contains the tolerance. In case of open search it contains both tolerance and open-search-window |
bool isBuild | ( | ) | const |
Indicates whether the fragment index has been built.
Thread-safety: read-only and can be called concurrently with other read-only methods. Must not race with build()/clear() on the same instance.
|
inlineprivate |
Helper function to determine if open search should be used based on tolerance.
std::vector<Hit> query | ( | const Peak1D & | peak, |
const std::pair< size_t, size_t > & | peptide_idx_range, | ||
uint16_t | peak_charge | ||
) |
Queries one peak.
peak | The queried peak |
peptide_idx_range | The range of precursors/peptides the peptide could potentially belongs to |
peak_charge | The charge of the peak. Is used to calculate the mass from the mz |
|
private |
queries peaks for a given experimental spectrum with a set range of potential peptides, isotope error and precursor charge. Hits are transferred into a PSM list. Technically an adapter between query(...) and openSearch(...)/searchDifferentPrecursorRanges(...)
[out] | candidates | The n best Spectrum matches |
spectrum | The queried experimental spectrum | |
candidates_range | The range of precursors/peptides the peptide could potentially belong to | |
isotope_error | The applied isotope error | |
precursor_charge | The applied precursor charge |
void querySpectrum | ( | const MSSpectrum & | spectrum, |
SpectrumMatchesTopN & | sms | ||
) |
: queries one complete experimental spectra against the Database. Loops over all precursor charges Starts at min_precursor_charge and iteratively goes to max_precursor_charge. We query all peaks multiple times with all the different precursor charges and corresponding precursor masses
spectrum | experimental spectrum | |
[out] | sms | The n best Spectrum matches |
|
private |
If closed search loops over all isotope errors. For each iteration loop over all peaks with queryPeaks.
If open search applies a precursor-mass window
spectrum | experimental query-spectrum | |
precursor_mass | The mass of the precursor (mz * charge) | |
[out] | sms | The Top m SpectrumMatches |
charge | Applied charge |
|
private |
places the k-largest elements in the front of the input array. Inside of the k-largest elements and outside the elements are not sorted
|
overrideprotectedvirtual |
This method is used to update extra member variables at the end of the setParameters() method.
Also call it at the end of the derived classes' copy constructor and assignment operator.
The default implementation is empty.
Reimplemented from DefaultParamHandler.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |
vector of the smalles fragment mz of each bucket
|
protected |
number of fragments per outer node
|
private |
|
protected |
vector of all theoretical fragments (b- and y- ions)
|
protected |
vector of all (digested) peptides
|
protected |
largest fragment mz
|
protected |
smallest fragment mz
|
protected |
|
protected |
|
protected |
true, if the database has been populated with fragments
|
private |
The maximal possible charge of the fragments.
|
private |
Maximal possible isotope error (both only used for closed search)
|
private |
maximal possible precursor charge
|
private |
The amount of PSM that will be used. the rest is filtered out.
|
private |
|
private |
Minimal possible isotope error.
|
private |
PSM with less hits are discarded.
|
private |
minimal possible precursor charge (usually always 1)
|
private |
number of missed cleavages
|
private |
Modification that are one all peptides.
|
private |
Variable Modification -> all possible comibnations are created.
|
private |
Defines the lower bound of the precursor-mass range.
|
private |
Defines the upper bound of the precursor-mass range.
|
private |
|
private |
|
private |
|
private |
|
protected |
|
protected |