OpenMS  2.4.0
Classes | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Attributes | Private Attributes | List of all members
RNPxlSearch Class Reference
Inheritance diagram for RNPxlSearch:
TOPPBase

Classes

struct  AnnotatedHit
 Slimmer structure as storing all scored candidates in PeptideHit objects takes too much space. More...
 
struct  FragmentAdductDefinition_
 
struct  MS2AdductsOfSinglePrecursorAdduct
 
class  RNPxlFragmentIonGenerator
 
struct  RNPxlParameterParsing
 

Public Member Functions

 RNPxlSearch ()
 
- Public Member Functions inherited from TOPPBase
 TOPPBase (const String &name, const String &description, bool official=true, const std::vector< Citation > &citations={})
 Constructor. More...
 
virtual ~TOPPBase ()
 Destructor. More...
 
ExitCodes main (int argc, const char **argv)
 Main routine of all TOPP applications. More...
 

Protected Types

using NucleotideToFeasibleFragmentAdducts = pair< char, vector< FragmentAdductDefinition_ > >
 

Protected Member Functions

void registerOptionsAndFlags_ () override
 Sets the valid command line options (with argument) and flags (without argument). More...
 
void preprocessSpectra_ (PeakMap &exp, double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, bool single_charge_spectra, bool annotate_charge=false)
 
void postScoreHits_ (const PeakMap &exp, vector< vector< AnnotatedHit > > &annotated_hits, Size top_hits, const RNPxlModificationMassesResult &mm, const vector< ResidueModification > &fixed_modifications, const vector< ResidueModification > &variable_modifications, Size max_variable_mods_per_peptide, const TheoreticalSpectrumGenerator &partial_loss_spectrum_generator, double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, const RNPxlParameterParsing::PrecursorsToMS2Adducts &all_feasible_adducts)
 
void postProcessHits_ (const PeakMap &exp, vector< vector< AnnotatedHit > > &annotated_hits, vector< ProteinIdentification > &protein_ids, vector< PeptideIdentification > &peptide_ids, Size top_hits, const RNPxlModificationMassesResult &mm, const vector< ResidueModification > &fixed_modifications, const vector< ResidueModification > &variable_modifications, Size max_variable_mods_per_peptide)
 Filter by top scoring hits, reconstruct original peptide from memory efficient structure, and add additional meta information. More...
 
void mapPrecursorMassesToScans (const Int min_precursor_charge, const Int max_precursor_charge, const IntList &precursor_isotopes, const double small_peptide_mass_filter_threshold, const Size peptide_min_size, const PeakMap &spectra, multimap< double, pair< Size, int >> &multimap_mass_2_scan_index) const
 
void initializeSpectrumGenerators (TheoreticalSpectrumGenerator &total_loss_spectrum_generator, TheoreticalSpectrumGenerator &partial_loss_spectrum_generator, TheoreticalSpectrumGenerator &a_ion_sub_score_spectrum_generator, TheoreticalSpectrumGenerator &immonium_ion_sub_score_spectrum_generator, TheoreticalSpectrumGenerator &precursor_ion_sub_score_spectrum_generator) const
 
ExitCodes main_ (int, const char **) override
 The actual "main" method. main_() is invoked by main(). More...
 
void scoreTotalLossFragments_ (const PeakSpectrum &exp_spectrum, const PeakSpectrum &total_loss_spectrum, double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, const PeakSpectrum &a_ion_sub_score_spectrum, const PeakSpectrum &precursor_sub_score_spectrum, const PeakSpectrum &immonium_sub_score_spectrum, float &total_loss_score, float &tlss_MIC, float &tlss_err, float &tlss_Morph, float &immonium_sub_score, float &precursor_sub_score, float &a_ion_sub_score) const
 
void scorePartialLossFragments_ (const PeakSpectrum &exp_spectrum, double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, const PeakSpectrum &partial_loss_spectrum_z1, const PeakSpectrum &partial_loss_spectrum_z2, const PeakSpectrum &marker_ions_sub_score_spectrum_z1, float &partial_loss_sub_score, float &marker_ions_sub_score, float &plss_MIC, float &plss_err, float &plss_Morph) const
 
