Example #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)
Example #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])
Example #3
0
 def test_sequence_iter_msa(self):
     for _ in MultipleSequenceAlignment.from_fasta(string=self.fasta):
         pass
Example #4
0
 def test_json_parsing_msa(self):
     MultipleSequenceAlignment.from_json(string=self.json)
Example #5
0
 def test_fasta_input_output_msa(self):
     seq = MultipleSequenceAlignment.from_fasta(string=self.fasta)
     self.assertEqual(seq.to_fasta(), self.fasta)
Example #6
0
 def test_fasta_parsing_msa(self):
     MultipleSequenceAlignment.from_fasta(string=self.fasta)
Example #7
0
 def test_empty_init_msa(self):
     MultipleSequenceAlignment()
Example #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'])