diff --git a/src/core/proteinxtp.cpp b/src/core/proteinxtp.cpp index ef3bba3f803de160c24ba13eb2c1658719331b1a..c5551184dda608f199397e97be6534cb8097bec7 100644 --- a/src/core/proteinxtp.cpp +++ b/src/core/proteinxtp.cpp @@ -124,6 +124,7 @@ unsigned int ProteinXtp::countTrypticPeptidesForPAI() const { void ProteinXtp::parseAccession2dbxref() { + qDebug() << "ProteinXtp::parseAccession2dbxref begin" ; QStringList access_list = getAccession().split("\\|"); // if (access.length == 1) QRegExp atg("^[Aa][Tt][MmCc1-5][Gg]\\d{5}\\.?\\d?$"); @@ -140,11 +141,11 @@ void ProteinXtp::parseAccession2dbxref() { if (ncbi_gi.indexIn(accession, 0) != -1) { _dbxref_list.push_back(std::make_pair(ExternalDatabase::NCBI_gi, accession)); } - + if (swiss_prot.indexIn(accession, 0) != -1) { _dbxref_list.push_back(std::make_pair(ExternalDatabase::SwissProt, accession)); } - + if (trembl.indexIn(accession, 0) != -1) { _dbxref_list.push_back(std::make_pair(ExternalDatabase::TrEMBL, accession)); } @@ -152,6 +153,16 @@ void ProteinXtp::parseAccession2dbxref() { _dbxref_list.push_back(std::make_pair(ExternalDatabase::ref, accession)); } } + + if (_dbxref_list.size() > 1) { + _dbxref_list.sort(); + _dbxref_list.unique([] (const std::pair<ExternalDatabase, QString> & first, const std::pair<ExternalDatabase, QString> & second) + { + return ( first.first == second.first ) && (first.second == second.second); + }); + } + + qDebug() << "ProteinXtp::parseAccession2dbxref end" ; }