1 #include "qui/motif_editor/MotifEditor.hpp"
2 #include "alg/alphabet.hpp"
6 MotifElement::MotifElement() :
8 color(Color(1.0,0.0,0.0,1.0)),
9 motif(Sequence::nucleic_alphabet)
13 MotifElement::MotifElement(const Sequence& seq, Color c) :
20 bool MotifElement::isEmpty() const
22 if (motif.get_name().size() == 0 and motif.size() == 0) {
27 //! should we search the analysis for this element?
28 bool MotifElement::isEnabled() const
33 //! set the state for searching the analysis for this element?
34 void MotifElement::setEnabled(bool enabled_)
39 //! return color should this motif be drawn as
40 Color MotifElement::getColor() const
45 //! set what color this motif should be drawn as
46 void MotifElement::setColor(const Color& c)
51 //! return color should this motif be drawn as
52 QColor MotifElement::getQColor() const
55 qcolor.setRgbF(color.r(), color.g(), color.b(), color.a());
59 //! set what color this motif should be drawn as
60 void MotifElement::setQColor(const QColor& c)
62 color = Color(c.redF(), c.greenF(), c.blueF(), c.alphaF());
66 const Sequence& MotifElement::getSequence() const
72 void MotifElement::setSequence(const Sequence& seq)
78 void MotifElement::setSequence(const std::string& seq_text)
80 motif.set_sequence(seq_text, Sequence::nucleic_alphabet);
83 QString MotifElement::getSequenceText() const
85 return QString(motif.get_sequence().c_str());
89 std::string MotifElement::getName() const
91 return motif.get_name();
95 void MotifElement::setName(const std::string& seq_name)
97 motif.set_fasta_header(seq_name);