bpp-seq
2.2.0
SequenceWithQuality.cpp
Go to the documentation of this file.
1
//
2
// File: SequenceWithQuality.cpp
3
// Author: Sylvain Gaillard
4
// Created: 19/01/2010 16:09:02
5
//
6
7
/*
8
Copyright or © or Copr. Bio++ Development Team, (January 19, 2010)
9
10
This software is a computer program whose purpose is to provide classes
11
for sequences analysis.
12
13
This software is governed by the CeCILL license under French law and
14
abiding by the rules of distribution of free software. You can use,
15
modify and/ or redistribute the software under the terms of the CeCILL
16
license as circulated by CEA, CNRS and INRIA at the following URL
17
"http://www.cecill.info".
18
19
As a counterpart to the access to the source code and rights to copy,
20
modify and redistribute granted by the license, users are provided only
21
with a limited warranty and the software's author, the holder of the
22
economic rights, and the successive licensors have only limited
23
liability.
24
25
In this respect, the user's attention is drawn to the risks associated
26
with loading, using, modifying and/or developing or reproducing the
27
software by the user in light of its specific status of free software,
28
that may mean that it is complicated to manipulate, and that also
29
therefore means that it is reserved for developers and experienced
30
professionals having in-depth computer knowledge. Users are therefore
31
encouraged to load and test the software's suitability as regards their
32
requirements in conditions enabling the security of their systems and/or
33
data to be ensured and, more generally, to use and operate it in the
34
same conditions as regards security.
35
36
The fact that you are presently reading this means that you have had
37
knowledge of the CeCILL license and that you accept its terms.
38
*/
39
40
#include "
SequenceWithQuality.h
"
41
#include <Bpp/Numeric/VectorTools.h>
42
43
using namespace
bpp
;
44
45
#include <string>
46
#include <iostream>
47
48
using namespace
std
;
49
50
const
string
SequenceQuality::QUALITY_SCORE
=
"Quality score"
;
51
const
int
SequenceQuality::DEFAULT_QUALITY_VALUE
= 20;
52
53
/******************************************************************************/
54
55
void
SequenceQuality::afterSequenceChanged
(
const
SymbolListEditionEvent
& event)
56
{
57
qualScores_.clear();
58
qualScores_.insert(qualScores_.begin(),
event
.getSymbolList()->size(), DEFAULT_QUALITY_VALUE);
59
}
60
61
/******************************************************************************/
62
63
void
SequenceQuality::afterSequenceInserted
(
const
SymbolListInsertionEvent
& event)
64
{
65
qualScores_.insert(
66
qualScores_.begin() +
static_cast<
ptrdiff_t
>
(
event
.getPosition()),
67
event.
getLength
(), DEFAULT_QUALITY_VALUE);
68
}
69
70
/******************************************************************************/
71
72
void
SequenceQuality::afterSequenceDeleted
(
const
SymbolListDeletionEvent
& event)
73
{
74
qualScores_.erase(
75
qualScores_.begin() +
static_cast<
ptrdiff_t
>
(
event
.getPosition()),
76
qualScores_.begin() +
static_cast<
ptrdiff_t
>
(
event
.getPosition() +
event
.getLength()));
77
}
78
79
/******************************************************************************/
80
bpp::SymbolListInsertionEvent::getLength
virtual size_t getLength() const
Definition:
SymbolList.h:427
SequenceWithQuality.h
bpp
This alphabet is used to deal NumericAlphabet.
Definition:
AbstractAlphabet.h:54
bpp::SequenceQuality::afterSequenceDeleted
void afterSequenceDeleted(const SymbolListDeletionEvent &event)
Definition:
SequenceWithQuality.cpp:72
std
STL namespace.
bpp::SequenceQuality::afterSequenceInserted
void afterSequenceInserted(const SymbolListInsertionEvent &event)
Definition:
SequenceWithQuality.cpp:63
bpp::SymbolListInsertionEvent
Definition:
SymbolList.h:414
bpp::SymbolListDeletionEvent
Definition:
SymbolList.h:431
bpp::SymbolListEditionEvent
Definition:
SymbolList.h:390
bpp::SequenceQuality::QUALITY_SCORE
static const std::string QUALITY_SCORE
Definition:
SequenceWithQuality.h:73
bpp::SequenceQuality::DEFAULT_QUALITY_VALUE
static const int DEFAULT_QUALITY_VALUE
Definition:
SequenceWithQuality.h:74
bpp::SequenceQuality::afterSequenceChanged
void afterSequenceChanged(const SymbolListEditionEvent &event)
Definition:
SequenceWithQuality.cpp:55
Bpp
Seq
SequenceWithQuality.cpp
Generated on Sat May 23 2020 12:00:22 for bpp-seq by
1.8.14