53 Peptide(
UInt32 protein_idx, uint32_t mod_bitmask, std::pair<uint16_t , uint16_t> sequence,
float precursor_mz):
54 protein_idx(protein_idx),
55 mod_bitmask_(mod_bitmask),
57 precursor_mz_(precursor_mz)
71 uint32_t num_matched_{};
72 uint16_t precursor_charge_{};
73 int16_t isotope_error_{};
74 size_t peptide_idx_{};
83 std::vector<SpectrumMatch>
hits_;
97 this->hits_.insert(this->hits_.end(), other.
hits_.begin(), other.
hits_.end());
151#ifdef DEBUG_FRAGMENT_INDEX
184 void build(
const std::vector<FASTAFile::FASTAEntry> & fasta_entries);
197 const std::pair<float, float>& window);
205 peptide_idx(peptide_idx),
206 fragment_mz(fragment_mz)
219 const std::pair<size_t,size_t>& peptide_idx_range,
220 uint16_t peak_charge);
243 const std::vector<FASTAFile::FASTAEntry>& fasta_entries)
const;
254 peptide_idx_(peptide_idx),
255 fragment_mz_(fragment_mz)
258 float fragment_mz_{};
261 bool is_build_{
false};
292 static constexpr uint16_t NTERM_SLOT = UINT16_MAX - 1;
293 static constexpr uint16_t CTERM_SLOT = UINT16_MAX;
296 static constexpr size_t MAX_MOD_SLOTS = 32;
312 bool is_protein_nterm =
false,
bool is_protein_cterm =
false)
const;
315 std::array<double, 128> fixed_mod_deltas_{};
317 std::array<const ResidueModification*, 128> fixed_mod_ptrs_{};
318 double fixed_nterm_delta_{0.0};
319 double fixed_cterm_delta_{0.0};
324 std::array<std::vector<VarModEntry>, 128> variable_mod_table_{};
330 bool mod_tables_initialized_{
false};
341 double b_offset{0.0};
342 double y_offset{0.0};
343 double a_offset{0.0};
344 double c_offset{0.0};
345 double x_offset{0.0};
346 double z_offset{0.0};
360 std::vector<Fragment>& fragments,
361 const char* sequence,
364 double n_term_mod_mass,
365 double c_term_mod_mass,
366 const double* residue_mod_masses)
const;
373 size_t min_ion_index_{0};
377 bool precursor_mz_tolerance_unit_ppm_{
true};
379 bool fragment_mz_tolerance_unit_ppm_{
true};
394 const std::pair<size_t, size_t>& candidates_range,
395 const int16_t isotope_error,
396 const uint16_t precursor_charge);
406 float precursor_mass,
449 return precursor_mz_tolerance_unit_ppm_
450 ? (precursor_mz_tolerance_ > 1000.0)
451 : (precursor_mz_tolerance_ > 1.0);
Representation of a peptide/protein sequence.
Definition AASequence.h:88
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
Generates from a set of Fasta files a 2D-datastructure which stores all theoretical masses of all b a...
Definition FragmentIndex.h:33
size_t bucketsize_
number of fragments per outer node
Definition FragmentIndex.h:374
uint16_t min_matched_peaks_
PSM with less hits are discarded.
Definition FragmentIndex.h:438
bool add_x_ions_
Definition FragmentIndex.h:420
const ResidueModification * mod_ptr
pointer to the modification (for AASequence reconstruction)
Definition FragmentIndex.h:277
bool add_a_ions_
Definition FragmentIndex.h:418
void querySpectrum(const MSSpectrum &spectrum, SpectrumMatchesTopN &sms)
: queries one complete experimental spectra against the Database. Loops over all precursor charges St...
bool add_b_ions_
Definition FragmentIndex.h:416
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,...
static IonOffsets ion_offsets_
Definition FragmentIndex.h:348
size_t buildModSlots_(const char *sequence, size_t seq_len, ModSlot *out_slots, bool is_protein_nterm=false, bool is_protein_cterm=false) const
ResidueModification::TermSpecificity term_spec
where this mod can be applied
Definition FragmentIndex.h:278
static std::once_flag mass_table_once_flag_
Definition FragmentIndex.h:335
StringList modifications_fixed_
Modification that are one all peptides.
Definition FragmentIndex.h:432
float fragment_mz_tolerance_
Definition FragmentIndex.h:378
bool add_y_ions_
Definition FragmentIndex.h:417
std::vector< Peptide > fi_peptides_
vector of all (digested) peptides
Definition FragmentIndex.h:368
std::vector< VarModEntry > variable_cterm_mods_
Pure C-terminal variable mods (not residue-specific)
Definition FragmentIndex.h:328
size_t missed_cleavages_
number of missed cleavages
Definition FragmentIndex.h:426
float fragment_min_mz_
smallest fragment mz
Definition FragmentIndex.h:371
uint16_t min_precursor_charge_
minimal possible precursor charge (usually always 1)
Definition FragmentIndex.h:441
uint32_t max_processed_hits_
The amount of PSM that will be used. the rest is filtered out.
Definition FragmentIndex.h:444
float peptide_max_mass_
Definition FragmentIndex.h:428
uint16_t max_fragment_charge_
The maximal possible charge of the fragments.
Definition FragmentIndex.h:443
std::vector< Hit > query(const Peak1D &peak, const std::pair< size_t, size_t > &peptide_idx_range, uint16_t peak_charge)
Queries one peak.
void generateFragmentsLightweight_(std::vector< Fragment > &fragments, const char *sequence, size_t seq_len, UInt32 peptide_idx, double n_term_mod_mass, double c_term_mod_mass, const double *residue_mod_masses) const
std::vector< Fragment > fi_fragments_
vector of all theoretical fragments (b- and y- ions)
Definition FragmentIndex.h:369
int16_t max_isotope_error_
Maximal possible isotope error (both only used for closed search)
Definition FragmentIndex.h:440
float open_precursor_window_lower_
Defines the lower bound of the precursor-mass range.
Definition FragmentIndex.h:454
float fragment_max_mz_
largest fragment mz
Definition FragmentIndex.h:372
std::string digestion_enzyme_
Definition FragmentIndex.h:424
bool isBuild() const
Indicates whether the fragment index has been built.
size_t peptide_max_length_
Definition FragmentIndex.h:430
~FragmentIndex() override=default
Default destructor.
bool isOpenSearchMode_() const
Helper function to determine if open search should be used based on tolerance.
Definition FragmentIndex.h:447
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....
std::vector< float > bucket_min_mz_
vector of the smalles fragment mz of each bucket
Definition FragmentIndex.h:375
double delta_mass
mass delta from this modification
Definition FragmentIndex.h:276
float peptide_min_mass_
Definition FragmentIndex.h:427
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 queryPeak...
int16_t min_isotope_error_
Minimal possible isotope error.
Definition FragmentIndex.h:439
float open_precursor_window_upper_
Defines the upper bound of the precursor-mass range.
Definition FragmentIndex.h:455
uint16_t max_precursor_charge_
maximal possible precursor charge
Definition FragmentIndex.h:442
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
void clear()
Delete fragment index. Sets is_build=false.
StringList modifications_variable_
Variable Modification -> all possible comibnations are created.
Definition FragmentIndex.h:433
size_t max_variable_mods_per_peptide_
Definition FragmentIndex.h:434
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 so...
void initModificationTables_()
std::pair< size_t, size_t > getPeptidesInPrecursorRange(float precursor_mass, const std::pair< float, float > &window)
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 o...
const std::vector< Peptide > & getPeptides() const
Returns a reference to the internal peptide container.
AASequence reconstructModifiedSequence(const Peptide &peptide, const std::vector< FASTAFile::FASTAEntry > &fasta_entries) const
Reconstruct a fully modified AASequence from a Peptide's bitmask.
std::vector< VarModEntry > variable_nterm_mods_
Pure N-terminal variable mods (not residue-specific)
Definition FragmentIndex.h:326
size_t peptide_min_length_
Definition FragmentIndex.h:429
static void initResidueMassTable_()
bool add_c_ions_
Definition FragmentIndex.h:419
float precursor_mz_tolerance_
Definition FragmentIndex.h:376
FragmentIndex()
Default constructor.
bool add_z_ions_
Definition FragmentIndex.h:421
static std::array< double, 128 > residue_mass_table_
Definition FragmentIndex.h:334
Precomputed ion-type mass offsets (from Residue::getInternalTo*Ion formulas)
Definition FragmentIndex.h:340
Match between a query peak and an entry in the DB.
Definition FragmentIndex.h:70
Entry in the per-AA variable modification lookup table.
Definition FragmentIndex.h:275
The representation of a 1D spectrum.
Definition MSSpectrum.h:44
A 1-dimensional raw data point or peak.
Definition Peak1D.h:30
Representation of a modification on an amino acid residue.
Definition ResidueModification.h:55
TermSpecificity
Position where the modification is allowed to occur.
Definition ResidueModification.h:74
uint32_t UInt32
Unsigned integer type (32bit)
Definition Types.h:33
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
std::vector< String > StringList
Vector of String.
Definition ListUtils.h:44
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
One entry in the fragment index.
Definition FragmentIndex.h:251
Fragment(UInt32 peptide_idx, float fragment_mz)
Definition FragmentIndex.h:253
Definition FragmentIndex.h:203
UInt32 peptide_idx
Definition FragmentIndex.h:208
Hit(UInt32 peptide_idx, float fragment_mz)
Definition FragmentIndex.h:204
float fragment_mz
Definition FragmentIndex.h:209
A candidate modification slot for a specific peptide.
Definition FragmentIndex.h:287
const ResidueModification * mod_ptr
for AASequence reconstruction
Definition FragmentIndex.h:290
uint16_t position
residue index, or NTERM_SLOT/CTERM_SLOT
Definition FragmentIndex.h:288
double delta_mass
mass delta
Definition FragmentIndex.h:289
Compact descriptor of a peptide instance held by the FragmentIndex.
Definition FragmentIndex.h:50
std::pair< uint16_t, uint16_t > sequence_
{start, length} within the source protein sequence (start is 0-based; length in residues)
Definition FragmentIndex.h:62
uint32_t mod_bitmask_
Bitmask of active variable mod slots (0 = unmodified/fixed-only; up to 32 slots)
Definition FragmentIndex.h:61
UInt32 protein_idx
0-based index into FASTA entries provided to build(); identifies the source protein
Definition FragmentIndex.h:60
float precursor_mz_
Mono-isotopic m/z at charge 1 (M+H)+ of this peptide; used for sorting/filtering.
Definition FragmentIndex.h:63
Peptide(UInt32 protein_idx, uint32_t mod_bitmask, std::pair< uint16_t, uint16_t > sequence, float precursor_mz)
Definition FragmentIndex.h:53
container for SpectrumMatch. Also keeps count of total number of candidates and total number of match...
Definition FragmentIndex.h:82
SpectrumMatchesTopN & operator+=(const SpectrumMatchesTopN &other)
Appends the a SpectrumMatchesTopN to another one. Add the number of all matched peaks up....
Definition FragmentIndex.h:94
SpectrumMatchesTopN()=default
void clear()
Definition FragmentIndex.h:101
std::vector< SpectrumMatch > hits_
The preliminary candidates.
Definition FragmentIndex.h:83