adds a subtree (with peptides ...) to a given protein
| 114 | |
| 115 | /// adds a subtree (with peptides ...) to a given protein |
| 116 | void fillProt(const OSWProtein& prot, QTreeWidgetItem* item_prot) |
| 117 | { |
| 118 | for (size_t idx_pep = 0; idx_pep < prot.getPeptidePrecursors().size(); ++idx_pep) |
| 119 | { |
| 120 | const auto& pep = prot.getPeptidePrecursors()[idx_pep]; |
| 121 | QTreeWidgetItem* item_pep = new QTreeWidgetItem(item_prot); |
| 122 | item_pep->setData(Clmn::ENTITY, Qt::DisplayRole, OSWHierarchy::LevelName[OSWHierarchy::PEPTIDE]); |
| 123 | item_pep->setData(Clmn::INDEX, Qt::DisplayRole, (int)idx_pep); |
| 124 | item_pep->setData(Clmn::INDEX, Qt::UserRole, OSWHierarchy::PEPTIDE); // mark as peptide, so we know how to interpret the display role |
| 125 | item_pep->setData(Clmn::CHARGE, Qt::DisplayRole, pep.getCharge()); |
| 126 | item_pep->setText(Clmn::FULL_NAME, pep.getSequence().c_str()); |
| 127 | |
| 128 | for (size_t idx_feat = 0; idx_feat < pep.getFeatures().size(); ++idx_feat) |
| 129 | { |
| 130 | const auto& feat = pep.getFeatures()[idx_feat]; |
| 131 | QTreeWidgetItem* item_feat = new QTreeWidgetItem(item_pep); |
| 132 | item_feat->setData(Clmn::ENTITY, Qt::DisplayRole, OSWHierarchy::LevelName[OSWHierarchy::FEATURE]); |
| 133 | item_feat->setData(Clmn::INDEX, Qt::DisplayRole, (int)idx_feat); |
| 134 | item_feat->setData(Clmn::INDEX, Qt::UserRole, OSWHierarchy::FEATURE); // mark as feature, so we know how to interpret the display role |
| 135 | item_feat->setData(Clmn::RT_DELTA, Qt::DisplayRole, feat.getRTDelta()); |
| 136 | item_feat->setData(Clmn::QVALUE, Qt::DisplayRole, feat.getQValue()); |
| 137 | |
| 138 | for (size_t idx_trans = 0; idx_trans < feat.getTransitionIDs().size(); ++idx_trans) |
| 139 | { |
| 140 | QTreeWidgetItem* item_trans = new QTreeWidgetItem(item_feat); |
| 141 | item_trans->setData(Clmn::ENTITY, Qt::DisplayRole, OSWHierarchy::LevelName[OSWHierarchy::TRANSITION]); |
| 142 | item_trans->setData(Clmn::INDEX, Qt::DisplayRole, (int)idx_trans); |
| 143 | item_trans->setData(Clmn::INDEX, Qt::UserRole, OSWHierarchy::TRANSITION); // mark as transition, so we know how to interpret the display role |
| 144 | } |
| 145 | } |
| 146 | //item_prot->addChild(item_pep); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | /// creates a protein subtree (with peptides etc, if available) |
| 151 | QTreeWidgetItem* createProt(const OSWProtein& prot, int prot_index) |
no test coverage detected