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&);
//! 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);
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
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,
//! \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,
//! \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
protected:
SeqSpanRef seq;
- //! which alphabet we're using
- alphabet_ref alphabet;
//! strand orientation
strand_type strand;
//! fasta header
template<class Archive>
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);