OpenMS
FLASHExtenderAlgorithm Class Reference

#include <OpenMS/ANALYSIS/TOPDOWN/FLASHExtenderAlgorithm.h>

Inheritance diagram for FLASHExtenderAlgorithm:
[legend]
Collaboration diagram for FLASHExtenderAlgorithm:
[legend]

Classes

struct  HitInformation
 

Public Member Functions

 FLASHExtenderAlgorithm ()
 constructor More...
 
 ~FLASHExtenderAlgorithm () override=default
 destructor More...
 
 FLASHExtenderAlgorithm (const FLASHExtenderAlgorithm &)=default
 copy constructor More...
 
 FLASHExtenderAlgorithm (FLASHExtenderAlgorithm &&other)=default
 move constructor More...
 
FLASHExtenderAlgorithmoperator= (const FLASHExtenderAlgorithm &other)
 assignment operator More...
 
void run (std::vector< ProteinHit > &hits, const std::vector< FLASHHelperClasses::Tag > &tags, const DeconvolvedSpectrum &dspec, const MSSpectrum &spec, double ppm, bool multiple_hits_per_spec)
 
void getProteoforms (std::vector< ProteinHit > &hits) const
 
bool hasProteoforms () const
 
void setModificationMap (const std::map< double, std::vector< ResidueModification >> &mod_map)
 
- Public Member Functions inherited from DefaultParamHandler
 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...
 
DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () 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...
 
- Public Member Functions inherited from ProgressLogger
 ProgressLogger ()
 Constructor. More...
 
virtual ~ProgressLogger ()
 Destructor. More...
 
 ProgressLogger (const ProgressLogger &other)
 Copy constructor. More...
 
ProgressLoggeroperator= (const ProgressLogger &other)
 Assignment Operator. More...
 
void setLogType (LogType type) const
 Sets the progress log that should be used. The default type is NONE! More...
 
LogType getLogType () const
 Returns the type of progress log being used. More...
 
void setLogger (ProgressLoggerImpl *logger)
 Sets the logger to be used for progress logging. More...
 
void startProgress (SignedSize begin, SignedSize end, const String &label) const
 Initializes the progress display. More...
 
void setProgress (SignedSize value) const
 Sets the current progress. More...
 
void endProgress (UInt64 bytes_processed=0) const
 
void nextProgress () const
 increment progress by 1 (according to range begin-end) More...
 

Static Public Attributes

static const int multi_ion_score = 1
 

Protected Member Functions

void updateMembers_ () override
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
void setDefaultParams_ ()
 implemented for DefaultParamHandler More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Private Member Functions

void calculatePrecursorMass_ (const ProteinHit &hit, const std::map< int, std::vector< Size >> &best_path_map, HitInformation &hi)
 
void defineNodes_ (const DeconvolvedSpectrum &dspec, HitInformation &hi, double max_mass)
 
void run_ (const ProteinHit &hit, HitInformation &hi, const std::vector< FLASHHelperClasses::Tag > &matched_tags, std::map< int, std::vector< Size >> &all_paths_per_mode, int max_mod_cntr_for_last_mode)
 
Size getVertex_ (int node_index, int pro_index, int score, int num_mod, Size pro_mass_size) const
 
int getNodeIndex_ (Size vertex, Size pro_mass_size) const
 
int getProIndex_ (Size vertex, Size pro_mass_size) const
 
int getModNumber_ (Size vertex) const
 
int getScore_ (Size vertex) const
 
void constructDAG_ (std::set< Size > &sinks, HitInformation &hi, const std::vector< std::vector< int >> &tag_edges, int max_mod_cntr_for_last_mode, bool use_tags)
 
void connectBetweenTags_ (std::set< Size > &visited_tag_edges, HitInformation &hi, std::map< Size, std::tuple< double, double >> &sinks, Size vertex, double truncation_mass, double cumulative_shift, std::map< Size, std::map< int, int >> &node_max_score_map, const std::vector< std::vector< int >> &tag_edges, int max_mod_cntr_for_last_mode, bool use_tags)
 
