libpappsomspp
Library for mass spectrometry
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)
 
ProteinremoveTranslationStop ()
 remove * characters at the end of the sequence More...
 
Proteinreverse ()
 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 70 of file protein.h.

Constructor & Destructor Documentation

◆ Protein() [1/3]

pappso::Protein::Protein ( )

Definition at line 83 of file protein.cpp.

84 {

References m_removeTranslationStopRegExp, and m_sequence.

◆ Protein() [2/3]

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

Definition at line 86 of file protein.cpp.

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

◆ Protein() [3/3]

pappso::Protein::Protein ( const Protein protein)

Definition at line 95 of file protein.cpp.

98 {
99  return std::make_shared<Protein>(*this);
100 }
101 

◆ ~Protein()

pappso::Protein::~Protein ( )

Definition at line 167 of file protein.cpp.

Member Function Documentation

◆ getAccession()

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

Definition at line 148 of file protein.cpp.

151 {

◆ getDescription()

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

Definition at line 158 of file protein.cpp.

◆ getMass()

pappso_double pappso::Protein::getMass ( ) const

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

Definition at line 171 of file protein.cpp.

◆ getSequence()

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

Definition at line 143 of file protein.cpp.

143 {
144  m_description = description.simplified();
145 }

References m_description.

◆ makeProteinSp()

ProteinSp pappso::Protein::makeProteinSp ( ) const

Definition at line 118 of file protein.cpp.

◆ operator==()

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

Definition at line 125 of file protein.cpp.

128 {

◆ removeTranslationStop()

Protein & pappso::Protein::removeTranslationStop ( )

remove * characters at the end of the sequence

Definition at line 104 of file protein.cpp.

105 {
106  return (m_accession == other.m_accession);
107 }
108 

References m_accession.

◆ reverse()

Protein & pappso::Protein::reverse ( )

reverse characters in the sequence

Definition at line 111 of file protein.cpp.

111 {
112  m_sequence = sequence.simplified();
113  m_length = m_sequence.size();
114 }
115 unsigned int

References m_length, and m_sequence.

◆ setAccession()

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

Definition at line 153 of file protein.cpp.

153  {
154  // qDebug() << "ProteinXtp::getMass() begin " <<
155  // getOnlyAminoAcidSequence().replace("[BZX]","E");
156  // replace amino acid wildcard by E, just to give an random mass (assumed

◆ setDescription()

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

Definition at line 163 of file protein.cpp.

164  {
166  QObject::tr("Error computing mass for protein %1 :\n%2")

◆ setSequence()

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

Definition at line 131 of file protein.cpp.

133 {
134  m_accession = accession.simplified();
135 }

References m_accession.

◆ size()

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

protein amino acid sequence size

Definition at line 137 of file protein.cpp.

138 {
139  return m_description;
140 }

References m_description.

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 77 of file protein.h.

Referenced by removeTranslationStop(), and setSequence().

◆ m_description

QString pappso::Protein::m_description
private

free text to describe the protein

Definition at line 74 of file protein.h.

Referenced by getSequence(), and size().

◆ m_length

unsigned int pappso::Protein::m_length = 0
private

number of amino acid

Definition at line 81 of file protein.h.

Referenced by reverse().

◆ m_removeTranslationStopRegExp

QRegExp pappso::Protein::m_removeTranslationStopRegExp
staticprivate

Definition at line 83 of file protein.h.

Referenced by Protein().

◆ m_sequence

QString pappso::Protein::m_sequence
private

the amino acid sequence

Definition at line 79 of file protein.h.

Referenced by Protein(), and reverse().


The documentation for this class was generated from the following files:
pappso::Protein::m_removeTranslationStopRegExp
static QRegExp m_removeTranslationStopRegExp
Definition: protein.h:83
pappso::Protein::~Protein
~Protein()
Definition: protein.cpp:167
pappso::Protein::m_description
QString m_description
free text to describe the protein
Definition: protein.h:74
pappso::Protein::m_length
unsigned int m_length
number of amino acid
Definition: protein.h:81
pappso::Protein::m_sequence
QString m_sequence
the amino acid sequence
Definition: protein.h:79
pappso::Protein::m_accession
QString m_accession
a single unique identifier of the protein (usually the first word of description)
Definition: protein.h:77
pappso::PappsoException
Definition: pappsoexception.h:63