view test/test_io_emboss.py @ 1168:b556c96c6719
blocks3d/www Makefile: never check certificates of github, they are too confusing for wget
author |
Daniil Alexeyevsky <dendik@kodomo.fbb.msu.ru> |
date |
Mon, 26 May 2014 17:20:29 +0400 |
parents |
|
children |
|
line source
2 from StringIO import StringIO
4 from allpy import protein
6 def test_stringio_conversions():
7 # MSF is not supported by any other handler, except EMBOSS,
8 # so by testing MSF we essentially test EMBOSS
9 a = (protein.Alignment().
10 append_row_from_string("a-c-d", name="Seq1").
11 append_row_from_string("tgcga", name="Seq2"))
16 expect = ">Seq1\nA-C-D\n>Seq2\nTGCGA\n"
17 assert expect == got, "Expected:\n%r\nGot:\n%r" % (expect, got)
22 got = re.sub('(stdout MSF: 5 Type: N) .*', r'\1', got)
24 "!!NA_MULTIPLE_ALIGNMENT 1.0\n"
26 " stdout MSF: 5 Type: N 03/06/11 CompCheck: 1918 ..\n"
28 " Name: Seq1 Len: 5 Check: 882 Weight: 1.00\n"
29 " Name: Seq2 Len: 5 Check: 1036 Weight: 1.00\n"
38 expect = re.sub('(stdout MSF: 5 Type: N) .*', r'\1', expect)
39 assert expect == got, "Expected:\n%r\nGot:\n%r" % (expect, got)
41 o.name = 'whoopie.msf'
43 b = protein.Alignment().append_file(o, format='msf')
44 assert b.rows_as_strings() == ["A-C-D", "TGCGA"]
45 assert b.sequences[0].source == o.name
47 # vim: set et ts=4 sts=4 sw=4: