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

Constructor & Destructor Documentation

◆ Protein() [1/3]

pappso::Protein::Protein ( )

Definition at line 81 of file protein.cpp.

84 {

◆ Protein() [2/3]

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

Definition at line 84 of file protein.cpp.

84 {
86  return (*this);
87 }
88 
89 Protein &
91 {
92  std::reverse(m_sequence.begin(), m_sequence.end());

References m_removeTranslationStopRegExp, and m_sequence.

◆ Protein() [3/3]

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

Definition at line 93 of file protein.cpp.

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

◆ ~Protein()

pappso::Protein::~Protein ( )

Definition at line 165 of file protein.cpp.

166  :\n%2")
167  .arg(getAccession())

Member Function Documentation

◆ getAccession()

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

Definition at line 146 of file protein.cpp.

147 {
148 }

◆ getDescription()

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

Definition at line 156 of file protein.cpp.

◆ getMass()

pappso_double pappso::Protein::getMass ( ) const

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

Definition at line 169 of file protein.cpp.

◆ getSequence()

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

Definition at line 141 of file protein.cpp.

143 {
144  m_description = description.simplified();

References m_description.

◆ makeProteinSp()

ProteinSp pappso::Protein::makeProteinSp ( ) const

Definition at line 116 of file protein.cpp.

117 {
118  return m_length;
119 }

References m_length.

◆ operator==()

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

Definition at line 123 of file protein.cpp.

123 {
124  return m_sequence;
125 }
126 const QString &

References m_sequence.

◆ removeTranslationStop()

Protein & pappso::Protein::removeTranslationStop ( )

remove * characters at the end of the sequence

Definition at line 102 of file protein.cpp.

105 {
106  return (m_accession == other.m_accession);

References m_accession.

◆ reverse()

Protein & pappso::Protein::reverse ( )

reverse characters in the sequence

Definition at line 109 of file protein.cpp.

111 {
112  m_sequence = sequence.simplified();
113  m_length = m_sequence.size();

References m_length, and m_sequence.

◆ setAccession()

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

Definition at line 151 of file protein.cpp.

151 {
152  try
153  {
154  // qDebug() << "ProteinXtp::getMass() begin " <<

◆ setDescription()

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

Definition at line 161 of file protein.cpp.

164  {

◆ setSequence()

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

Definition at line 129 of file protein.cpp.

133 {

◆ size()

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

protein amino acid sequence size

Definition at line 135 of file protein.cpp.

138 {

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

Referenced by removeTranslationStop().

◆ m_description

QString pappso::Protein::m_description
private

free text to describe the protein

Definition at line 72 of file protein.h.

Referenced by getSequence().

◆ m_length

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

number of amino acid

Definition at line 79 of file protein.h.

Referenced by makeProteinSp(), and reverse().

◆ m_removeTranslationStopRegExp

QRegExp pappso::Protein::m_removeTranslationStopRegExp
staticprivate

Definition at line 81 of file protein.h.

Referenced by Protein().

◆ m_sequence

QString pappso::Protein::m_sequence
private

the amino acid sequence

Definition at line 77 of file protein.h.

Referenced by operator==(), Protein(), and reverse().


The documentation for this class was generated from the following files:
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:67
pappso::Protein::m_removeTranslationStopRegExp
static QRegExp m_removeTranslationStopRegExp
Definition: protein.h:81
pappso::Protein::m_description
QString m_description
free text to describe the protein
Definition: protein.h:72
pappso::Protein::m_length
unsigned int m_length
number of amino acid
Definition: protein.h:79
pappso::Protein::Protein
Protein()
Definition: protein.cpp:81
pappso::Protein::reverse
Protein & reverse()
reverse characters in the sequence
Definition: protein.cpp:109
pappso::Protein::m_sequence
QString m_sequence
the amino acid sequence
Definition: protein.h:77
pappso::Protein::m_accession
QString m_accession
a single unique identifier of the protein (usually the first word of description)
Definition: protein.h:75