OpenMS
IDRipper Class Reference

Ripping protein/peptide identification according their file origin. More...

#include <OpenMS/ANALYSIS/ID/IDRipper.h>

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

Classes

struct  IdentificationRuns
 Represents a set of IdentificationRuns. More...
 
struct  RipFileContent
 Represents the content of an IDRipper output file. More...
 
struct  RipFileIdentifier
 Identifies an IDRipper output file. More...
 
struct  RipFileIdentifierIdxComparator
 Provides a 'less' operation for RipFileIdentifiers that ignores the out_basename and origin_fullname members. More...
 

Public Types

enum  OriginAnnotationFormat {
  FILE_ORIGIN = 0 , MAP_INDEX = 1 , ID_MERGE_INDEX = 2 , UNKNOWN_OAF = 3 ,
  SIZE_OF_ORIGIN_ANNOTATION_FORMAT = 4
}
 Possible input file encodings for the origin as used by different versions of IDMerger. More...
 
typedef std::map< RipFileIdentifier, RipFileContent, RipFileIdentifierIdxComparatorRipFileMap
 Represents the result of an IDRipper process, a map assigning file content to output file identifiers. More...
 

Public Member Functions

 IDRipper ()
 Default constructor. More...
 
 ~IDRipper () override
 Destructor. More...
 
void rip (RipFileMap &ripped, std::vector< ProteinIdentification > &proteins, std::vector< PeptideIdentification > &peptides, bool numeric_filenames, bool split_ident_runs)
 Ripping protein/peptide identification according their file origin. More...
 
void rip (std::vector< RipFileIdentifier > &rfis, std::vector< RipFileContent > &rfcs, std::vector< ProteinIdentification > &proteins, std::vector< PeptideIdentification > &peptides, bool numeric_filenames, bool split_ident_runs)
 Ripping protein/peptide identification according their file origin. More...
 
- 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...
 

Static Public Attributes

static const std::array< std::string, SIZE_OF_ORIGIN_ANNOTATION_FORMATnames_of_OriginAnnotationFormat
 String representations for the OriginAnnotationFormat enum. More...
 

Private Member Functions

 IDRipper (const IDRipper &rhs)
 Copy constructor. More...
 
IDRipperoperator= (const IDRipper &rhs)
 Assignment. More...
 
OriginAnnotationFormat detectOriginAnnotationFormat_ (std::map< String, UInt > &file_origin_map, const std::vector< PeptideIdentification > &peptide_idents)
 helper function, detects file origin annotation standard from collections of protein and peptide hits More...
 
void getProteinHits_ (std::vector< ProteinHit > &result, const std::unordered_map< String, const ProteinHit * > &acc2protein_hits, const std::set< String > &protein_accessions)
 helper function, extracts all protein hits that match the protein accession More...
 
std::set< StringgetProteinAccessions_ (const std::vector< PeptideHit > &peptide_hits)
 helper function, returns the string representation of the peptide hit accession More...
 
int getProteinIdentification_ (const PeptideIdentification &pep_ident, const IdentificationRuns &id_runs)
 helper function, returns the index of the protein identification for the given peptide identification based on the same identifier using id_runs as lookup More...
 
bool registerBasename_ (std::map< String, std::pair< UInt, UInt > > &basename_to_numeric, const IDRipper::RipFileIdentifier &rfi)
 helper function, register a potential output file basename to detect duplicate output basenames More...
 
bool setOriginAnnotationMode_ (short &mode, short const new_value)
 helper function, sets the value of mode to new_value and returns true if the old value was identical or unset (-1) More...
 

Additional Inherited Members

- 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 Member Functions inherited from DefaultParamHandler
virtual void updateMembers_ ()
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. 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...
 

Detailed Description

Ripping protein/peptide identification according their file origin.

Helper class, which is used by ProteinQuantifier. See there for further documentation.

Parameters of this class are:

NameTypeDefaultRestrictionsDescription

Note:
  • If a section name is documented, the documentation is displayed as tooltip.
  • Advanced parameter names are italic.

Member Typedef Documentation

◆ RipFileMap

Represents the result of an IDRipper process, a map assigning file content to output file identifiers.

Member Enumeration Documentation