- Protected Member Functions inherited from TOPPBase
const StringgetIniLocation_ () const
 Returns the location of the ini file where parameters are taken from. E.g. if the command line was TOPPTool -instance 17, then this will be "TOPPTool:17:". Note the ':' at the end. More...
 
const StringtoolName_ () const
 Returns the tool name. More...
 
void printUsage_ ()
 Prints the tool-specific command line options and appends the common options. More...
 
bool parseRange_ (const String &text, double &low, double &high) const
 Parses a range string ([a]:[b]) into two variables (doubles) More...
 
bool parseRange_ (const String &text, Int &low, Int &high) const
 Parses a range string ([a]:[b]) into two variables (integers) More...
 
bool writeCTD_ ()
 Write common tool description (CTD) file. More...
 
ExitCodes writeWSDL_ (const String &filename)
 Write WSDL file and validate it. Returns EXECUTION_OK or INTERNAL_ERROR (if validation failed) More...
 
String getParamArgument_ (const Param::ParamEntry &entry) const
 Utility function that determines a suitable argument value for the given Param::ParamEntry. More...
 
std::vector< ParameterInformationparamToParameterInformation_ (const Param &param) const
 Translates the given parameter object into a vector of ParameterInformation, that can be utilized for cl parsing. More...
 
ParameterInformation paramEntryToParameterInformation_ (const Param::ParamEntry &entry, const String &argument="", const String &full_name="") const
 Transforms a ParamEntry object to command line parameter (ParameterInformation). More...
 
void registerParamSubsectionsAsTOPPSubsections_ (const Param &param)
 
void registerFullParam_ (const Param &param)
 Register command line parameters for all entries in a Param object. More...
 
void registerStringOption_ (const String &name, const String &argument, const String &default_value, const String &description, bool required=true, bool advanced=false)
 Registers a string option. More...
 
void setValidStrings_ (const String &name, const std::vector< String > &strings)
 Sets the valid strings for a string option or a whole string list. More...
 
void setValidStrings_ (const String &name, const std::string vstrings[], int count)
 Sets the valid strings for a string option or a whole string list. More...
 
void registerInputFile_ (const String &name, const String &argument, const String &default_value, const String &description, bool required=true, bool advanced=false, const StringList &tags=StringList())
 Registers an input file option. More...
 
void registerOutputFile_ (const String &name, const String &argument, const String &default_value, const String &description, bool required=true, bool advanced=false)
 Registers an output file option. More...
 
void setValidFormats_ (const String &name, const std::vector< String > &formats, const bool force_OpenMS_format=true)
 Sets the formats for a input/output file option or for all members of an input/output file lists. More...
 
void registerDoubleOption_ (const String &name, const String &argument, double default_value, const String &description, bool required=true, bool advanced=false)
 Registers a double option. More...
 
void setMinInt_ (const String &name, Int min)
 Sets the minimum value for the integer parameter(can be a list of integers,too) name. More...
 
void setMaxInt_ (const String &name, Int max)
 Sets the maximum value for the integer parameter(can be a list of integers,too) name. More...
 
void setMinFloat_ (const String &name, double min)
 Sets the minimum value for the floating point parameter(can be a list of floating points,too) name. More...
 
void setMaxFloat_ (const String &name, double max)
 Sets the maximum value for the floating point parameter(can be a list of floating points,too) name. More...
 
void registerIntOption_ (const String &name, const String &argument, Int default_value, const String &description, bool required=true, bool advanced=false)
 Registers an integer option. More...
 
void registerIntList_ (const String &name, const String &argument, IntList default_value, const String &description, bool required=true, bool advanced=false)
 Registers a list of integers option. More...
 
void registerDoubleList_ (const String &name, const String &argument, DoubleList default_value, const String &description, bool required=true, bool advanced=false)
 Registers a list of doubles option. More...
 
