OpenMS
Loading...
Searching...
No Matches
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.
 

Public Member Functions

 IDRipper ()
 Default constructor.
 
 ~IDRipper () override
 Destructor.
 
void rip (RipFileMap &ripped, std::vector< ProteinIdentification > &proteins, PeptideIdentificationList &peptides, bool numeric_filenames, bool split_ident_runs)
 Ripping protein/peptide identification according their file origin.
 
void rip (std::vector< RipFileIdentifier > &rfis, std::vector< RipFileContent > &rfcs, std::vector< ProteinIdentification > &proteins, PeptideIdentificationList &peptides, bool numeric_filenames, bool split_ident_runs)
 Ripping protein/peptide identification according their file origin.
 
- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages.
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor.
 
virtual ~DefaultParamHandler ()
 Destructor.
 
DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator.
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator.
 
void setParameters (const Param &param)
 Sets the parameters.
 
const ParamgetParameters () const
 Non-mutable access to the parameters.
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters.
 
const StringgetName () const
 Non-mutable access to the name.
 
void setName (const String &name)
 Mutable access to the name.
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections.
 

Static Public Attributes

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

Private Member Functions

 IDRipper (const IDRipper &rhs)
 Copy constructor.
 
IDRipperoperator= (const IDRipper &rhs)
 Assignment.
 
OriginAnnotationFormat detectOriginAnnotationFormat_ (std::map< String, UInt > &file_origin_map, const PeptideIdentificationList &peptide_idents)
 helper function, detects file origin annotation standard from collections of protein and peptide hits
 
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
 
std::set< StringgetProteinAccessions_ (const std::vector< PeptideHit > &peptide_hits)
 helper function, returns the string representation of the peptide hit accession
 
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
 
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
 
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)
 

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.
 
- 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.
 
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor.
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters.
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes!
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes!
 
String error_name_
 Name that is displayed in error messages during the parameter checking.
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;.
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;.
 

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 PeptideIdentificationList 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,
PeptideIdentificationList peptides,
bool  numeric_filenames,
bool  split_ident_runs 
)

Ripping protein/peptide identification according their file origin.

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

Parameters
[in]rippedContains the protein identification and peptide identification for each file origin annotated in proteins and peptides
[in]proteinsProtein identification
[in]peptidesPeptide identification annotated with file origin
[out]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.
[in]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,
PeptideIdentificationList peptides,
bool  numeric_filenames,
bool  split_ident_runs 
)

Ripping protein/peptide identification according their file origin.

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

Parameters
[out]rfisFile info relating to rfcs
[out]rfcsContains the protein identification and peptide identification for each file origin annotated in proteins and peptides
[in]proteinsProtein identification
[in]peptidesPeptide identification annotated with file origin
[out]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.
[in]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.