X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=blobdiff_plain;f=alg%2Fsequence.hpp;h=80aa49f75e17bcf9ca572de2d9b8c53658ea31af;hp=4b93ef132d81b93e924e153965407b32585c7851;hb=75496e2c562d728af983c347527270eba360c6ee;hpb=b9755e1974201ff513c66b0fd684bde330c6fff6 diff --git a/alg/sequence.hpp b/alg/sequence.hpp index 4b93ef1..80aa49f 100644 --- a/alg/sequence.hpp +++ b/alg/sequence.hpp @@ -103,13 +103,14 @@ public: typedef SeqString::const_reference const_reference; typedef SeqString::size_type size_type; static const size_type npos = SeqString::npos; - enum strand_type { UnknownStrand, PlusStrand, MinusStrand, BothStrand }; - Sequence(AlphabetRef a = reduced_nucleic_alphabet); + Sequence(AlphabetRef a = reduced_dna_alphabet); Sequence(const char* seq, - AlphabetRef a = reduced_nucleic_alphabet); + AlphabetRef a = reduced_dna_alphabet, + SeqSpan::strand_type strand = SeqSpan::PlusStrand); Sequence(const std::string& seq, - AlphabetRef a = reduced_nucleic_alphabet); + AlphabetRef a = reduced_dna_alphabet, + SeqSpan::strand_type strand = SeqSpan::PlusStrand); Sequence(const Sequence& seq); Sequence(const Sequence *); Sequence(const SeqSpanRef&); @@ -125,10 +126,10 @@ public: //! set sequence to a (sub)string containing nothing but AGCTN void set_filtered_sequence(const std::string& seq, - AlphabetRef a, + AlphabetRef a=reduced_dna_alphabet, size_type start=0, size_type count=npos, - strand_type strand=UnknownStrand); + SeqSpan::strand_type strand=SeqSpan::PlusStrand); //! retrive element at specific position const_reference at(size_type i) const { return seq->at(i); } @@ -159,7 +160,9 @@ public: size_type stop() const { return seq->parentStop(); } //! return a subsequence, copying over any appropriate annotation - Sequence subseq(size_type start=0, size_type count = npos) const; + Sequence subseq(size_type start=0, + size_type count = npos, + SeqSpan::strand_type strand = SeqSpan::SameStrand) const; //! reverse a character std::string create_reverse_map() const; //! return a reverse compliment (this needs to be improved?) @@ -234,8 +237,6 @@ public: protected: SeqSpanRef seq; - //! strand orientation - strand_type strand; //! fasta header std::string header; //! species name @@ -259,7 +260,6 @@ protected: template void serialize(Archive& ar, const unsigned int /*version*/) { ar & BOOST_SERIALIZATION_NVP(seq); - ar & BOOST_SERIALIZATION_NVP(strand); ar & BOOST_SERIALIZATION_NVP(header); ar & BOOST_SERIALIZATION_NVP(species); ar & BOOST_SERIALIZATION_NVP(annots);