Skip to content
Commits on Source (4)
......@@ -95,10 +95,10 @@ ENDIF(NO_DEP_CHECK)
# Packager
SET(CPACK_PACKAGE_NAME "libbpp-seq")
SET(CPACK_PACKAGE_VENDOR "Bio++ Development Team")
SET(CPACK_PACKAGE_VERSION "2.4.0")
SET(CPACK_PACKAGE_VERSION "2.4.1")
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
SET(CPACK_PACKAGE_VERSION_MINOR "4")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_PACKAGE_VERSION_PATCH "1")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Bio++ Sequence library")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.txt")
SET(CPACK_RESOURCE_FILE_AUTHORS "${CMAKE_SOURCE_DIR}/AUTHORS.txt")
......
......@@ -38,7 +38,7 @@ PROJECT_NAME = bpp-seq
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 2.4.0
PROJECT_NUMBER = 2.4.1
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
......
......@@ -3,7 +3,7 @@
URL: https://github.com/BioPP/bpp-seq
Name: bpp-seq
Version: 2.4.0
Version: 2.4.1
Release: 1%{?dist}
License: CECILL-2.0
Vendor: The Bio++ Project
......@@ -78,6 +78,8 @@ rm -rf $RPM_BUILD_ROOT
%{_prefix}/include/*
%changelog
* Fri Aug 10 2018 Julien Dutheil <julien.dutheil@univ-montp2.fr> 2.4.1-1
- Compatibility update gcc8
* Fri Mar 03 2018 Julien Dutheil <julien.dutheil@univ-montp2.fr> 2.4.0-1
- Increased interface number
- Removed dynamic exceptions declarations.
......
libbpp-seq (2.4.1-1) UNRELEASED; urgency=medium
* New upstream version
* Ref: #897784
-- Julien Dutheil <julien.dutheil@univ-montp2.fr> Sun, 19 Aug 2018 11:45:47 +0200
libbpp-seq (2.4.0-2) unstable; urgency=medium
[ Julien Dutheil ]
......
......@@ -7,10 +7,10 @@ Priority: optional
Build-Depends: debhelper (>= 11~),
cmake,
d-shlibs (>= 0.80),
libbpp-core-dev (>= 2.4.0)
libbpp-core-dev (>= 2.4.1)
Standards-Version: 4.1.3
Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/libbpp-seq.git
Vcs-Git: https://anonscm.debian.org/git/debian-med/libbpp-seq.git
Vcs-Browser: https://salsa.debian.org/med-team/libbpp-seq
Vcs-Git: https://salsa.debian.org/med-team/libbpp-seq.git
Homepage: http://biopp.univ-montp2.fr/wiki/index.php/Main_Page
Package: libbpp-seq-dev
......@@ -18,7 +18,7 @@ Architecture: any
Section: libdevel
Depends: libbpp-seq12 (= ${binary:Version}),
${misc:Depends},
libbpp-core-dev (>= 2.4.0)
libbpp-core-dev (>= 2.4.1)
Description: Bio++ Sequence library development files
Bio++ is a set of C++ libraries for Bioinformatics, including sequence
analysis, phylogenetics, molecular evolution and population genetics.
......@@ -35,7 +35,7 @@ Multi-Arch: same
Section: libs
Depends: ${shlibs:Depends},
${misc:Depends},
libbpp-core4 (>= 2.4.0)
libbpp-core4 (>= 2.4.1)
Pre-Depends: ${misc:Pre-Depends}
Description: Bio++ Sequence library
Bio++ is a set of C++ libraries for Bioinformatics, including sequence
......
This diff is collapsed.
......@@ -55,9 +55,6 @@ namespace bpp
public LetterAlphabet
{
protected:
void registerState(AlphabetState* st) {
AbstractAlphabet::registerState(st);
}
std::string chars_;
public:
......
......@@ -83,7 +83,7 @@ namespace bpp {
public:
bool isCharInAlphabet(char state) const {
return letters_[static_cast<unsigned int>(state)] != LETTER_UNDEF_VALUE;
return letters_[static_cast<size_t>(state)] != LETTER_UNDEF_VALUE;
}
bool isCharInAlphabet(const std::string& state) const {
return isCharInAlphabet(state[0]);
......@@ -98,20 +98,20 @@ namespace bpp {
void registerState(AlphabetState* st) {
AbstractAlphabet::registerState(st);
if (caseSensitive_) {
letters_[static_cast<unsigned int>(st->getLetter()[0])] = st->getNum();
letters_[static_cast<size_t>(st->getLetter()[0])] = st->getNum();
} else {
letters_[static_cast<unsigned int>(tolower(st->getLetter()[0]))] = st->getNum();
letters_[static_cast<unsigned int>(toupper(st->getLetter()[0]))] = st->getNum();
letters_[static_cast<size_t>(tolower(st->getLetter()[0]))] = st->getNum();
letters_[static_cast<size_t>(toupper(st->getLetter()[0]))] = st->getNum();
}
}
void setState(size_t pos, AlphabetState* st) {
AbstractAlphabet::setState(pos, st);
if (caseSensitive_) {
letters_[static_cast<unsigned int>(st->getLetter()[0])] = st->getNum();
letters_[static_cast<size_t>(st->getLetter()[0])] = st->getNum();
} else {
letters_[static_cast<unsigned int>(tolower(st->getLetter()[0]))] = st->getNum();
letters_[static_cast<unsigned int>(toupper(st->getLetter()[0]))] = st->getNum();
letters_[static_cast<size_t>(tolower(st->getLetter()[0]))] = st->getNum();
letters_[static_cast<size_t>(toupper(st->getLetter()[0]))] = st->getNum();
}
}
......
......@@ -81,7 +81,7 @@ namespace bpp
* C RICJ880106 0.849
* I A/L R/K N/M D/F C/P Q/S E/T G/W H/Y I/V
* 0. 0. 0. 1. 0. 0. 1. 0. 0. 0.
* 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. * Soit:
* 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
* //
* @endcode
*
......
......@@ -94,16 +94,17 @@ public:
double getIndex(int state1, int state2) const
{
size_t stateIndex1 = alpha_->getStateIndex(state1);
size_t stateIndex2 = alpha_->getStateIndex(state2);
return property_(stateIndex1, stateIndex2);
if (state1 < 0 || state1 > 19)
throw BadIntException(state1, "AAIndex2Entry::getIndex(). Invalid state1.", alpha_);
if (state2 < 0 || state2 > 19)
throw BadIntException(state2, "AAIndex2Entry::getIndex(). Invalid state2.", alpha_);
double d = property_(static_cast<size_t>(state1), static_cast<size_t>(state2));
return d;
}
double getIndex(const std::string& state1, const std::string& state2) const
{
size_t stateIndex1 = alpha_->getStateIndex(state1);
size_t stateIndex2 = alpha_->getStateIndex(state2);
return property_(stateIndex1, stateIndex2);
return getIndex(alpha_->charToInt(state1), alpha_->charToInt(state2));
}
LinearMatrix<double>* getIndexMatrix() const { return new LinearMatrix<double>(property_); }
......
......@@ -47,7 +47,7 @@
namespace bpp
{
/**
* @brief Volume (Angström^3) of each amino acid, according to http://www.imb-jena.de/IMAGE_AA.html
* @brief Volume (Angström^3) of each amino acid, according to http://www.imb-jena.de/IMAGE_AA.html (Note: original webpage is not available anymore)
*
*
*/
......
......@@ -57,16 +57,17 @@ BLOSUM50::BLOSUM50() :
double BLOSUM50::getIndex(int state1, int state2) const
{
size_t stateIndex1 = alpha_->getStateIndex(state1);
size_t stateIndex2 = alpha_->getStateIndex(state2);
return distanceMatrix_(stateIndex1, stateIndex2);
if (state1 < 0 || state1 > 19)
throw BadIntException(state1, "BLOSUM50::getIndex(). Invalid state1.", alpha_);
if (state2 < 0 || state2 > 19)
throw BadIntException(state2, "BLOSUM50::getIndex(). Invalid state2.", alpha_);
double d = distanceMatrix_(static_cast<size_t>(state1), static_cast<size_t>(state2));
return d;
}
double BLOSUM50::getIndex(const std::string& state1, const std::string& state2) const
{
return distanceMatrix_(
static_cast<size_t>(alpha_->charToInt(state1)),
static_cast<size_t>(alpha_->charToInt(state2)));
return getIndex(alpha_->charToInt(state1), alpha_->charToInt(state2));
}
LinearMatrix<double>* BLOSUM50::getIndexMatrix() const
......
......@@ -63,13 +63,15 @@ GranthamAAChemicalDistance::~GranthamAAChemicalDistance() {}
double GranthamAAChemicalDistance::getIndex(int state1, int state2) const
{
size_t stateIndex1 = alpha_->getStateIndex(state1);
size_t stateIndex2 = alpha_->getStateIndex(state2);
double d = distanceMatrix_(stateIndex1, stateIndex2);
if (state1 < 0 || state1 > 19)
throw BadIntException(state1, "GranthamAAChemicalDistance::getIndex(). Invalid state1.", alpha_);
if (state2 < 0 || state2 > 19)
throw BadIntException(state2, "GranthamAAChemicalDistance::getIndex(). Invalid state2.", alpha_);
double d = distanceMatrix_(static_cast<size_t>(state1), static_cast<size_t>(state2));
if (sign_ == SIGN_NONE)
return NumTools::abs<double>(d);
if (sign_ == SIGN_PC1)
return signMatrix_(stateIndex1, stateIndex2) * NumTools::abs<double>(d);
return signMatrix_(static_cast<size_t>(state1), static_cast<size_t>(state2)) * NumTools::abs<double>(d);
return d;
}
......
......@@ -58,18 +58,17 @@ MiyataAAChemicalDistance::MiyataAAChemicalDistance() :
double MiyataAAChemicalDistance::getIndex(int state1, int state2) const
{
size_t stateIndex1 = alpha_->getStateIndex(state1);
size_t stateIndex2 = alpha_->getStateIndex(state2);
double d = distanceMatrix_(stateIndex1, stateIndex2);
if (state1 < 0 || state1 > 19)
throw BadIntException(state1, "MiyataAAChemicalDistance::getIndex(). Invalid state1.", alpha_);
if (state2 < 0 || state2 > 19)
throw BadIntException(state2, "MiyataAAChemicalDistance::getIndex(). Invalid state2.", alpha_);
double d = distanceMatrix_(static_cast<size_t>(state1), static_cast<size_t>(state2));
return sym_ ? NumTools::abs<double>(d) : d;
}
double MiyataAAChemicalDistance::getIndex(const string& state1, const string& state2) const
{
double d = distanceMatrix_(
static_cast<size_t>(alpha_->charToInt(state1)),
static_cast<size_t>(alpha_->charToInt(state2)));
return sym_ ? NumTools::abs(d) : d;
return getIndex(alpha_->charToInt(state1), alpha_->charToInt(state2));
}
Matrix<double>* MiyataAAChemicalDistance::getIndexMatrix() const
......
......@@ -63,15 +63,15 @@ SimpleScore::SimpleScore(const Alphabet* alphabet, double match, double mismatch
double SimpleScore::getIndex(int state1, int state2) const
{
size_t stateIndex1 = alphabet_->getStateIndex(state1);
size_t stateIndex2 = alphabet_->getStateIndex(state2);
size_t stateIndex1 = alphabet_->getStateIndex(state1)-1;
size_t stateIndex2 = alphabet_->getStateIndex(state2)-1;
return distanceMatrix_(stateIndex1, stateIndex2);
}
double SimpleScore::getIndex(const std::string& state1, const std::string& state2) const
{
size_t stateIndex1 = alphabet_->getStateIndex(state1);
size_t stateIndex2 = alphabet_->getStateIndex(state2);
size_t stateIndex1 = alphabet_->getStateIndex(state1)-1;
size_t stateIndex2 = alphabet_->getStateIndex(state2)-1;
return distanceMatrix_(stateIndex1, stateIndex2);
}
......
......@@ -65,13 +65,13 @@ public:
{}
UserAlphabetIndex1(const UserAlphabetIndex1& uAlph) :
alph_(uAlph.alph_),//->clone()),
alph_(uAlph.alph_),
index_(uAlph.index_)
{}
UserAlphabetIndex1& operator=(const UserAlphabetIndex1& uAlph)
{
alph_ = uAlph.alph_;//->clone();
alph_ = uAlph.alph_;
index_ = uAlph.index_;
return *this;
}
......@@ -83,22 +83,22 @@ public:
public:
double getIndex(int state) const
{
return index_[alph_->getStateIndex(state)];
return index_[alph_->getStateIndex(state)-1];
}
void setIndex(int state, double val)
{
index_[alph_->getStateIndex(state)] = val;
index_[alph_->getStateIndex(state)-1] = val;
}
double getIndex(const std::string& state) const
{
return index_[alph_->getStateIndex(state)];
return index_[alph_->getStateIndex(state)-1];
}
void setIndex(const std::string& state, double val)
{
index_[alph_->getStateIndex(state)] = val;
index_[alph_->getStateIndex(state)-1] = val;
}
std::vector<double>* getIndexVector() const { return new std::vector<double>(index_); }
......
......@@ -87,7 +87,7 @@ vector<int> GeneticCode::getSynonymous(int aminoacid) const
if (translate(i) == aminoacid)
synonymes.push_back(i);
}
catch (StopCodonException)
catch (StopCodonException&)
{ }
}
return synonymes;
......@@ -108,7 +108,7 @@ std::vector<std::string> GeneticCode::getSynonymous(const std::string& aminoacid
if (translate(i) == aa)
synonymes.push_back(codonAlphabet_.intToChar(i));
}
catch (StopCodonException)
catch (StopCodonException&)
{ }
}
return synonymes;
......
......@@ -155,7 +155,7 @@ Sequence* SequenceTools::getComplement(const Sequence& sequence)
Sequence* SequenceTools::transcript(const Sequence& sequence)
{
// Alphabet type checking
if (AlphabetTools::isDNAAlphabet(sequence.getAlphabet()))
if (!AlphabetTools::isDNAAlphabet(sequence.getAlphabet()))
{
throw AlphabetException ("SequenceTools::transcript : Sequence must be DNA", sequence.getAlphabet());
}
......@@ -168,7 +168,7 @@ Sequence* SequenceTools::transcript(const Sequence& sequence)
Sequence* SequenceTools::reverseTranscript(const Sequence& sequence)
{
// Alphabet type checking
if (AlphabetTools::isRNAAlphabet(sequence.getAlphabet()))
if (!AlphabetTools::isRNAAlphabet(sequence.getAlphabet()))
{
throw AlphabetException ("SequenceTools::reverseTranscript : Sequence must be RNA", sequence.getAlphabet());
}
......
......@@ -157,7 +157,7 @@ string BasicSymbolList::getChar(size_t pos) const
{
c = alphabet_->intToChar(content_[pos]);
}
catch(BadIntException bie)
catch(BadIntException& bie)
{
//This should never happen!
}
......@@ -372,7 +372,7 @@ string EdSymbolList::getChar(size_t pos) const
string c = "";
try {
c = alphabet_->intToChar(content_[pos]);
} catch(BadIntException bie) {
} catch(BadIntException& bie) {
//This should never happen!
}
return c;
......