Exemplo n.º 1
0
 def test_convert_multi_hsps(self):
     blast_outputs = []
     with open(os.path.join(fwd, 'test_data', 'web_multi_hit.xml'),
               'r') as f:
         for r in NCBIXML.parse(f):
             blast_outputs.append(r)
     encoded = [convert_classes.blasttodict(i) for i in blast_outputs]
     encoded_json = json.dumps(encoded)
     encoded = json.loads(encoded_json)
     decoded = [convert_classes.blastfromdict(i) for i in encoded]
     for orig_r, rec_r in zip(blast_outputs, decoded):
         tc.recrusive_compare(orig_r, rec_r)
Exemplo n.º 2
0
 def test_convert_simple(self):
     blast_outputs = []
     with open(
             os.path.join(fwd, 'test_data',
                          'blast_parse_hits_txt_standalone.txt'), 'r') as f:
         for r in blast_parse_txt(f):
             blast_outputs.append(r)
     encoded_original = [
         convert_classes.blasttodict(i) for i in blast_outputs
     ]
     encoded_json = json.dumps(encoded_original)
     encoded = json.loads(encoded_json)
     decoded = [convert_classes.blastfromdict(i) for i in encoded]
     for orig_r, rec_r in zip(blast_outputs, decoded):
         tc.recrusive_compare(orig_r, rec_r)