pappso::Protein Class Reference

`#include <protein.h>`

## Public Member Functions

| Protein ()
| Protein (const QString &description, const QString &sequence)
| Protein (const Protein &protein)
ProteinSp | makeProteinSp () const
bool | operator== (const Protein &other) const
| ~Protein ()
const QString & | getSequence () const
void | setSequence (const QString &sequence)
const QString & | getAccession () const
virtual void | setAccession (const QString &accession)
const QString & | getDescription () const
void | setDescription (const QString &description)
Protein & | removeTranslationStop ()
| remove * characters at the end of the sequence More...
Protein & | reverse ()
| reverse characters in the sequence More...
unsigned int | size () const
| protein amino acid sequence size More...
pappso_double | getMass () const
| get monoisotopic mass of ProteinSp Protein::makeProteinSp() const More...

## Private Attributes

QString | m_description
| free text to describe the protein More...
QString | m_accession
| a single unique identifier of the protein (usually the first word of description) More...
QString | m_sequence
| the amino acid sequence More...
unsigned int | m_length = 0
| number of amino acid More...

## Static Private Attributes

static QRegExp | m_removeTranslationStopRegExp

## Detailed Description

Definition at line 49 of file protein.h.

## Constructor & Destructor Documentation

## Protein() [1/3]

pappso::Protein::Protein | ( |  | ) |

Definition at line 62 of file protein.cpp.

{
}

## Protein() [2/3]

pappso::Protein::Protein | ( | const QString & | description,
|  | const QString & | sequence
| ) |  |

Definition at line 65 of file protein.cpp.

: m_description(description.simplified()),
m_accession(m_description.split(" ").at(0)),
m_sequence(sequence)
{
m_description = m_description.remove(0, m_accession.size()).simplified();
// m_sequence.replace(m_removeTranslationStopRegExp, "");
m_length = m_sequence.size();
}
pappso::Protein::m_length
unsigned int m_length
number of amino acid
Definition: protein.h:60
pappso::Protein::m_sequence
QString m_sequence
the amino acid sequence
Definition: protein.h:58
pappso::Protein::m_accession
QString m_accession
a single unique identifier of the protein (usually the first word of description)
Definition: protein.h:56
pappso::Protein::m_description
QString m_description
free text to describe the protein
Definition: protein.h:53

References m_accession, m_description, m_length, and m_sequence.

## Protein() [3/3]

pappso::Protein::Protein | ( | const Protein & | protein | ) |

Definition at line 74 of file protein.cpp.

: m_description(protein.m_description),
m_accession(protein.m_accession),
m_sequence(protein.m_sequence),
m_length(protein.m_length)
{
}

## ~Protein()

pappso::Protein::~Protein | ( |  | ) |

Definition at line 146 of file protein.cpp.

{
}

## Member Function Documentation

## getAccession()

const QString & pappso::Protein::getAccession | ( |  | ) | const

Definition at line 127 of file protein.cpp.

{
return m_accession;
}

References m_accession.

Referenced by getMass(), and pappso::FastaOutputStream::writeProtein().

## getDescription()

const QString & pappso::Protein::getDescription | ( |  | ) | const

Definition at line 137 of file protein.cpp.

{
return m_description;
}

References m_description.

Referenced by pappso::FastaOutputStream::writeProtein().

## getMass()

pappso_double pappso::Protein::getMass | ( |  | ) | const

get monoisotopic mass of ProteinSp Protein::makeProteinSp() const

Definition at line 150 of file protein.cpp.

