MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / peptideSectionRowFromFeature_

Method peptideSectionRowFromFeature_

src/openms/source/FORMAT/MzTab.cpp:758–862  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

756 }
757
758 MzTabPeptideSectionRow MzTab::peptideSectionRowFromFeature_(
759 const Feature& f,
760 const set<String>& feature_user_value_keys,
761 const set<String>& peptide_identifications_user_value_keys,
762 const set<String>& peptide_hit_user_value_keys,
763 const vector<String>& fixed_mods)
764 {
765 MzTabPeptideSectionRow row;
766 row.mass_to_charge = MzTabDouble(f.getMZ());
767 MzTabDoubleList rt_list;
768 vector<MzTabDouble> rts;
769 rts.emplace_back(f.getRT());
770 rt_list.set(rts);
771 row.retention_time = rt_list;
772
773 // set rt window if a bounding box has been set
774 vector<MzTabDouble> window;
775 if (f.getConvexHull().getBoundingBox() != DBoundingBox<2>())
776 {
777 window.emplace_back(f.getConvexHull().getBoundingBox().minX());
778 window.emplace_back(f.getConvexHull().getBoundingBox().maxX());
779 }
780
781 MzTabDoubleList rt_window;
782 rt_window.set(window);
783 row.retention_time_window = rt_window;
784 row.charge = MzTabInteger(f.getCharge());
785 row.peptide_abundance_stdev_study_variable[1];
786 row.peptide_abundance_std_error_study_variable[1];
787 row.peptide_abundance_study_variable[1] = MzTabDouble(f.getIntensity());
788 row.best_search_engine_score[1] = MzTabDouble();
789 row.search_engine_score_ms_run[1][1] = MzTabDouble();
790
791 // create opt_ column for peptide sequence containing modification
792 MzTabOptionalColumnEntry opt_global_modified_sequence;
793 opt_global_modified_sequence.first = "opt_global_cv_MS:1000889_peptidoform_sequence";
794 row.opt_.push_back(opt_global_modified_sequence);
795
796 // create and fill opt_ columns for feature (peptide) user values
797 addMetaInfoToOptionalColumns(feature_user_value_keys, row.opt_, String("global"), f);
798
799 const vector<PeptideIdentification>& pep_ids = f.getPeptideIdentifications();
800 if (pep_ids.empty())
801 {
802 // still add empty opt_ columns before returning
803 addMetaInfoToOptionalColumns(peptide_identifications_user_value_keys, row.opt_, "global", MetaInfoInterface());
804 addMetaInfoToOptionalColumns(peptide_hit_user_value_keys, row.opt_, "global", MetaInfoInterface());
805 return row;
806 }
807
808 const PeptideIdentification& best_pid = f.getPeptideIdentifications()[0];
809 addMetaInfoToOptionalColumns(peptide_identifications_user_value_keys, row.opt_, "global", best_pid);
810
811 // TODO: here we assume that all have the same score type etc.
812 vector<PeptideHit> all_hits;
813 for (const PeptideIdentification& it : pep_ids)
814 {
815 all_hits.insert(all_hits.end(), it.getHits().begin(), it.getHits().end());

Callers

nothing calls this directly

Calls 15

emplace_backMethod · 0.80
getBoundingBoxMethod · 0.80
minXMethod · 0.80
maxXMethod · 0.80
getSequenceMethod · 0.80
toUnmodifiedStringMethod · 0.80
StringClass · 0.50
MetaInfoInterfaceClass · 0.50
getMZMethod · 0.45
getRTMethod · 0.45

Tested by

no test coverage detected