13 #include <unordered_map>
64 const std::map<String, UInt>& file_origin_map,
66 bool split_ident_runs);
95 RipFileContent(
const std::vector<ProteinIdentification>& prot_idents,
const std::vector<PeptideIdentification>& pep_idents)
96 : prot_idents(prot_idents), pep_idents(pep_idents) {}
104 typedef std::map<RipFileIdentifier, RipFileContent, RipFileIdentifierIdxComparator>
RipFileMap;
126 std::vector<ProteinIdentification>& proteins,
127 std::vector<PeptideIdentification>& peptides,
128 bool numeric_filenames,
129 bool split_ident_runs);
146 std::vector<RipFileIdentifier>& rfis,
147 std::vector<RipFileContent>& rfcs,
148 std::vector<ProteinIdentification>& proteins,
149 std::vector<PeptideIdentification>& peptides,
150 bool numeric_filenames,
151 bool split_ident_runs);
165 void getProteinHits_(std::vector<ProteinHit> & result,
const std::unordered_map<String, const ProteinHit*> & acc2protein_hits,
const std::set<String> & protein_accessions);
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
Ripping protein/peptide identification according their file origin.
Definition: IDRipper.h:29
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
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.
IDRipper()
Default constructor.
~IDRipper() override
Destructor.
static const std::array< std::string, SIZE_OF_ORIGIN_ANNOTATION_FORMAT > names_of_OriginAnnotationFormat
String representations for the OriginAnnotationFormat enum.
Definition: IDRipper.h:35
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
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
std::map< RipFileIdentifier, RipFileContent, RipFileIdentifierIdxComparator > RipFileMap
Represents the result of an IDRipper process, a map assigning file content to output file identifiers...
Definition: IDRipper.h:104
int getProteinIdentification_(const PeptideIdentification &pep_ident, const IdentificationRuns &id_runs)
helper function, returns the index of the protein identification for the given peptide identification...
OriginAnnotationFormat
Possible input file encodings for the origin as used by different versions of IDMerger.
Definition: IDRipper.h:32
IDRipper(const IDRipper &rhs)
Copy constructor.
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 ...
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.
IDRipper & operator=(const IDRipper &rhs)
Assignment.
std::set< String > getProteinAccessions_(const std::vector< PeptideHit > &peptide_hits)
helper function, returns the string representation of the peptide hit accession
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:39
A more convenient string class.
Definition: String.h:34
unsigned int UInt
Unsigned integer type.
Definition: Types.h:64
const std::string ID_MERGE_INDEX
Definition: Constants.h:307
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Represents a set of IdentificationRuns.
Definition: IDRipper.h:39
IdentificationRuns(const std::vector< ProteinIdentification > &prot_ids)
Generates a new IdentificationRuns object from a vector of ProteinIdentification objects.
std::vector< StringList > spectra_data
Maps the list of spectra data elements to every IdentificationRun index.
Definition: IDRipper.h:43
std::map< String, UInt > index_map
Maps a unique index to every IdentificationRun string representation (getIdentifier()).
Definition: IDRipper.h:41
Represents the content of an IDRipper output file.
Definition: IDRipper.h:89
const std::vector< ProteinIdentification > & getProteinIdentifications()
Get protein identifications.
std::vector< PeptideIdentification > pep_idents
Peptide identifications.
Definition: IDRipper.h:93
RipFileContent(const std::vector< ProteinIdentification > &prot_idents, const std::vector< PeptideIdentification > &pep_idents)
Constructs a new RipFileContent object.
Definition: IDRipper.h:95
const std::vector< PeptideIdentification > & getPeptideIdentifications()
Get peptide identifications.
std::vector< ProteinIdentification > prot_idents
Protein identifications.
Definition: IDRipper.h:91
Provides a 'less' operation for RipFileIdentifiers that ignores the out_basename and origin_fullname ...
Definition: IDRipper.h:83
bool operator()(const RipFileIdentifier &left, const RipFileIdentifier &right) const
Identifies an IDRipper output file.
Definition: IDRipper.h:51
RipFileIdentifier(const IDRipper::IdentificationRuns &id_runs, const PeptideIdentification &pep_id, const std::map< String, UInt > &file_origin_map, const IDRipper::OriginAnnotationFormat origin_annotation_fmt, bool split_ident_runs)
Constructs a new RipFileIdentifier object.
String out_basename
The output basename derived from the file_origin / spectra_data element.
Definition: IDRipper.h:57
const String & getOutputBasename() const
Get output base name.
const String & getOriginFullname() const
Get origin full name.
UInt getFileOriginIdx() const
Get file origin index.
String origin_fullname
The full length origin read from the file_origin / spectra_data element.
Definition: IDRipper.h:59
UInt getIdentRunIdx() const
Get identification run index.