void registerStringList_ (const String &name, const String &argument, StringList default_value, const String &description, bool required=true, bool advanced=false)
 Registers a list of strings option. More...
 
void registerInputFileList_ (const String &name, const String &argument, StringList default_value, const String &description, bool required=true, bool advanced=false, const StringList &tags=StringList())
 Registers a list of input files option. More...
 
void registerOutputFileList_ (const String &name, const String &argument, StringList default_value, const String &description, bool required=true, bool advanced=false)
 Registers a list of output files option. More...
 
void registerFlag_ (const String &name, const String &description, bool advanced=false)
 Registers a flag. More...
 
void registerSubsection_ (const String &name, const String &description)
 Registers an allowed subsection in the INI file (usually from OpenMS algorithms). More...
 
void registerTOPPSubsection_ (const String &name, const String &description)
 Registers an allowed subsection in the INI file originating from the TOPP tool itself. More...
 
void addEmptyLine_ ()
 Adds an empty line between registered variables in the documentation. More...
 
String getStringOption_ (const String &name) const
 Returns the value of a previously registered string option. More...
 
double getDoubleOption_ (const String &name) const
 Returns the value of a previously registered double option. More...
 
Int getIntOption_ (const String &name) const
 Returns the value of a previously registered integer option. More...
 
StringList getStringList_ (const String &name) const
 Returns the value of a previously registered StringList. More...
 
IntList getIntList_ (const String &name) const
 Returns the value of a previously registered IntList. More...
 
DoubleList getDoubleList_ (const String &name) const
 Returns the value of a previously registered DoubleList. More...
 
bool getFlag_ (const String &name) const
 Returns the value of a previously registered flag. More...
 
const ParameterInformationfindEntry_ (const String &name) const
 Finds the entry in the parameters_ array that has the name name. More...
 
Param const & getParam_ () const
 Return all parameters relevant to this TOPP tool. More...
 
void checkParam_ (const Param &param, const String &filename, const String &location) const
 Checks top-level entries of param according to the information during registration. More...
 
void checkIfIniParametersAreApplicable_ (const Param &ini_params)
 Checks if the parameters of the provided ini file are applicable to this tool. More...
 
void writeLog_ (const String &text) const
 Writes a string to the log file and to std::cout. More...
 
void writeDebug_ (const String &text, UInt min_level) const
 Writes a text to the log file and to std::cout if the debug level is at least min_level. More...
 
void writeDebug_ (const String &text, const Param &param, UInt min_level) const
 Writes a String followed by a Param to the log file and to std::cout if the debug level is at least min_level. More...
 
String makeTempDirectory_ () const
 Creates a unique temporary directory and returns its name (you have to clean it up yourself) More...
 
String makeAutoRemoveTempDirectory_ (Int keep_debug=2)
 Creates a unique temporary directory and returns its name (will be cleaned up automatically if debug level is high enough) More...
 
void removeTempDirectory_ (const String &dirname, Int keep_debug=2) const
 Removes a (temporary) directory. More...
 
ExitCodes runExternalProcess_ (const QString &executable, const QStringList &arguments, const QString &workdir="") const
 Runs an external process via QProcess and reports its status in the logs. More...
 
void inputFileReadable_ (const String &filename, const String &param_name) const
 Checks if an input file exists, is readable and is not empty. More...
 
void outputFileWritable_ (const String &filename, const String &param_name) const
 Checks if an output file is writable. More...
 
void addDataProcessing_ (ConsensusMap &map, const DataProcessing &dp) const
 Data processing setter for consensus maps. More...
 
void addDataProcessing_ (FeatureMap &map, const DataProcessing &dp) const
 Data processing setter for feature maps. More...
 
void addDataProcessing_ (PeakMap &map, const DataProcessing &dp) const
 Data processing setter for peak maps. More...
 
DataProcessing getProcessingInfo_ (DataProcessing::ProcessingAction action) const
 Returns the data processing information. More...
 