{
try
{
// 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)
QString sequence(m_sequence);
sequence.replace(QRegExp("[^WGASPVTLINDKQEMHFRCYUBZX]"), "");
pappso::Peptide peptide(sequence.replace(QRegExp("[BZX]"), "E"));
return peptide.getMass();
}
catch(pappso::PappsoException &error)
{
throw pappso::PappsoException(
QObject::tr("Error computing mass for protein %1 :\n%2")
.arg(getAccession())
.arg(error.qwhat()));
}
}
pappso::PappsoException
Definition: pappsoexception.h:42
pappso::PappsoException::qwhat
virtual const QString & qwhat() const
Definition: pappsoexception.h:68
pappso::Peptide
Definition: peptide.h:93
pappso::Protein::getAccession
const QString & getAccession() const
Definition: protein.cpp:127

References getAccession(), pappso::Peptide::getMass(), m_sequence, and pappso::PappsoException::qwhat().

## getSequence()

const QString & pappso::Protein::getSequence | ( |  | ) | const

Definition at line 122 of file protein.cpp.

{
return m_sequence;
}

References m_sequence.

Referenced by pappso::FastaOutputStream::writeProtein().

## makeProteinSp()

ProteinSp pappso::Protein::makeProteinSp | ( |  | ) | const

Definition at line 97 of file protein.cpp.

{
return std::make_shared<Protein>(*this);
}

## operator==()

bool pappso::Protein::operator== | ( | const Protein & | other | ) | const

Definition at line 104 of file protein.cpp.

{
return (m_accession == other.m_accession);
}

References m_accession.

## removeTranslationStop()

Protein & pappso::Protein::removeTranslationStop | ( |  | ) |

remove * characters at the end of the sequence

Definition at line 83 of file protein.cpp.

{
m_sequence.replace(m_removeTranslationStopRegExp, "");
return (*this);
}
pappso::Protein::m_removeTranslationStopRegExp
static QRegExp m_removeTranslationStopRegExp
Definition: protein.h:62

References m_removeTranslationStopRegExp, and m_sequence.

## reverse()

Protein & pappso::Protein::reverse | ( |  | ) |

reverse characters in the sequence

Definition at line 90 of file protein.cpp.

{
std::reverse(m_sequence.begin(), m_sequence.end());
return (*this);
}

References m_sequence.

## setAccession()

void pappso::Protein::setAccession | ( | const QString & | accession | ) |

virtual

Definition at line 132 of file protein.cpp.

{
m_accession = accession.simplified();
}

References m_accession.

## setDescription()

void pappso::Protein::setDescription | ( | const QString & | description | ) |

Definition at line 142 of file protein.cpp.

{
m_description = description.simplified();
}

References m_description.

## setSequence()

void pappso::Protein::setSequence | ( | const QString & | sequence | ) |

Definition at line 110 of file protein.cpp.

{
m_sequence = sequence.simplified();
m_length = m_sequence.size();
}

References m_length, and m_sequence.

## size()

unsigned int pappso::Protein::size | ( |  | ) | const

protein amino acid sequence size

Definition at line 116 of file protein.cpp.

{
return m_length;
}

References m_length.

## Member Data Documentation

## m_accession

QString pappso::Protein::m_accession

private

a single unique identifier of the protein (usually the first word of description)

Definition at line 56 of file protein.h.

Referenced by Protein(), getAccession(), operator==(), and setAccession().

## m_description

QString pappso::Protein::m_description

private

free text to describe the protein

Definition at line 53 of file protein.h.

Referenced by Protein(), getDescription(), and setDescription().

## m_length

unsigned int pappso::Protein::m_length = 0

private

number of amino acid

Definition at line 60 of file protein.h.

Referenced by Protein(), setSequence(), and size().

## m_removeTranslationStopRegExp

QRegExp pappso::Protein::m_removeTranslationStopRegExp

static private

Definition at line 62 of file protein.h.

Referenced by removeTranslationStop().

## m_sequence

QString pappso::Protein::m_sequence

private

the amino acid sequence

Definition at line 58 of file protein.h.

Referenced by Protein(), getMass(), getSequence(), removeTranslationStop(), reverse(), and setSequence().

The documentation for this class was generated from the following files:

- pappsomspp/protein/protein.h
- pappsomspp/protein/protein.cpp