◆ OriginAnnotationFormat

Possible input file encodings for the origin as used by different versions of IDMerger.

Enumerator
FILE_ORIGIN 
MAP_INDEX 
ID_MERGE_INDEX 
UNKNOWN_OAF 
SIZE_OF_ORIGIN_ANNOTATION_FORMAT 

Constructor & Destructor Documentation

◆ IDRipper() [1/2]

IDRipper ( )

Default constructor.

◆ ~IDRipper()

~IDRipper ( )
override

Destructor.

◆ IDRipper() [2/2]

IDRipper ( const IDRipper rhs)
private

Copy constructor.

Member Function Documentation

◆ detectOriginAnnotationFormat_()

OriginAnnotationFormat detectOriginAnnotationFormat_ ( std::map< String, UInt > &  file_origin_map,
const std::vector< PeptideIdentification > &  peptide_idents 
)
private

helper function, detects file origin annotation standard from collections of protein and peptide hits

◆ getProteinAccessions_()

std::set<String> getProteinAccessions_ ( const std::vector< PeptideHit > &  peptide_hits)
private

helper function, returns the string representation of the peptide hit accession

◆ getProteinHits_()

void getProteinHits_ ( std::vector< ProteinHit > &  result,
const std::unordered_map< String, const ProteinHit * > &  acc2protein_hits,
const std::set< String > &  protein_accessions 
)
private

helper function, extracts all protein hits that match the protein accession

◆ getProteinIdentification_()

int getProteinIdentification_ ( const PeptideIdentification pep_ident,
const IdentificationRuns id_runs 
)
private

helper function, returns the index of the protein identification for the given peptide identification based on the same identifier using id_runs as lookup

◆ operator=()

IDRipper& operator= ( const IDRipper rhs)
private

Assignment.

◆ registerBasename_()

bool registerBasename_ ( std::map< String, std::pair< UInt, UInt > > &  basename_to_numeric,
const IDRipper::RipFileIdentifier rfi 
)
private

helper function, register a potential output file basename to detect duplicate output basenames

◆ rip() [1/2]

void rip ( RipFileMap ripped,
std::vector< ProteinIdentification > &  proteins,
std::vector< PeptideIdentification > &  peptides,
bool  numeric_filenames,
bool  split_ident_runs 
)

Ripping protein/peptide identification according their file origin.

Iteration over all PeptideIdentification. For each annotated file origin create a map entry and store the respective PeptideIdentification and ProteinIdentification.

Parameters
rippedContains the protein identification and peptide identification for each file origin annotated in proteins and peptides
proteinsProtein identification
peptidesPeptide identification annotated with file origin
numeric_filenamesIf false, deduce output files using basenames of origin annotations. Throws an exception if they are not unique. If true, assemble output files based on numerical IDs only.
split_ident_runsSplit identification runs into different files.

◆ rip() [2/2]

void rip ( std::vector< RipFileIdentifier > &  rfis,
std::vector< RipFileContent > &  rfcs,
std::vector< ProteinIdentification > &  proteins,
std::vector< PeptideIdentification > &  peptides,
bool  numeric_filenames,
bool  split_ident_runs 
)

Ripping protein/peptide identification according their file origin.

Iteration over all PeptideIdentification. For each annotated file origin create a map entry and store the respective PeptideIdentification and ProteinIdentification.

Parameters
rippedContains the protein identification and peptide identification for each file origin annotated in proteins and peptides
proteinsProtein identification
peptidesPeptide identification annotated with file origin
numeric_filenamesIf false, deduce output files using basenames of origin annotations. Throws an exception if they are not unique. If true, assemble output files based on numerical IDs only.
split_ident_runsSplit identification runs into different files.

◆ setOriginAnnotationMode_()

bool setOriginAnnotationMode_ ( short &  mode,
short const  new_value 
)
private

helper function, sets the value of mode to new_value and returns true if the old value was identical or unset (-1)

Member Data Documentation

◆ names_of_OriginAnnotationFormat

const std::array<std::string, SIZE_OF_ORIGIN_ANNOTATION_FORMAT> names_of_OriginAnnotationFormat
static

String representations for the OriginAnnotationFormat enum.