Esempio n. 1
0
File: abi.py Progetto: mizuy/seqtool
def write_svg(filename, output):
    with debug.report_exceptions():
        open(output, 'w').write(AbiFormat(filename).svg())
Esempio n. 2
0
File: abi.py Progetto: mizuy/seqtool
    def get_pbas(self):
        return ''.join(p.decode('utf-8') for p in self.get('PBAS').entries)
    def get_ploc(self):
        return self.get('PLOC').entries
    def get_peaks(self, i):
        return self.get('DATA', 9 + i).entries
    def get_raw_peaks(self, i):
        return self.get('DATA', 1 + i).entries

    def svg(self):
        t = svg.SvgItemsVStack()
        t.add(svg.SvgText(self.get_name()))
        t.add(svg.SvgText('Original Sequencing Result:'))
        t.add(self.view.get_svg_base_peaks(200))
        t.add(svg.SvgText('Reversed-Complemental Result:'))
        t.add(self.rc_view.get_svg_base_peaks(200))

        t.add(svg.SvgItemsFixedHeight(8))
        t.add(svg.SvgText('Raw Data:'))
        t.add(self.view.get_svg_raw_peaks(500))
        return svg.SvgPadding(20, 20, t).svg()

def write_svg(filename, output):
    with debug.report_exceptions():
        open(output, 'w').write(AbiFormat(filename).svg())

if __name__ == '__main__':
    with debug.report_exceptions():
        a = AbiFormat('files/test.ab1')
        open('test.svg', 'w').write(a.svg())