void extendBetweenTags_ (std::map< Size, std::tuple< double, double >> &sinks, HitInformation &hi, Size start_vertex, int end_node_index, int end_pro_index, int diagonal_counter, double truncation_mass, double cumulative_mod_mass, std::map< Size, std::map< int, int >> &node_max_score_map, int max_mod_cntr_for_last_mode)
 
int getProteinLength_ (const std::vector< Size > &path, const std::vector< double > &pro_masses) const
 
double getSpecMassSpan_ (const std::vector< Size > &path, const MSSpectrum &node_spec, int pro_mass_size) const
 
double getProteinMassSpan_ (const std::vector< Size > &path, const std::vector< double > &pro_masses) const
 
int getModifiedAACount_ (const std::vector< Size > &path) const
 

Static Private Member Functions

static void getProMasses_ (const ProteinHit &hit, std::vector< double > &pro_masses, int mode)
 

Private Attributes

std::map< double, std::vector< ResidueModification > > mod_map_
 
std::vector< std::string > ion_types_str_
 
std::vector< double > prefix_shifts_
 
std::vector< double > suffix_shifts_
 
std::vector< ProteinHitproteoform_hits_
 
std::vector< FLASHHelperClasses::Tagtags_
 
double tol_
 
int max_mod_cntr_ = 0
 
std::vector< int > start_pro_indices_
 
const int max_path_score_ = 1200
 
const int min_path_score_ = -20
 
const int max_extension_stretch_ = 50
 
double max_mod_mass_ = 500.0
 
double given_precursor_mass_ = -1
 

Additional Inherited Members

- Public Types inherited from ProgressLogger
enum  LogType { CMD , GUI , NONE }
 Possible log types. More...
 
- Static Public Member Functions inherited from DefaultParamHandler
static void writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="")
 Writes all parameters to meta values. More...
 
- Protected Attributes inherited from DefaultParamHandler
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< Stringsubsections_
 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...
 
- Protected Attributes inherited from ProgressLogger
LogType type_
 
time_t last_invoke_
 
ProgressLoggerImplcurrent_logger_
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Class Documentation

◆ OpenMS::FLASHExtenderAlgorithm::HitInformation

struct OpenMS::FLASHExtenderAlgorithm::HitInformation
Collaboration diagram for FLASHExtenderAlgorithm::HitInformation:
[legend]
Class Members
double calculated_precursor_mass_
DAG dag_
int mode_
map< int, MSSpectrum > node_spec_map_
map< int, vector< double > > pro_mass_map_
int protein_end_position_
int protein_start_position_
map< int, MSSpectrum > tol_spec_map_
dynamic_bitset visited_

Constructor & Destructor Documentation

◆ FLASHExtenderAlgorithm() [1/3]

constructor

◆ ~FLASHExtenderAlgorithm()

~FLASHExtenderAlgorithm ( )
overridedefault

destructor

◆ FLASHExtenderAlgorithm() [2/3]

copy constructor

◆ FLASHExtenderAlgorithm() [3/3]

move constructor

Member Function Documentation

◆ calculatePrecursorMass_()

void calculatePrecursorMass_ ( const ProteinHit hit,
const std::map< int, std::vector< Size >> &  best_path_map,
HitInformation hi 
)
private

◆ connectBetweenTags_()

void connectBetweenTags_ ( std::set< Size > &  visited_tag_edges,
HitInformation hi,
std::map< Size, std::tuple< double, double >> &  sinks,
Size  vertex,
double  truncation_mass,
double  cumulative_shift,
std::map< Size, std::map< int, int >> &  node_max_score_map,
const std::vector< std::vector< int >> &  tag_edges,
int  max_mod_cntr_for_last_mode,
bool  use_tags 
)
private

◆ constructDAG_()

void constructDAG_ ( std::set< Size > &  sinks,
HitInformation hi,
const std::vector< std::vector< int >> &  tag_edges,
int  max_mod_cntr_for_last_mode,
bool  use_tags 
)
private

◆ defineNodes_()

void defineNodes_ ( const DeconvolvedSpectrum dspec,
HitInformation hi,
double  max_mass 
)
private

◆ extendBetweenTags_()

void extendBetweenTags_ ( std::map< Size, std::tuple< double, double >> &  sinks,
HitInformation hi,
Size  start_vertex,
int  end_node_index,
int  end_pro_index,
int  diagonal_counter,
double  truncation_mass,
double  cumulative_mod_mass,
std::map< Size, std::map< int, int >> &  node_max_score_map,
int  max_mod_cntr_for_last_mode 
)
private

◆ getModifiedAACount_()

int getModifiedAACount_ ( const std::vector< Size > &  path) const
private

◆ getModNumber_()

int getModNumber_ ( Size  vertex) const
private

◆ getNodeIndex_()

int getNodeIndex_ ( Size  vertex,
Size  pro_mass_size 
) const
private

◆ getProIndex_()

int getProIndex_ ( Size  vertex,
Size  pro_mass_size 
) const
private

◆ getProMasses_()

static void getProMasses_ ( const ProteinHit hit,
std::vector< double > &  pro_masses,
int  mode 
)
staticprivate

◆ getProteinLength_()

int getProteinLength_ ( const std::vector< Size > &  path,
const std::vector< double > &  pro_masses 
) const
private

◆ getProteinMassSpan_()

double getProteinMassSpan_ ( const std::vector< Size > &  path,
const std::vector< double > &  pro_masses 
) const
private

◆ getProteoforms()

void getProteoforms ( std::vector< ProteinHit > &  hits) const
inline

◆ getScore_()

int getScore_ ( Size  vertex) const
private

◆ getSpecMassSpan_()

double getSpecMassSpan_ ( const std::vector< Size > &  path,
const MSSpectrum node_spec,
int  pro_mass_size 
) const
private

◆ getVertex_()

Size getVertex_ ( int  node_index,
int  pro_index,
int  score,
int  num_mod,
Size  pro_mass_size 
) const
private

◆ hasProteoforms()

bool hasProteoforms ( ) const
inline

◆ operator=()

FLASHExtenderAlgorithm& operator= ( const FLASHExtenderAlgorithm other)

assignment operator

◆ run()

void run ( std::vector< ProteinHit > &  hits,
const std::vector< FLASHHelperClasses::Tag > &  tags,
const DeconvolvedSpectrum dspec,
const MSSpectrum spec,
double  ppm,
bool  multiple_hits_per_spec 
)

◆ run_()

void run_ ( const ProteinHit hit,
HitInformation hi,
const std::vector< FLASHHelperClasses::Tag > &  matched_tags,
std::map< int, std::vector< Size >> &  all_paths_per_mode,
int  max_mod_cntr_for_last_mode 
)
private

◆ setDefaultParams_()

void setDefaultParams_ ( )
protected

implemented for DefaultParamHandler

◆ setModificationMap()

void setModificationMap ( const std::map< double, std::vector< ResidueModification >> &  mod_map)
inline

◆ updateMembers_()

void updateMembers_ ( )
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.

Member Data Documentation

◆ given_precursor_mass_

double given_precursor_mass_ = -1
private

◆ ion_types_str_

std::vector<std::string> ion_types_str_
private

◆ max_extension_stretch_

const int max_extension_stretch_ = 50
private

◆ max_mod_cntr_

int max_mod_cntr_ = 0
private

◆ max_mod_mass_

double max_mod_mass_ = 500.0
private

◆ max_path_score_

const int max_path_score_ = 1200
private

◆ min_path_score_

const int min_path_score_ = -20
private

◆ mod_map_

std::map<double, std::vector<ResidueModification> > mod_map_
private

◆ multi_ion_score

const int multi_ion_score = 1
static

◆ prefix_shifts_

std::vector<double> prefix_shifts_
private

◆ proteoform_hits_

std::vector<ProteinHit> proteoform_hits_
private

◆ start_pro_indices_

std::vector<int> start_pro_indices_
private

◆ suffix_shifts_

std::vector<double> suffix_shifts_
private

◆ tags_

std::vector<FLASHHelperClasses::Tag> tags_
private

◆ tol_

double tol_
private