Пример #1
0
 def test_msa_pop(self):
     msa = MultipleSequenceAlignment.from_fasta(string=self.fasta)
     pop_seq = msa.pop('A')
     self.assertEqual(pop_seq.header, 'A')
     self.assertEqual(pop_seq.sequence, 'ABC')
     self.assertNotIn('A', msa.headers)
     self.assertNotIn('ABC', msa.sequences)
Пример #2
0
 def test_trailing_newline_msa(self):
     fasta = f'{self.fasta}\n'
     seq = MultipleSequenceAlignment.from_fasta(string=fasta)
     self.assertEqual(seq.to_fasta(), fasta[:-1])
Пример #3
0
 def test_sequence_iter_msa(self):
     for _ in MultipleSequenceAlignment.from_fasta(string=self.fasta):
         pass
Пример #4
0
 def test_json_parsing_msa(self):
     MultipleSequenceAlignment.from_json(string=self.json)
Пример #5
0
 def test_fasta_input_output_msa(self):
     seq = MultipleSequenceAlignment.from_fasta(string=self.fasta)
     self.assertEqual(seq.to_fasta(), self.fasta)
Пример #6
0
 def test_fasta_parsing_msa(self):
     MultipleSequenceAlignment.from_fasta(string=self.fasta)
Пример #7
0
 def test_empty_init_msa(self):
     MultipleSequenceAlignment()
Пример #8
0
 def test_msa_batch_rename(self):
     msa = MultipleSequenceAlignment.from_fasta(string=self.fasta)
     msa.batch_rename(self.rename_func)
     self.assertEqual(msa.headers, ['A.test', 'B.test'])