Skip to content
Snippets Groups Projects
Commit 1f1791fd authored by Langella Olivier's avatar Langella Olivier
Browse files

get only amino acids one letter code to compute protein mass or count tryptic peptides

parent 2374fdd1
No related branches found
No related tags found
No related merge requests found
......@@ -109,16 +109,19 @@ bool ProteinXtp::isDecoy() const {
QString ProteinXtp::getOnlyAminoAcidSequence() const {
QString sequence(this->getSequence());
return sequence.replace(QRegExp("\\*"), "");
return sequence.replace(QRegExp("[^RNDBCEQZGHILKMFPSTWYVX]"),"");
}
pappso::pappso_double ProteinXtp::getMass() const {
try {
pappso::Peptide peptide(getOnlyAminoAcidSequence().replace("X",""));
//qDebug() << "ProteinXtp::getMass() begin " << getOnlyAminoAcidSequence().replace("[BZX]","E");
// replace amino acid wildcard by E, just to give an random mass (assumed it is not perfect)
pappso::Peptide peptide(getOnlyAminoAcidSequence().replace(QRegExp("[BZX]"),"E"));
return peptide.getMass();
}
catch (pappso::PappsoException error) {
qDebug() << "ProteinXtp::getMass() " << getOnlyAminoAcidSequence().replace(QRegExp("[BZX]"),"E");
throw pappso::PappsoException(QObject::tr("Error computing mass for protein %1 :\n%2").arg(getAccession()).arg(error.qwhat()));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment