X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=blobdiff_plain;f=alg%2Fsequence.hpp;h=4b93ef132d81b93e924e153965407b32585c7851;hp=09c53c4bf3a1a911e793add0a8730335285b437a;hb=f1724abab87d2e5b160620b10cb81eabf56aadeb;hpb=7d4fbcb6060a60a8ea25ca1303fcaaaf8574f24a diff --git a/alg/sequence.hpp b/alg/sequence.hpp index 09c53c4..4b93ef1 100644 --- a/alg/sequence.hpp +++ b/alg/sequence.hpp @@ -104,15 +104,15 @@ public: typedef SeqString::size_type size_type; static const size_type npos = SeqString::npos; enum strand_type { UnknownStrand, PlusStrand, MinusStrand, BothStrand }; - enum alphabet_ref { reduced_dna_alphabet, reduced_rna_alphabet, reduced_nucleic_alphabet, - nucleic_alphabet, protein_alphabet }; - Sequence(alphabet_ref a = reduced_nucleic_alphabet); - Sequence(const char* seq, alphabet_ref a = reduced_nucleic_alphabet); - Sequence(const std::string& seq, alphabet_ref a = reduced_nucleic_alphabet); + Sequence(AlphabetRef a = reduced_nucleic_alphabet); + Sequence(const char* seq, + AlphabetRef a = reduced_nucleic_alphabet); + Sequence(const std::string& seq, + AlphabetRef a = reduced_nucleic_alphabet); Sequence(const Sequence& seq); Sequence(const Sequence *); - Sequence(const SeqSpanRef&, alphabet_ref a = reduced_nucleic_alphabet); + Sequence(const SeqSpanRef&); ~Sequence(); //! assignment to constant sequences Sequence &operator=(const Sequence&); @@ -125,7 +125,7 @@ public: //! set sequence to a (sub)string containing nothing but AGCTN void set_filtered_sequence(const std::string& seq, - alphabet_ref a, + AlphabetRef a, size_type start=0, size_type count=npos, strand_type strand=UnknownStrand); @@ -166,7 +166,7 @@ public: Sequence rev_comp() const; //! set sequence (filtered) - void set_sequence(const std::string &, alphabet_ref); + void set_sequence(const std::string &, AlphabetRef); //! get sequence std::string get_sequence() const; //! set species name @@ -181,8 +181,6 @@ public: std::string get_name() const; //! return a reference to whichever alphabet we're currently representing const Alphabet& get_alphabet() const; - //! return a reference to whichever alphabet we're currently representing - const Alphabet& get_alphabet(alphabet_ref) const; //! load sequence from fasta file using the sequences current alphabet void load_fasta(const boost::filesystem::path file_path, int seq_num=1, @@ -192,7 +190,7 @@ public: //! \throw sequence_empty_error //! \throw sequence_empty_file_error void load_fasta(const boost::filesystem::path file_path, - alphabet_ref a, + AlphabetRef a, int seq_num=1, int start_index=0, int end_index=0); void load_fasta(std::istream& file, @@ -202,7 +200,7 @@ public: //! \throw sequence_empty_error //! \throw sequence_empty_file_error void load_fasta(std::istream& file, - alphabet_ref a, + AlphabetRef a, int seq_num=1, int start_index=0, int end_index=0); //! load sequence annotations @@ -236,8 +234,6 @@ public: protected: SeqSpanRef seq; - //! which alphabet we're using - alphabet_ref alphabet; //! strand orientation strand_type strand; //! fasta header @@ -263,7 +259,6 @@ protected: template void serialize(Archive& ar, const unsigned int /*version*/) { ar & BOOST_SERIALIZATION_NVP(seq); - ar & BOOST_SERIALIZATION_NVP(alphabet); ar & BOOST_SERIALIZATION_NVP(strand); ar & BOOST_SERIALIZATION_NVP(header); ar & BOOST_SERIALIZATION_NVP(species);