DataProcessing getProcessingInfo_ (const std::set< DataProcessing::ProcessingAction > &actions) const
 Returns the data processing information. More...
 

Static Protected Attributes

static constexpr const char * ANNOTATIONS_MARKER_ION_PREFIX = "MI:"
 
- Static Protected Attributes inherited from TOPPBase
static String topp_ini_file_
 .TOPP.ini file for storing system default parameters More...
 
static const Citation cite_openms_
 The OpenMS citation. More...
 

Private Attributes

bool fast_scoring_ = true
 
bool localization_ = false
 
set< char > can_xl_
 

Additional Inherited Members

- Public Types inherited from TOPPBase
enum  ExitCodes {
  EXECUTION_OK, INPUT_FILE_NOT_FOUND, INPUT_FILE_NOT_READABLE, INPUT_FILE_CORRUPT,
  INPUT_FILE_EMPTY, CANNOT_WRITE_OUTPUT_FILE, ILLEGAL_PARAMETERS, MISSING_PARAMETERS,
  UNKNOWN_ERROR, EXTERNAL_PROGRAM_ERROR, PARSE_ERROR, INCOMPATIBLE_INPUT_DATA,
  INTERNAL_ERROR, UNEXPECTED_RESULT
}
 Exit codes. More...
 
- Static Public Member Functions inherited from TOPPBase
static void setMaxNumberOfThreads (int num_threads)
 Sets the maximal number of usable threads. More...
 
- Protected Attributes inherited from TOPPBase
String version_
 Version string (if empty, the OpenMS/TOPP version is printed) More...
 
String verboseVersion_
 Version string including additional revision/date time information. Note: This differs from version_ only if not provided by the user. More...
 
bool official_
 Flag indicating if this an official TOPP tool. More...
 
std::vector< Citationcitations_
 Papers, specific for this tool (will be shown in '–help') More...
 
ProgressLogger::LogType log_type_
 Type of progress logging. More...
 
bool test_mode_
 Test mode. More...
 
Int debug_level_
 Debug level set by -debug. More...
 

Member Typedef Documentation

◆ NucleotideToFeasibleFragmentAdducts

using NucleotideToFeasibleFragmentAdducts = pair<char, vector<FragmentAdductDefinition_> >
protected

Constructor & Destructor Documentation

◆ RNPxlSearch()

RNPxlSearch ( )
inline

Member Function Documentation

◆ initializeSpectrumGenerators()

void initializeSpectrumGenerators ( TheoreticalSpectrumGenerator total_loss_spectrum_generator,
TheoreticalSpectrumGenerator partial_loss_spectrum_generator,
TheoreticalSpectrumGenerator a_ion_sub_score_spectrum_generator,
TheoreticalSpectrumGenerator immonium_ion_sub_score_spectrum_generator,
TheoreticalSpectrumGenerator precursor_ion_sub_score_spectrum_generator 
) const
inlineprotected

◆ main_()

ExitCodes main_ ( int  argc,
const char **  argv 
)
inlineoverrideprotectedvirtual

The actual "main" method. main_() is invoked by main().

Implements TOPPBase.

References RNPxlSearch::AnnotatedHit::a_ion_score, TextFile::addLine(), PeakFileOptions::addMSLevel(), RNPxlReport::annotate(), FalseDiscoveryRate::apply(), ModifiedPeptideGenerator::applyFixedModifications(), ModifiedPeptideGenerator::applyVariableModifications(), OpenMS::Constants::c, MSExperiment::clear(), PeakFileOptions::clearMSLevels(), RNPxlSearch::AnnotatedHit::cross_linked_nucleotide, PeptideIndexing::DATABASE_EMPTY, EnzymaticDigestion::digestUnmodified(), ProgressLogger::endProgress(), RNPxlSearch::AnnotatedHit::err, PeptideIndexing::EXECUTION_OK, AASequence::fromString(), MSSpectrum::getIntegerDataArrays(), AASequence::getMonoWeight(), MzMLFile::getOptions(), DefaultParamHandler::getParameters(), SpectrumSettings::getPrecursors(), TheoreticalSpectrumGenerator::getSpectrum(), MSSpectrum::getStringDataArrays(), FASTAFile::FASTAEntry::identifier, RNPxlSearch::AnnotatedHit::immonium_score, RNPxlModificationsGenerator::initModificationMassesRNA(), RNPxlSearch::AnnotatedHit::isotope_error, MzMLFile::load(), FASTAFile::load(), LOG_DEBUG, LOG_INFO, LOG_WARN, RNPxlSearch::AnnotatedHit::marker_ions_score, RNPxlSearch::AnnotatedHit::MIC, RNPxlModificationMassesResult::mod_combinations, RNPxlModificationMassesResult::mod_masses, RNPxlSearch::AnnotatedHit::Morph, RNPxlSearch::AnnotatedHit::partial_loss_score, PeptideIndexing::PEPTIDE_IDS_EMPTY, RNPxlSearch::AnnotatedHit::peptide_mod_index, RNPxlSearch::AnnotatedHit::pl_err, RNPxlSearch::AnnotatedHit::pl_MIC, RNPxlSearch::AnnotatedHit::pl_Morph, RNPxlSearch::AnnotatedHit::precursor_score, String::reverse(), RNPxlSearch::AnnotatedHit::rna_mod_index, PeptideIndexing::run(), RNPxlSearch::AnnotatedHit::score, FASTAFile::FASTAEntry::sequence, RNPxlSearch::AnnotatedHit::sequence, ProteaseDigestion::setEnzyme(), ProgressLogger::setLogType(), EnzymaticDigestion::setMissedCleavages(), DefaultParamHandler::setParameters(), ProgressLogger::setProgress(), Param::setValue(), MSExperiment::size(), MSSpectrum::sortByPosition(), MSExperiment::sortSpectra(), ProgressLogger::startProgress(), TextFile::store(), IdXMLFile::store(), RNPxlSearch::AnnotatedHit::total_MIC, and PeptideIndexing::UNEXPECTED_RESULT.

◆ mapPrecursorMassesToScans()

void mapPrecursorMassesToScans ( const Int  min_precursor_charge,
const Int  max_precursor_charge,
const IntList precursor_isotopes,
const double  small_peptide_mass_filter_threshold,
const Size  peptide_min_size,
const PeakMap spectra,
multimap< double, pair< Size, int >> &  multimap_mass_2_scan_index 
) const
inlineprotected

◆ postProcessHits_()

void postProcessHits_ ( const PeakMap exp,
vector< vector< AnnotatedHit > > &  annotated_hits,
vector< ProteinIdentification > &  protein_ids,
vector< PeptideIdentification > &  peptide_ids,
Size  top_hits,
const RNPxlModificationMassesResult mm,
const vector< ResidueModification > &  fixed_modifications,
const vector< ResidueModification > &  variable_modifications,
Size  max_variable_mods_per_peptide 
)
inlineprotected

Filter by top scoring hits, reconstruct original peptide from memory efficient structure, and add additional meta information.

