Sequence::Sequence(const char *seq, AlphabetRef alphabet_, SeqSpan::strand_type strand_)
: header(""),
- species("")
+ species(""),
+ motif_list(new MotifList)
{
set_filtered_sequence(seq, alphabet_, 0, npos, strand_);
}
AlphabetRef alphabet_,
SeqSpan::strand_type strand_)
: header(""),
- species("")
+ species(""),
+ motif_list(new MotifList)
{
set_filtered_sequence(seq, alphabet_, 0, seq.size(), strand_);
}
Sequence::Sequence(const SeqSpanRef& seq_ref)
: seq(seq_ref),
header(""),
- species("")
+ species(""),
+ motif_list(new MotifList)
{
}
header.clear();
species.clear();
annots.clear();
- motif_list.clear();
+ motif_list.reset(new MotifList);
}
void
motif_start_i != motif_starts.end();
++motif_start_i)
{
- motif_list.push_back(motif(*motif_start_i, a_motif.get_sequence()));
+ motif_list->push_back(motif(*motif_start_i, a_motif.get_sequence()));
}
}
void Sequence::clear_motifs()
{
- motif_list.clear();
+ if (motif_list)
+ motif_list->clear();
+ else
+ motif_list.reset(new MotifList);
}
-const std::list<motif>& Sequence::motifs() const
+const Sequence::MotifList& Sequence::motifs() const
{
- return motif_list;
+ return *motif_list;
}
std::vector<int>