 |
OpenMS
3.0.0
|
|
Go to the documentation of this file.
37 #include <OpenMS/config.h>
54 #include <unordered_set>
101 template <
class HitType>
111 higher_score_better(higher_score_better_)
116 if (higher_score_better)
118 return hit.getScore() >= score;
120 return hit.getScore() <= score;
129 template <
class HitType>
141 throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
"The cut-off value for rank filtering must not be zero!");
147 Size hit_rank = hit.getRank();
152 return hit_rank <= rank;
161 template <
class HitType>
177 if (found.
isEmpty())
return false;
178 if (value.
isEmpty())
return true;
179 return found == value;
184 template <
class HitType>
200 if (found.
isEmpty())
return false;
201 return double(found) <= value;
206 template <
class HitType>
214 target_decoy(
"target_decoy",
"decoy"), is_decoy(
"isDecoy",
"true")
222 return target_decoy(hit) || is_decoy(hit);
231 template <
class HitType>
239 accessions(accessions_)
246 if (accessions.count(it) > 0)
return true;
267 template <
class HitType>
275 accessions(accessions_)
282 if (accessions.count(it) > 0)
return true;
303 template <
class HitType,
class Entry>
312 for(
typename std::vector<Entry>::iterator rec_it = records.begin();
313 rec_it != records.end(); ++rec_it)
315 items[getKey(*rec_it)] = &(*rec_it);
328 return items.count(getHitKey(hit)) > 0;
338 if(!exists(evidence)){
339 throw Exception::InvalidParameter(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
"Accession: '"+ getHitKey(evidence) +
"'. peptide evidence accession not in data");
341 return *(items.find(getHitKey(evidence))->second);
357 struct HasMinPeptideLength;
363 struct HasLowMZError;
370 struct HasMatchingModification;
377 struct HasMatchingSequence;
380 struct HasNoEvidence;
398 digestion_(digestion), min_cleavages_(min), max_cleavages_(max)
407 const auto& fun = [&](
const Int missed_cleavages)
410 bool max_filter = max_cleavages_ != disabledValue() ?
411 missed_cleavages > max_cleavages_ :
false;
412 bool min_filter = min_cleavages_ != disabledValue() ?
413 missed_cleavages < min_cleavages_ :
false;
414 return max_filter || min_filter;
423 hits.erase(std::remove_if(hits.begin(), hits.end(), (*this)),
447 bool ignore_missed_cleavages,
448 bool methionine_cleavage) :
449 accession_resolver_(entries),
450 digestion_(digestion),
451 ignore_missed_cleavages_(ignore_missed_cleavages),
452 methionine_cleavage_(methionine_cleavage)
463 if (accession_resolver_.
exists(evidence))
467 evidence.
getStart(), evidence.
getEnd() - evidence.
getStart(), ignore_missed_cleavages_, methionine_cleavage_);
473 OPENMS_LOG_WARN <<
"Peptide accession not available! Skipping Evidence." << std::endl;
478 <<
"' not found in fasta file!" << std::endl;
486 IDFilter::FilterPeptideEvidences<IDFilter::DigestionFilter>(*
this,peptides);
498 template <
class IdentificationType>
505 return id.getHits().empty();
532 template <
class Container,
class Predicate>
535 items.erase(std::remove_if(items.begin(), items.end(), pred),
540 template <
class Container,
class Predicate>
543 items.erase(std::remove_if(items.begin(), items.end(), std::not1(pred)),
548 template <
class Container,
class Predicate>
551 auto part = std::partition(items.begin(), items.end(), std::not1(pred));
552 std::move(part, items.end(), std::back_inserter(target));
553 items.erase(part, items.end());
557 template <
class IDContainer,
class Predicate>
560 for (
auto& item : items)
562 removeMatchingItems(item.getHits(), pred);
567 template <
class IDContainer,
class Predicate>
570 for (
auto& item : items)
572 keepMatchingItems(item.getHits(), pred);
576 template <
class MapType,
class Predicate>
579 for (
auto& feat : prot_and_pep_ids)
581 keepMatchingItemsUnroll(feat.getPeptideIdentifications(), pred);
583 keepMatchingItemsUnroll(prot_and_pep_ids.getUnassignedPeptideIdentifications(), pred);
586 template <
class MapType,
class Predicate>
589 for (
auto& feat : prot_and_pep_ids)
591 removeMatchingItemsUnroll(feat.getPeptideIdentifications(), pred);
593 removeMatchingItemsUnroll(prot_and_pep_ids.getUnassignedPeptideIdentifications(), pred);
596 template <
class MapType,
class Predicate>
599 for (
auto& feat : prot_and_pep_ids)
601 removeMatchingItems(feat.getPeptideIdentifications(), pred);
603 removeMatchingItems(prot_and_pep_ids.getUnassignedPeptideIdentifications(), pred);
613 template <
class IdentificationType>
617 for (
typename std::vector<IdentificationType>::const_iterator id_it =
618 ids.begin(); id_it != ids.end(); ++id_it)
620 counter += id_it->getHits().size();
638 template <
class IdentificationType>
640 const std::vector<IdentificationType>& identifications,
641 bool assume_sorted,
typename IdentificationType::HitType& best_hit)
643 if (identifications.empty())
return false;
645 typename std::vector<IdentificationType>::const_iterator best_id_it =
646 identifications.end();
647 typename std::vector<typename IdentificationType::HitType>::const_iterator
650 for (
typename std::vector<IdentificationType>::const_iterator id_it =
651 identifications.begin(); id_it != identifications.end(); ++id_it)
653 if (id_it->getHits().empty())
continue;
655 if (best_id_it == identifications.end())
658 best_hit_it = id_it->getHits().begin();
660 else if (best_id_it->getScoreType() != id_it->getScoreType())
662 throw Exception::InvalidValue(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
"Can't compare scores of different types", best_id_it->getScoreType() +
"/" + id_it->getScoreType());
665 bool higher_better = best_id_it->isHigherScoreBetter();
666 for (
typename std::vector<typename IdentificationType::HitType>::
667 const_iterator hit_it = id_it->getHits().begin(); hit_it !=
668 id_it->getHits().end(); ++hit_it)
670 if ((higher_better && (hit_it->getScore() >
671 best_hit_it->getScore())) ||
672 (!higher_better && (hit_it->getScore() <
673 best_hit_it->getScore())))
675 best_hit_it = hit_it;
677 if (assume_sorted)
break;
681 if (best_id_it == identifications.end())
686 best_hit = *best_hit_it;
697 static void extractPeptideSequences(
698 const std::vector<PeptideIdentification>& peptides,
699 std::set<String>& sequences,
bool ignore_mods =
false);
706 static std::map<String,std::vector<ProteinHit>> extractUnassignedProteins(
ConsensusMap& cmap);
713 template<
class Ev
idenceFilter>
715 EvidenceFilter& filter,
716 std::vector<PeptideIdentification>& peptides)
718 for(std::vector<PeptideIdentification>::iterator pep_it = peptides.begin();
719 pep_it != peptides.end(); ++pep_it)
721 for(std::vector<PeptideHit>::iterator hit_it = pep_it->getHits().begin();
722 hit_it != pep_it->getHits().end(); ++hit_it )
724 std::vector<PeptideEvidence> evidences;
725 remove_copy_if(hit_it->getPeptideEvidences().begin(),
726 hit_it->getPeptideEvidences().end(),
727 back_inserter(evidences),
729 hit_it->setPeptideEvidences(evidences);
741 template <
class IdentificationType>
744 for (
typename std::vector<IdentificationType>::iterator it = ids.begin();
745 it != ids.end(); ++it)
753 static void removeUnreferencedProteins(
ConsensusMap& cmap,
bool include_unassigned);
756 static void removeUnreferencedProteins(
757 std::vector<ProteinIdentification>& proteins,
758 const std::vector<PeptideIdentification>& peptides);
760 static void removeUnreferencedProteins(
762 const std::vector<PeptideIdentification>& peptides);
771 static void updateProteinReferences(
772 std::vector<PeptideIdentification>& peptides,
773 const std::vector<ProteinIdentification>& proteins,
774 bool remove_peptides_without_reference =
false);
783 static void updateProteinReferences(
785 bool remove_peptides_without_reference =
false);
794 static void updateProteinReferences(
797 bool remove_peptides_without_reference =
false);
807 static bool updateProteinGroups(
808 std::vector<ProteinIdentification::ProteinGroup>& groups,
809 const std::vector<ProteinHit>& hits);
817 static void removeUngroupedProteins(
818 const std::vector<ProteinIdentification::ProteinGroup>& groups,
819 std::vector<ProteinHit>& hits);
827 template <
class IdentificationType>
830 struct HasNoHits<IdentificationType> empty_filter;
831 removeMatchingItems(ids, empty_filter);
839 template <
class IdentificationType>
841 double threshold_score)
843 for (
typename std::vector<IdentificationType>::iterator id_it =
844 ids.begin(); id_it != ids.end(); ++id_it)
846 struct HasGoodScore<typename IdentificationType::HitType> score_filter(
847 threshold_score, id_it->isHigherScoreBetter());
848 keepMatchingItems(id_it->getHits(), score_filter);
858 static void filterGroupsByScore(std::vector<ProteinIdentification::ProteinGroup>& grps,
859 double threshold_score, bool higher_better);
866 template <class IdentificationType>
867 static void filterHitsByScore(IdentificationType& id,
868 double threshold_score)
870 struct HasGoodScore<typename IdentificationType::HitType> score_filter(
871 threshold_score, id->isHigherScoreBetter());
872 keepMatchingItems(id->getHits(), score_filter);
880 template <class IdentificationType>
881 static void keepNBestHits(std::vector<IdentificationType>& ids, Size n)
883 for (
typename std::vector<IdentificationType>::iterator id_it =
884 ids.begin(); id_it != ids.end(); ++id_it)
887 if (n < id_it->getHits().size()) id_it->getHits().resize(n);
905 template <
class IdentificationType>
912 struct HasMaxRank<typename IdentificationType::HitType>
913 rank_filter(min_rank - 1);
914 for (typename std::vector<IdentificationType>::iterator id_it =
915 ids.begin(); id_it != ids.end(); ++id_it)
917 removeMatchingItems(id_it->getHits(), rank_filter);
920 if (max_rank >= min_rank)
922 struct HasMaxRank<typename IdentificationType::HitType>
923 rank_filter(max_rank);
924 for (typename std::vector<IdentificationType>::iterator id_it =
925 ids.begin(); id_it != ids.end(); ++id_it)
927 keepMatchingItems(id_it->getHits(), rank_filter);
939 template <
class IdentificationType>
944 for (typename std::vector<IdentificationType>::iterator id_it =
945 ids.begin(); id_it != ids.end(); ++id_it)
947 removeMatchingItems(id_it->getHits(), decoy_filter);
958 template <
class IdentificationType>
960 const std::set<String> accessions)
963 for (auto& id_it : ids)
965 removeMatchingItems(id_it.getHits(), acc_filter);
976 template <
class IdentificationType>
978 const std::set<String>& accessions)
981 for (auto& id_it : ids)
983 keepMatchingItems(id_it.getHits(), acc_filter);
999 static void keepBestPeptideHits(
1000 std::vector<PeptideIdentification>& peptides,
bool strict =
false);
1010 static void filterPeptidesByLength(
1011 std::vector<PeptideIdentification>& peptides,
Size min_length,
1012 Size max_length = UINT_MAX);
1022 static void filterPeptidesByCharge(
1023 std::vector<PeptideIdentification>& peptides,
Int min_charge,
1027 static void filterPeptidesByRT(std::vector<PeptideIdentification>& peptides,
1028 double min_rt,
double max_rt);
1031 static void filterPeptidesByMZ(std::vector<PeptideIdentification>& peptides,
1032 double min_mz,
double max_mz);
1045 static void filterPeptidesByMZError(
1046 std::vector<PeptideIdentification>& peptides,
double mass_error,
1056 template <
class Filter>
1057 static void filterPeptideEvidences(
1059 std::vector<PeptideIdentification>& peptides);
1072 static void filterPeptidesByRTPredictPValue(
1073 std::vector<PeptideIdentification>& peptides,
1074 const String& metavalue_key,
double threshold = 0.05);
1077 static void removePeptidesWithMatchingModifications(
1078 std::vector<PeptideIdentification>& peptides,
1079 const std::set<String>& modifications);
1081 static void removePeptidesWithMatchingRegEx(
1082 std::vector<PeptideIdentification>& peptides,
1086 static void keepPeptidesWithMatchingModifications(
1087 std::vector<PeptideIdentification>& peptides,
1088 const std::set<String>& modifications);
1097 static void removePeptidesWithMatchingSequences(
1098 std::vector<PeptideIdentification>& peptides,
1099 const std::vector<PeptideIdentification>& bad_peptides,
1100 bool ignore_mods =
false);
1109 static void keepPeptidesWithMatchingSequences(
1110 std::vector<PeptideIdentification>& peptides,
1111 const std::vector<PeptideIdentification>& good_peptides,
1112 bool ignore_mods =
false);
1115 static void keepUniquePeptidesPerProtein(std::vector<PeptideIdentification>&
1123 static void removeDuplicatePeptideHits(std::vector<PeptideIdentification>&
1124 peptides,
bool seq_only =
false);
1134 double peptide_threshold_score,
1135 double protein_threshold_score)
1139 protein_threshold_score);
1145 exp_it != experiment.
end(); ++exp_it)
1147 filterHitsByScore(exp_it->getPeptideIdentifications(),
1148 peptide_threshold_score);
1149 removeEmptyIdentifications(exp_it->getPeptideIdentifications());
1150 updateProteinReferences(exp_it->getPeptideIdentifications(),
1161 std::vector<PeptideIdentification> all_peptides;
1165 exp_it != experiment.
end(); ++exp_it)
1167 std::vector<PeptideIdentification>& peptides =
1168 exp_it->getPeptideIdentifications();
1169 keepNBestHits(peptides, n);
1170 removeEmptyIdentifications(peptides);
1171 updateProteinReferences(peptides,
1173 all_peptides.insert(all_peptides.end(), peptides.begin(),
1183 static void keepNBestSpectra(std::vector<PeptideIdentification>& peptides,
Size n);
1186 template <
class MapType>
1191 for (
auto& feat : map)
1193 keepNBestHits(feat.getPeptideIdentifications(), n);
1195 keepNBestHits(map.getUnassignedPeptideIdentifications(), n);
1198 template <
class MapType>
1202 removeMatchingPeptideIdentifications(prot_and_pep_ids, pred);
1206 static void keepBestPerPeptide(std::vector<PeptideIdentification>& pep_ids,
bool ignore_mods,
bool ignore_charges,
Size nr_best_spectrum)
1208 annotateBestPerPeptide(pep_ids, ignore_mods, ignore_charges, nr_best_spectrum);
1210 keepMatchingItemsUnroll(pep_ids, best_per_peptide);
1213 static void keepBestPerPeptidePerRun(std::vector<ProteinIdentification>& prot_ids, std::vector<PeptideIdentification>& pep_ids,
bool ignore_mods,
bool ignore_charges,
Size nr_best_spectrum)
1215 annotateBestPerPeptidePerRun(prot_ids, pep_ids, ignore_mods, ignore_charges, nr_best_spectrum);
1217 keepMatchingItemsUnroll(pep_ids, best_per_peptide);
1221 template <
class MapType>
1227 for (
const auto& idrun : prot_ids)
1232 for (
auto& feat : prot_and_pep_ids)
1234 annotateBestPerPeptidePerRunWithData(best_peps_per_run, feat.getPeptideIdentifications(), ignore_mods, ignore_charges, nr_best_spectrum);
1237 annotateBestPerPeptidePerRunWithData(best_peps_per_run, prot_and_pep_ids.getUnassignedPeptideIdentifications(), ignore_mods, ignore_charges, nr_best_spectrum);
1240 template <
class MapType>
1243 annotateBestPerPeptidePerRun(prot_and_pep_ids, ignore_mods, ignore_charges, nr_best_spectrum);
1245 keepMatchingPeptideHits(prot_and_pep_ids, best_per_peptide);
1250 static void annotateBestPerPeptidePerRun(
const std::vector<ProteinIdentification>& prot_ids, std::vector<PeptideIdentification>& pep_ids,
bool ignore_mods,
bool ignore_charges,
Size nr_best_spectrum)
1253 for (
const auto&
id : prot_ids)
1257 annotateBestPerPeptidePerRunWithData(best_peps_per_run, pep_ids, ignore_mods, ignore_charges, nr_best_spectrum);
1265 for (
auto &pep : pep_ids)
1268 annotateBestPerPeptideWithData(best_pep, pep, ignore_mods, ignore_charges, nr_best_spectrum);
1278 for (
auto& pep : pep_ids)
1280 annotateBestPerPeptideWithData(best_pep, pep, ignore_mods, ignore_charges, nr_best_spectrum);
1294 auto pepIt = pep.
getHits().begin();
1295 auto pepItEnd = nr_best_spectrum == 0 || pep.
getHits().size() <= nr_best_spectrum ? pep.
getHits().end() : pep.
getHits().begin() + nr_best_spectrum;
1296 for (; pepIt != pepItEnd; ++pepIt)
1310 int lookup_charge = 0;
1311 if (!ignore_charges)
1317 auto it_inserted = best_pep.emplace(std::move(lookup_seq),
ChargeToPepHitP());
1318 auto it_inserted_chg = it_inserted.first->second.emplace(lookup_charge, &hit);
1320 PeptideHit* &p = it_inserted_chg.first->second;
1321 if (!it_inserted_chg.second)
1348 const std::vector<FASTAFile::FASTAEntry>& proteins)
1350 std::set<String> accessions;
1351 for (std::vector<FASTAFile::FASTAEntry>::const_iterator it =
1352 proteins.begin(); it != proteins.end(); ++it)
1354 accessions.insert(it->identifier);
1364 exp_it != experiment.
end(); ++exp_it)
1366 if (exp_it->getMSLevel() == 2)
1368 keepHitsMatchingProteins(exp_it->getPeptideIdentifications(),
1370 removeEmptyIdentifications(exp_it->getPeptideIdentifications());
1371 updateHitRanks(exp_it->getPeptideIdentifications());
1391 template <
typename PredicateType>
1396 if (cleanup_affected) id_data.
cleanup();
1409 static void keepBestMatchPerObservation(
1424 static void filterObservationMatchesByScore(
OpenMS identification format (.idXML)
Definition: FileTypes.h:64
static bool split(const String &this_s, const char splitter, std::vector< String > &substrings, bool quote_protect)
Definition: StringUtilsSimple.h:360
Int getCharge() const
returns the charge of the peptide
HasGoodScore(double score_, bool higher_score_better_)
Definition: IDFilter.h:109
Base class for TOPP applications.
Definition: TOPPBase.h:147
void store(const String &filename, const std::vector< ProteinIdentification > &poid, const std::vector< PeptideIdentification > &peid) const
Stores the identifications in a MzIdentML file.
Used to load (storing not supported, yet) ProtXML files.
Definition: ProtXMLFile.h:70
static void removeMatchingItems(Container &items, const Predicate &pred)
Remove items that satisfy a condition from a container (e.g. vector)
Definition: IDFilter.h:533
Representation of a Sequest output file.
Definition: SequestOutfile.h:61
ConstIterator end() const
Gives access to the underlying text buffer.
integer list
Definition: DataValue.h:73
void load(const String &filename, ProteinIdentification &protein_identification, std::vector< PeptideIdentification > &id_data, ModificationDefinitionsSet &mod_def_set)
loads data from an X! Tandem XML file
Used to load Mascot XML files.
Definition: MascotXMLFile.h:57
static const std::string NamesOfSpecificity[SIZE_OF_SPECIFICITY]
Names of the Specificity.
Definition: EnzymaticDigestion.h:81
Definition: PercolatorOutfile.h:58
static void keepUniquePeptidesPerProtein(std::vector< PeptideIdentification > &peptides)
Removes all peptides that are not annotated as unique for a protein (by PeptideIndexer)
static void keepBestPerPeptidePerRun(MapType &prot_and_pep_ids, bool ignore_mods, bool ignore_charges, Size nr_best_spectrum)
Definition: IDFilter.h:1241
static void keepNBestSpectra(std::vector< PeptideIdentification > &peptides, Size n)
This class supports reading and writing of OMS files.
Definition: OMSFile.h:48
void load(const String &filename, ProteinIdentification &protein_ids, PeptideIdentification &peptide_ids)
Loads the identifications of an ProtXML file without identifier.
void store(const String &filename, const ConsensusMap &consensus_map)
Stores a consensus map to file.
const std::string & toString(const DriftTimeUnit value)
EnzymaticDigestion & digestion_
Definition: IDFilter.h:391
void setValue(const std::string &key, const ParamValue &value, const std::string &description="", const std::vector< std::string > &tags=std::vector< std::string >())
Sets a value.
static void keepNBestHits(std::vector< IdentificationType > &ids, Size n)
Filters peptide or protein identifications according to the score of the hits, keeping the n best hit...
Definition: IDFilter.h:881
A method or algorithm argument contains illegal values.
Definition: Exception.h:648
Definition: MathFunctions.h:363
string value
Definition: DataValue.h:69
void store(const String &filename, const std::vector< ProteinIdentification > &protein_ids, const std::vector< PeptideIdentification > &peptide_ids, const String &document_id="")
Stores the data in an idXML file.
static const std::string score_type_names[SIZE_OF_SCORETYPE]
Names of Percolator scores (to match ScoreType)
Definition: PercolatorOutfile.h:61
const AASequence & getSequence() const
returns the peptide sequence without trailing or following spaces
bool operator()(const HitType &hit) const
Definition: IDFilter.h:145
void setEnzyme(const String &name)
Sets the enzyme for the digestion (by name)
static void moveMatchingItems(Container &items, const Predicate &pred, Container &target)
Move items that satisfy a condition to a container (e.g. vector)
Definition: IDFilter.h:549
bool operator()(const HitType &hit) const
Definition: IDFilter.h:114
IdentificationType argument_type
Definition: IDFilter.h:501
static void keepHitsMatchingProteins(std::vector< IdentificationType > &ids, const std::set< String > &accessions)
Filters peptide or protein identifications according to the given proteins (positive).
Definition: IDFilter.h:977
double score
Definition: IDFilter.h:106
String identifier
Definition: FASTAFile.h:73
static InstanceType * getInstance()
this member function serves as a replacement of the constructor
Definition: DigestionEnzymeDB.h:69
Invalid UInt exception.
Definition: Exception.h:295
Representation of a set of modification definitions.
Definition: ModificationDefinitionsSet.h:58
static void removeHitsMatchingProteins(std::vector< IdentificationType > &ids, const std::set< String > accessions)
Filters peptide or protein identifications according to the given proteins (negative).
Definition: IDFilter.h:959
const String & getHitKey(const PeptideEvidence &p) const
Definition: IDFilter.h:331
Invalid value exception.
Definition: Exception.h:327
bool operator()(PeptideHit &p) const
Definition: IDFilter.h:405
This class serves for reading in and writing FASTA files If the protein/gene sequence contains unusua...
Definition: FASTAFile.h:60
static FileTypes::Type getTypeByFileName(const String &filename)
Determines the file type from a file name.
void store(const String &filename, const PeakMap &map) const
Stores a map in an MzML file.
static void filterPeptidesByMZ(std::vector< PeptideIdentification > &peptides, double min_mz, double max_mz)
Filters peptide identifications by precursor m/z, keeping only IDs in the given range.
double toDouble() const
Conversion to double.
const double k
Definition: Constants.h:153
MzML file (.mzML)
Definition: FileTypes.h:70
String sequence
Definition: FASTAFile.h:75
TPP pepXML file (.pepXML)
Definition: FileTypes.h:73
string list
Definition: DataValue.h:72
void setSearchEngineVersion(const String &search_engine_version)
Sets the search engine version.
void load(const String &filename, std::vector< PeptideIdentification > &pep_ids, std::vector< ProteinIdentification > &prot_ids)
Load the content of the xquest.xml file into the provided data structures.
File adapter for MzML files.
Definition: MzMLFile.h:57
A more convenient string class.
Definition: String.h:58
Iterator begin()
Definition: MSExperiment.h:150
PeptideHit argument_type
Definition: IDFilter.h:396
std::map< std::string, SequenceToChargeToPepHitP > RunToSequenceToChargeToPepHitP
Definition: IDFilter.h:91
bool exists(const HitType &hit) const
Definition: IDFilter.h:326
Class for the enzymatic digestion of sequences.
Definition: EnzymaticDigestion.h:66
String & trim()
removes whitespaces (space, tab, line feed, carriage return) at the beginning and the end of the stri...
bool isEmpty() const
Test if the value is empty.
Definition: DataValue.h:388
Used to load OMSSAXML files.
Definition: OMSSAXMLFile.h:59
HasMatchingAccession(const std::set< String > &accessions_)
Definition: IDFilter.h:274
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:70
OpenMS consensus map format (.consensusXML)
Definition: FileTypes.h:65
Invalid conversion exception.
Definition: Exception.h:354
static void updateProteinReferences(std::vector< PeptideIdentification > &peptides, const std::vector< ProteinIdentification > &proteins, bool remove_peptides_without_reference=false)
Removes references to missing proteins.
This class provides some basic file handling methods for text files.
Definition: TextFile.h:46
bool operator()(const PeptideEvidence &evidence) const
Definition: IDFilter.h:455
String description
Definition: FASTAFile.h:74
void addMSLevel(int level)
adds a desired MS level for peaks to load
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Representation of a protein hit.
Definition: ProteinHit.h:58
Size rank
Definition: IDFilter.h:134
void load(const String &filename, ProteinIdentification &proteins, std::vector< PeptideIdentification > &peptides, SpectrumMetaDataLookup &lookup, enum ScoreType output_score=QVALUE)
Loads a Percolator output file.
bool operator()(const ProteinHit &hit) const
Definition: IDFilter.h:287
static bool updateProteinGroups(std::vector< ProteinIdentification::ProteinGroup > &groups, const std::vector< ProteinHit > &hits)
Update protein groups after protein hits were filtered.
any TSV file, for example msInspect file or OpenSWATH transition file (see TransitionTSVFile)
Definition: FileTypes.h:86
empty
Definition: DataValue.h:75
GetMatchingItems()
Definition: IDFilter.h:319
int exception
(Used by various macros. Indicates a rough category of the exception being caught....
ScoreType
Types of Percolator scores.
Definition: PercolatorOutfile.h:58
String toString() const
returns the peptide as string with modifications embedded in brackets
mzIdentML (HUPO PSI AnalysisXML followup format) (.mzid)
Definition: FileTypes.h:75
void startProgress(SignedSize begin, SignedSize end, const String &label) const
Initializes the progress display.
static Int disabledValue()
Definition: IDFilter.h:401
String toUnmodifiedString() const
returns the peptide as string without any modifications or (e.g., "PEPTIDER")
GetMatchingItems(std::vector< Entry > &records)
Definition: IDFilter.h:310
#define OPENMS_PRECONDITION(condition, message)
Precondition macro.
Definition: openms/include/OpenMS/CONCEPT/Macros.h:120
PeakFileOptions & getOptions()
Mutable access to the options for loading/storing.
Class for reading Percolator tab-delimited output files.
Definition: PercolatorOutfile.h:52
PeptideEvidence argument_type
Definition: IDFilter.h:437
Unknown file extension.
Definition: FileTypes.h:58
#define OPENMS_LOG_WARN
Macro if a warning, a piece of information which should be read by the user, should be logged.
Definition: LogStream.h:460
static Specificity getSpecificityByName(const String &name)
FASTA file (.fasta)
Definition: FileTypes.h:91
Representation of a protein identification run.
Definition: ProteinIdentification.h:70
void endProgress() const
Ends the progress display.
static void keepPeptidesWithMatchingModifications(std::vector< PeptideIdentification > &peptides, const std::set< String > &modifications)
Keeps only peptide hits that have at least one of the given modifications.
FASTA entry type (identifier, description and sequence) The first String corresponds to the identifie...
Definition: FASTAFile.h:71
bool operator()(const PeptideEvidence &evidence) const
Definition: IDFilter.h:256
static void filterHitsByRank(std::vector< IdentificationType > &ids, Size min_rank, Size max_rank)
Filters peptide or protein identifications according to the ranking of the hits.
Definition: IDFilter.h:906
static void removePeptidesWithMatchingRegEx(std::vector< PeptideIdentification > &peptides, const String ®ex)
bool filterByMissedCleavages(const String &sequence, const std::function< bool(const Int)> &filter) const
Filter based on the number of missed cleavages.
void setMissedCleavages(Size missed_cleavages)
Sets the number of missed cleavages for the digestion (default is 0). This setting is ignored when lo...
static void removeMatchingItemsUnroll(IDContainer &items, const Predicate &pred)
Remove Hit items that satisfy a condition in one of our ID containers (e.g. vector of Peptide or Prot...
Definition: IDFilter.h:558
HasMatchingAccessionUnordered(const std::unordered_set< String > &accessions_)
Definition: IDFilter.h:238
Size size() const
Definition: MSExperiment.h:120
const std::vector< ProteinIdentification > & getProteinIdentifications() const
returns a const reference to the protein ProteinIdentification vector
void setHits(const std::vector< PeptideHit > &hits)
Sets the peptide hits.
fully enzyme specific, e.g., tryptic (ends with KR, AA-before is KR), or peptide is at protein termin...
Definition: EnzymaticDigestion.h:74
const std::vector< PeptideHit > & getHits() const
returns the peptide hits as const
Given a list of protein accessions, do any occur in the annotation(s) of this hit?
Definition: IDFilter.h:268
std::map< String, Entry * > ItemMap
Definition: IDFilter.h:307
void load(const String &filename, std::vector< ProteinIdentification > &protein_ids, std::vector< PeptideIdentification > &peptide_ids)
Loads the identifications of an idXML file without identifier.
void load(const String &result_filename, std::vector< PeptideIdentification > &peptide_identifications, ProteinIdentification &protein_identification, const double p_value_threshold, std::vector< double > &pvalues, const String &database="", const bool ignore_proteins_per_peptide=false)
loads data from a Sequest outfile
Exception indicating that an invalid parameter was handed over to an algorithm.
Definition: Exception.h:339
static String concatenate(const std::vector< T > &container, const String &glue="")
Concatenates all elements of the container and puts the glue string between elements.
Definition: ListUtils.h:209
static void keepMatchingItems(Container &items, const Predicate &pred)
Keep items that satisfy a condition in a container (e.g. vector), removing all others.
Definition: IDFilter.h:541
bool operator()(const HitType &hit) const
Definition: IDFilter.h:217
static ModificationsDB * getInstance()
Returns a pointer to the modifications DB (singleton)
bool operator()(const ProteinHit &hit) const
Definition: IDFilter.h:251
Aligns the peaks of two sorted spectra Method 1: Using a banded (width via 'tolerance' parameter) ali...
Definition: SpectrumAlignment.h:67
const std::set< String > & accessions
Definition: IDFilter.h:272
static enum ScoreType getScoreType(String score_type_name)
Return a score type given its name.
bool methionine_cleavage_
Definition: IDFilter.h:443
File adapter for MzIdentML files.
Definition: MzIdentMLFile.h:67
int Int
Signed integer type.
Definition: Types.h:102
static void removeDuplicatePeptideHits(std::vector< PeptideIdentification > &peptides, bool seq_only=false)
Removes duplicate peptide hits from each peptide identification, keeping only unique hits (per ID).
const String & getAccession() const
returns the accession of the protein
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
std::vector< SpectrumType >::iterator Iterator
Mutable iterator.
Definition: MSExperiment.h:104
static void filterPeptidesByLength(std::vector< PeptideIdentification > &peptides, Size min_length, Size max_length=UINT_MAX)
Filters peptide identifications according to peptide sequence length.
void filterPeptideSequences(std::vector< PeptideHit > &hits)
Definition: IDFilter.h:421
void addSpectrum(const MSSpectrum &spectrum)
adds a spectrum to the list
HitType argument_type
Definition: IDFilter.h:270
Used to load and store xQuest result files.
Definition: XQuestResultXMLFile.h:55
static void removeUnreferencedProteins(ConsensusMap &cmap, bool include_unassigned)
HasMaxRank(Size rank_)
Definition: IDFilter.h:136
integer value
Definition: DataValue.h:70
std::vector< String > variable_modifications
Allowed variable modifications.
Definition: ProteinIdentification.h:267
const std::string CONCAT_PEPTIDE
Definition: Constants.h:261
std::unordered_map< std::string, ChargeToPepHitP > SequenceToChargeToPepHitP
Definition: IDFilter.h:90
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:52
void load(const String &filename, ProteinIdentification &protein_identification, std::vector< PeptideIdentification > &id_data, const SpectrumMetaDataLookup &lookup)
Loads data from a Mascot XML file.
void sort()
Sorts the hits by score.
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition: DataValue.h:58
Size findByNativeID(const String &native_id) const
Look up spectrum by native ID.
static void annotateBestPerPeptide(std::vector< PeptideIdentification > &pep_ids, bool ignore_mods, bool ignore_charges, Size nr_best_spectrum)
Definition: IDFilter.h:1275
static void removeFromSetIf_(ContainerType &container, PredicateType predicate)
Remove elements from a set (or ordered multi_index_container) if they fulfill a predicate.
Definition: IdentificationData.h:837
const String & getKey(const FASTAFile::FASTAEntry &entry) const
Definition: IDFilter.h:321
static void filterPeptidesByRTPredictPValue(std::vector< PeptideIdentification > &peptides, const String &metavalue_key, double threshold=0.05)
Filters peptide identifications according to p-values from RTPredict.
bool hasValidLimits() const
start and end numbers in evidence represent actual numeric indices
HitType argument_type
Definition: IDFilter.h:234
static void annotateBestPerPeptideWithData(SequenceToChargeToPepHitP &best_pep, PeptideIdentification &pep, bool ignore_mods, bool ignore_charges, Size nr_best_spectrum)
Definition: IDFilter.h:1288
static void keepNBestHits(PeakMap &experiment, Size n)
Filters an MS/MS experiment by keeping the N best peptide hits for every spectrum.
Definition: IDFilter.h:1157
static bool isDirectory(const String &path)
Return true if the given path specifies a directory.
Facilitates file handling by file type recognition.
Definition: FileHandler.h:66
Helper class for looking up spectra based on different attributes.
Definition: SpectrumLookup.h:67
void addIonMatchStatistics(PeptideIdentification &pi, MSSpectrum &spec, const TheoreticalSpectrumGenerator &tg, const SpectrumAlignment &sa) const
Adds ion match statistics to pi PeptideIdentifcation.
static void keepBestPeptideHits(std::vector< PeptideIdentification > &peptides, bool strict=false)
Filters peptide identifications keeping only the single best-scoring hit per ID.
Collection of functions for filtering peptide and protein identifications.
Definition: IDFilter.h:78
Wrapper that adds operator< to iterators, so they can be used as (part of) keys in maps/sets or multi...
Definition: MetaData.h:45
bool loadExperiment(const String &filename, MSExperiment &exp, FileTypes::Type force_type=FileTypes::UNKNOWN, ProgressLogger::LogType log=ProgressLogger::NONE, const bool rewrite_source_file=true, const bool compute_hash=true)
Loads a file into an MSExperiment.
HitType argument_type
Definition: IDFilter.h:306
Type
Actual file types enum.
Definition: FileTypes.h:56
Representation of a peptide evidence.
Definition: PeptideEvidence.h:50
xQuest XML file format for protein-protein cross-link identifications (.xquest.xml)
Definition: FileTypes.h:110
static void filterPeptidesByCharge(std::vector< PeptideIdentification > &peptides, Int min_charge, Int max_charge)
Filters peptide identifications according to charge state.
void readSpectra(const SpectrumContainer &spectra, const String &scan_regexp=default_scan_regexp)
Read and index spectra for later look-up.
Definition: SpectrumLookup.h:103
HitType argument_type
Definition: IDFilter.h:209
static void filterPeptidesByRT(std::vector< PeptideIdentification > &peptides, double min_rt, double max_rt)
Filters peptide identifications by precursor RT, keeping only IDs in the given range.
void addReferenceFormat(const String ®exp)
Register a possible format for a spectrum reference.
void filterPeptideEvidences(std::vector< PeptideIdentification > &peptides)
Definition: IDFilter.h:484
void store(const String &filename, std::vector< ProteinIdentification > &protein_ids, std::vector< PeptideIdentification > &peptide_ids, const String &mz_file="", const String &mz_name="", bool peptideprophet_analyzed=false, double rt_tolerance=0.01)
Stores idXML as PepXML file.
static FileTypes::Type getConsistentOutputfileType(const String &output_filename, const String &requested_type)
Useful function for TOPP tools which have an 'out_type' parameter and want to know what output format...
static FileTypes::Type getType(const String &filename)
Tries to determine the file type (by name or content)
static void updateHitRanks(std::vector< IdentificationType > &ids)
Updates the hit ranks on all peptide or protein IDs.
Definition: IDFilter.h:742
void store(const String &filename, const IdentificationData &id_data)
Write out an IdentificationData object to SQL-based OMS file.
const Entry & getValue(const PeptideEvidence &evidence) const
Definition: IDFilter.h:336
Size digest(const AASequence &protein, std::vector< AASequence > &output, Size min_length=1, Size max_length=0) const
: Performs the enzymatic digestion of a protein.
static void importIDs(IdentificationData &id_data, const std::vector< ProteinIdentification > &proteins, const std::vector< PeptideIdentification > &peptides)
Import from legacy peptide/protein identifications.
void setParameters(const Param ¶m)
Sets the parameters.
static void keepPeptidesWithMatchingSequences(std::vector< PeptideIdentification > &peptides, const std::vector< PeptideIdentification > &good_peptides, bool ignore_mods=false)
Removes all peptide hits with a sequence that does not match one in good_peptides.
bool operator()(const PeptideEvidence &evidence) const
Definition: IDFilter.h:292
void writeNext(const FASTAEntry &protein)
Stores the data given by protein. Call writeStart() once before calling writeNext()....
const Param & getDefaults() const
Non-mutable access to the default parameters.
HasDecoyAnnotation()
Definition: IDFilter.h:213
std::vector< String >::iterator Iterator
Mutable iterator.
Definition: TextFile.h:54
Mascot XML file format for peptide identifications (.xml)
Definition: FileTypes.h:83
HitType argument_type
Definition: IDFilter.h:132
virtual void getSpectrum(PeakSpectrum &spec, const AASequence &peptide, Int min_charge, Int max_charge, Int precursor_charge=0) const
std::set< String > extractProteinAccessionsSet() const
extracts the set of non-empty protein accessions from peptide evidences
DataType valueType() const
returns the type of value stored
Definition: DataValue.h:378
static Size countHits(const std::vector< IdentificationType > &ids)
Returns the total number of peptide/protein hits in a vector of peptide/protein identifications.
Definition: IDFilter.h:614
OMSSA XML file format for peptide identifications (.xml)
Definition: FileTypes.h:82
A container for consensus elements.
Definition: ConsensusMap.h:82
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
bool higher_score_better
Definition: IDFilter.h:107
void load(const String &filename, ConsensusMap &map)
Loads a consensus map from file and calls updateRanges.
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
static const DataValue EMPTY
Empty data value for comparisons.
Definition: DataValue.h:64
void writeStart(const String &filename)
Prepares a FASTA file given by 'filename' for streamed writing using writeNext().
void setSequence(const AASequence &sequence)
sets the peptide sequence
double value
Definition: DataValue.h:71
void load(const String &filename, std::vector< ProteinIdentification > &poid, std::vector< PeptideIdentification > &peid)
Loads the identifications from a MzIdentML file.
TPP protXML file (.protXML)
Definition: FileTypes.h:74
bool isValidProduct(const String &protein, int pep_pos, int pep_length, bool ignore_missed_cleavages=true, bool allow_nterm_protein_cleavage=false, bool allow_random_asp_pro_cleavage=false) const
Variant of EnzymaticDigestion::isValidProduct() with support for n-term protein cleavage and random D...
static void annotateBestPerPeptidePerRun(const std::vector< ProteinIdentification > &prot_ids, std::vector< PeptideIdentification > &pep_ids, bool ignore_mods, bool ignore_charges, Size nr_best_spectrum)
Definition: IDFilter.h:1250
static void annotateBestPerPeptidePerRun(MapType &prot_and_pep_ids, bool ignore_mods, bool ignore_charges, Size nr_best_spectrum)
Definition: IDFilter.h:1222
Builds a map index of data that have a String index to find matches and return the objects.
Definition: IDFilter.h:304
std::string toString(bool full_precision=true) const
Convert ParamValue to string.
static void keepMatchingPeptideHits(MapType &prot_and_pep_ids, Predicate &pred)
Definition: IDFilter.h:577
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:71
static void initializeLookup(SpectrumMetaDataLookup &lookup, const PeakMap &experiment, const String &scan_regex="")
Initializes a helper object for looking up spectrum meta data (RT, m/z)
bool ignore_missed_cleavages_
Definition: IDFilter.h:442
void setSearchEngine(const String &search_engine)
Sets the search engine type.
Is peptide evidence digestion product of some protein.
Definition: IDFilter.h:435
ConstIterator begin() const
Gives access to the underlying text buffer.
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:134
Generates theoretical spectra for peptides with various options.
Definition: TheoreticalSpectrumGenerator.h:68
static void exportIDs(const IdentificationData &id_data, std::vector< ProteinIdentification > &proteins, std::vector< PeptideIdentification > &peptides, bool export_ids_wo_scores=false)
Export to legacy peptide/protein identifications.
ItemMap items
Definition: IDFilter.h:308
Representation of spectrum identification results and associated data.
Definition: IdentificationData.h:94
Int getStart() const
get the position in the protein (starting at 0 for the N-terminus). If not available UNKNOWN_POSITION...
String getEnzymeName() const
Returns the enzyme for the digestion.
static void keepMatchingItemsUnroll(IDContainer &items, const Predicate &pred)
Keep Hit items that satisfy a condition in one of our ID containers (e.g. vector of Peptide or Protei...
Definition: IDFilter.h:568
#define OPENMS_LOG_ERROR
Macro to be used if non-fatal error are reported (processing continues)
Definition: LogStream.h:455
static String absolutePath(const String &file)
Replaces the relative path in the argument with the absolute path.
static void keepBestPerPeptide(std::vector< PeptideIdentification > &pep_ids, bool ignore_mods, bool ignore_charges, Size nr_best_spectrum)
Filters PeptideHits from PeptideIdentification by keeping only the best peptide hits for every peptid...
Definition: IDFilter.h:1206
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:63
Parse Error exception.
Definition: Exception.h:622
static void removeMatchingPeptideIdentifications(MapType &prot_and_pep_ids, Predicate &pred)
Definition: IDFilter.h:597
Param copy(const std::string &prefix, bool remove_prefix=false) const
Returns a new Param object containing all entries that start with prefix.
Is the list of hits of this peptide/protein ID empty?
Definition: IDFilter.h:499
Class for the enzymatic digestion of proteins.
Definition: ProteaseDigestion.h:59
static std::vector< PeptideHit > getReferencingHits(const std::vector< PeptideHit > &, const std::set< String > &accession)
returns all peptide hits which reference to a given protein accession (i.e. filter by protein accessi...
bool readNext(FASTAEntry &protein)
Reads the next FASTA entry from file. If you want to read all entries in one go, use load().
Iterator end()
Definition: MSExperiment.h:160
void cleanup(bool require_observation_match=true, bool require_identified_sequence=true, bool require_parent_match=true, bool require_parent_group=false, bool require_match_group=false)
Clean up the data structure after filtering parts of it.
static void filterPeptidesByMZError(std::vector< PeptideIdentification > &peptides, double mass_error, bool unit_ppm)
Filter peptide identifications according to mass deviation.
const std::vector< MSSpectrum > & getSpectra() const
returns the spectrum list
double getScore() const
returns the PSM score
void readStart(const String &filename)
Prepares a FASTA file given by 'filename' for streamed reading using readNext().
ObservationMatches observation_matches_
Definition: IdentificationData.h:656
void load(const String &filename, std::vector< FASTAEntry > &data) const
loads a FASTA file given by 'filename' and stores the information in 'data' This uses more RAM than r...
Int max_cleavages_
Definition: IDFilter.h:393
void load(const String &filename, std::vector< ProteinIdentification > &proteins, std::vector< PeptideIdentification > &peptides, const String &experiment_name, const SpectrumMetaDataLookup &lookup)
Loads peptide sequences with modifications out of a PepXML file.
bool operator()(const PeptideHit &hit) const
Definition: IDFilter.h:278
Given a list of protein accessions, do any occur in the annotation(s) of this hit?
Definition: IDFilter.h:232
bool operator()(const PeptideHit &hit) const
Definition: IDFilter.h:242
static void removeEmptyIdentifications(std::vector< IdentificationType > &ids)
Removes peptide or protein identifications that have no hits in them.
Definition: IDFilter.h:828
static void removePeptidesWithMatchingModifications(std::vector< PeptideIdentification > &peptides, const std::set< String > &modifications)
Removes all peptide hits that have at least one of the given modifications.
ProteaseDigestion & digestion_
Definition: IDFilter.h:441
Is the score of this hit at least as good as the given value?
Definition: IDFilter.h:102
HitType argument_type
Definition: IDFilter.h:104
std::map< Int, PeptideHit * > ChargeToPepHitP
Typedefs.
Definition: IDFilter.h:89
Used to load XTandemXML files.
Definition: XTandemXMLFile.h:56
void getAllSearchModifications(std::vector< String > &modifications) const
Collects all modifications that can be used for identification searches.
static void filterObservationMatchesByFunctor(IdentificationData &id_data, PredicateType &&func, bool cleanup_affected=false)
Helper function for filtering observation matches (e.g. PSMs) in IdentificationData.
Definition: IDFilter.h:1392
DigestionFilter(std::vector< FASTAFile::FASTAEntry > &entries, ProteaseDigestion &digestion, bool ignore_missed_cleavages, bool methionine_cleavage)
Definition: IDFilter.h:445
Management and storage of parameters / INI files.
Definition: Param.h:69
static bool getBestHit(const std::vector< IdentificationType > &identifications, bool assume_sorted, typename IdentificationType::HitType &best_hit)
Finds the best-scoring hit in a vector of peptide or protein identifications.
Definition: IDFilter.h:639
static void removePeptidesWithMatchingSequences(std::vector< PeptideIdentification > &peptides, const std::vector< PeptideIdentification > &bad_peptides, bool ignore_mods=false)
Removes all peptide hits with a sequence that matches one in bad_peptides.
Filter Peptide Hit by its digestion product.
Definition: IDFilter.h:388
double list
Definition: DataValue.h:74
static void keepHitsMatchingProteins(PeakMap &experiment, const std::vector< FASTAFile::FASTAEntry > &proteins)
Filters an MS/MS experiment according to the given proteins.
Definition: IDFilter.h:1346
static void keepNBestPeptideHits(MapType &map, Size n)
Filters a Consensus/FeatureMap by keeping the N best peptide hits for every spectrum.
Definition: IDFilter.h:1187
GetMatchingItems< PeptideEvidence, FASTAFile::FASTAEntry > accession_resolver_
Definition: IDFilter.h:440
Representation of a peptide/protein sequence.
Definition: AASequence.h:111
Used to load and store PepXML files.
Definition: PepXMLFile.h:63
String & ensureLastChar(char end)
Makes sure the string ends with the character end.
static AASequence fromString(const String &s, bool permissive=true)
create AASequence object by parsing an OpenMS string
static void filterHitsByScore(std::vector< IdentificationType > &ids, double threshold_score)
Filters peptide or protein identifications according to the score of the hits.
Definition: IDFilter.h:840
Int min_cleavages_
Definition: IDFilter.h:392
const String & getProteinAccession() const
get the protein accession the peptide matches to. If not available the empty string is returned.
#define OPENMS_LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:465
void setSpecificity(Specificity spec)
Sets the specificity for the digestion (default is SPEC_FULL).
static void removeUngroupedProteins(const std::vector< ProteinIdentification::ProteinGroup > &groups, std::vector< ProteinHit > &hits)
Update protein hits after protein groups were filtered.
void setIdentifier(const String &id)
Sets the identifier.
const std::unordered_set< String > & accessions
Definition: IDFilter.h:236
static bool fileList(const String &dir, const String &file_pattern, StringList &output, bool full_path=false)
Retrieves a list of files matching file_pattern in directory dir (returns filenames without paths unl...
Specificity getSpecificity() const
Returns the specificity for the digestion.
Element could not be found exception.
Definition: Exception.h:674
static void removeDecoyHits(std::vector< IdentificationType > &ids)
Removes hits annotated as decoys from peptide or protein identifications.
Definition: IDFilter.h:940
void store(const String &filename, const std::vector< ProteinIdentification > &poid, const std::vector< PeptideIdentification > &peid) const
Stores the identifications in a xQuest XML file.
static void filterHitsByScore(PeakMap &experiment, double peptide_threshold_score, double protein_threshold_score)
Filters an MS/MS experiment according to score thresholds.
Definition: IDFilter.h:1133
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
Search parameters of the DB search.
Definition: ProteinIdentification.h:258
const ParamValue & getValue(const std::string &key) const
Returns a value of a parameter.
void load(const String &filename, ProteinIdentification &protein_identification, std::vector< PeptideIdentification > &id_data, bool load_proteins=true, bool load_empty_hits=true)
loads data from a OMSSAXML file
static void annotateBestPerPeptidePerRunWithData(RunToSequenceToChargeToPepHitP &best_peps_per_run, std::vector< PeptideIdentification > &pep_ids, bool ignore_mods, bool ignore_charges, Size nr_best_spectrum)
Definition: IDFilter.h:1263
bool isHigherScoreBetter() const
returns the peptide score orientation
void remove(const std::string &key)
Remove the entry key or a section key (when suffix is ':')
Is this a decoy hit?
Definition: IDFilter.h:207
void load(const String &filename, bool trim_lines=false, Int first_n=-1, bool skip_empty_lines=false)
Loads data from a text file.
any XML format
Definition: FileTypes.h:116
Int toInt() const
Conversion to int.
void load(const String &filename, IdentificationData &id_data)
Read in a OMS file and construct an IdentificationData object.
Int getEnd() const
get the position of the last AA of the peptide in protein coordinates (starting at 0 for the N-termin...
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
static void filterGroupsByScore(std::vector< ProteinIdentification::ProteinGroup > &grps, double threshold_score, bool higher_better)
Filters protein groups according to the score of the groups.
Annotates spectra from identifications and theoretical spectra or identifications from spectra and th...
Definition: SpectrumAnnotator.h:60
static void removeEmptyIdentifications(MapType &prot_and_pep_ids)
Definition: IDFilter.h:1199
static void removeMatchingPeptideHits(MapType &prot_and_pep_ids, Predicate &pred)
Definition: IDFilter.h:587
This class provides Input functionality for ConsensusMaps and Output functionality for alignments and...
Definition: ConsensusXMLFile.h:58
Used to load and store idXML files.
Definition: IdXMLFile.h:68
OpenMS database file.
Definition: FileTypes.h:114
Percolator tab-delimited output (PSM level)
Definition: FileTypes.h:105
Is the rank of this hit below or at the given cut-off?
Definition: IDFilter.h:130
static void FilterPeptideEvidences(EvidenceFilter &filter, std::vector< PeptideIdentification > &peptides)
remove peptide evidences based on a filter
Definition: IDFilter.h:714
PeptideDigestionFilter(EnzymaticDigestion &digestion, Int min, Int max)
Definition: IDFilter.h:397
Command line progress.
Definition: ProgressLogger.h:70
bool operator()(const IdentificationType &id) const
Definition: IDFilter.h:503
Representation of a peptide hit.
Definition: PeptideHit.h:55
static void keepBestPerPeptidePerRun(std::vector< ProteinIdentification > &prot_ids, std::vector< PeptideIdentification > &pep_ids, bool ignore_mods, bool ignore_charges, Size nr_best_spectrum)
Definition: IDFilter.h:1213