References ModifiedPeptideGenerator::applyFixedModifications(), ModifiedPeptideGenerator::applyVariableModifications(), PeptideIdentification::assignRanks(), ProteinIdentification::SearchParameters::charges, ListUtils::concatenate(), ProteinIdentification::SearchParameters::db, ProteinIdentification::SearchParameters::digestion_enzyme, ProteinIdentification::SearchParameters::fixed_modifications, ProteinIdentification::SearchParameters::fragment_mass_tolerance, ProteinIdentification::SearchParameters::fragment_mass_tolerance_ppm, AASequence::fromString(), DigestionEnzymeDB< DigestionEnzymeType, InstanceType >::getEnzyme(), DigestionEnzymeDB< DigestionEnzymeProtein, ProteaseDB >::getInstance(), EmpiricalFormula::getMonoWeight(), PeptideHit::getScore(), VersionInfo::getVersion(), ProteinIdentification::SearchParameters::missed_cleavages, RNPxlModificationMassesResult::mod_combinations, DateTime::now(), OPENMS_POSTCONDITION, ProteinIdentification::SearchParameters::precursor_mass_tolerance, ProteinIdentification::SearchParameters::precursor_mass_tolerance_ppm, PeptideHit::setCharge(), PeptideIdentification::setHigherScoreBetter(), PeptideIdentification::setHits(), MetaInfoInterface::setMetaValue(), PeptideIdentification::setMZ(), PeptideHit::setPeakAnnotations(), PeptideIdentification::setRT(), PeptideHit::setScore(), PeptideIdentification::setScoreType(), PeptideHit::setSequence(), and ProteinIdentification::SearchParameters::variable_modifications.

◆ postScoreHits_()

void postScoreHits_ ( const PeakMap exp,
vector< vector< AnnotatedHit > > &  annotated_hits,
Size  top_hits,
const RNPxlModificationMassesResult mm,
const vector< ResidueModification > &  fixed_modifications,
const vector< ResidueModification > &  variable_modifications,
Size  max_variable_mods_per_peptide,
const TheoreticalSpectrumGenerator partial_loss_spectrum_generator,
double  fragment_mass_tolerance,
bool  fragment_mass_tolerance_unit_ppm,
const RNPxlParameterParsing::PrecursorsToMS2Adducts all_feasible_adducts 
)
inlineprotected

◆ preprocessSpectra_()

void preprocessSpectra_ ( PeakMap exp,
double  fragment_mass_tolerance,
bool  fragment_mass_tolerance_unit_ppm,
bool  single_charge_spectra,
bool  annotate_charge = false 
)
inlineprotected

◆ registerOptionsAndFlags_()

void registerOptionsAndFlags_ ( )
inlineoverrideprotectedvirtual

Sets the valid command line options (with argument) and flags (without argument).

The options '-ini' '-log' '-instance' '-debug' and the flag '–help' are automatically registered.

Implements TOPPBase.

References DigestionEnzymeDB< DigestionEnzymeType, InstanceType >::getAllNames(), ModificationsDB::getAllSearchModifications(), DigestionEnzymeDB< DigestionEnzymeProtein, ProteaseDB >::getInstance(), and ModificationsDB::getInstance().

◆ scorePartialLossFragments_()

void scorePartialLossFragments_ ( const PeakSpectrum exp_spectrum,
double  fragment_mass_tolerance,
bool  fragment_mass_tolerance_unit_ppm,
const PeakSpectrum partial_loss_spectrum_z1,
const PeakSpectrum partial_loss_spectrum_z2,
const PeakSpectrum marker_ions_sub_score_spectrum_z1,
float partial_loss_sub_score,
float marker_ions_sub_score,
float plss_MIC,
float plss_err,
float plss_Morph 
) const
inlineprotected

◆ scoreTotalLossFragments_()

void scoreTotalLossFragments_ ( const PeakSpectrum exp_spectrum,
const PeakSpectrum total_loss_spectrum,
double  fragment_mass_tolerance,
bool  fragment_mass_tolerance_unit_ppm,
const PeakSpectrum a_ion_sub_score_spectrum,
const PeakSpectrum precursor_sub_score_spectrum,
const PeakSpectrum immonium_sub_score_spectrum,
float total_loss_score,
float tlss_MIC,
float tlss_err,
float tlss_Morph,
float immonium_sub_score,
float precursor_sub_score,
float a_ion_sub_score 
) const
inlineprotected

Member Data Documentation

◆ ANNOTATIONS_MARKER_ION_PREFIX

constexpr const char* ANNOTATIONS_MARKER_ION_PREFIX = "MI:"
staticprotected

◆ can_xl_

set<char> can_xl_
private

◆ fast_scoring_

bool fast_scoring_ = true
private

◆ localization_

bool localization_ = false
private