Esempio n. 1
0
    def build(self):
        """Template method for building the repr"""

        self._lines = ElasticLines()

        self._process_header()
        self._process_metadata()
        self._process_positional_metadata()
        self._process_stats()
        self._process_data()

        return self._lines.to_str()
Esempio n. 2
0
    def _build_repr(self, include_name):
        lines = ElasticLines()

        if include_name:
            name_line = self.__class__.__name__
            if len(self.name) > 0:
                name_line += ' (%s)' % self.name
            lines.add_line(name_line)
            lines.add_separator()

        lines.add_line('  AAs  = %s' % str(self._amino_acids))
        lines.add_line('Starts = %s' % str(self._starts))
        base1 = 'U' * 16 + 'C' * 16 + 'A' * 16 + 'G' * 16
        lines.add_line('Base1  = %s' % base1)
        base2 = ('U' * 4 + 'C' * 4 + 'A' * 4 + 'G' * 4) * 4
        lines.add_line('Base2  = %s' % base2)
        base3 = 'UCAG' * 16
        lines.add_line('Base3  = %s' % base3)

        return lines.to_str()
Esempio n. 3
0
 def test_add_lines(self):
     self.el = ElasticLines()
     self.el.add_lines(['alice', 'bob', 'carol'])
     self.assertEqual(self.el.to_str(), 'alice\nbob\ncarol')
Esempio n. 4
0
 def setUp(self):
     self.el = ElasticLines()