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)
def test_trailing_newline_msa(self): fasta = f'{self.fasta}\n' seq = MultipleSequenceAlignment.from_fasta(string=fasta) self.assertEqual(seq.to_fasta(), fasta[:-1])
def test_sequence_iter_msa(self): for _ in MultipleSequenceAlignment.from_fasta(string=self.fasta): pass
def test_json_parsing_msa(self): MultipleSequenceAlignment.from_json(string=self.json)
def test_fasta_input_output_msa(self): seq = MultipleSequenceAlignment.from_fasta(string=self.fasta) self.assertEqual(seq.to_fasta(), self.fasta)
def test_fasta_parsing_msa(self): MultipleSequenceAlignment.from_fasta(string=self.fasta)
def test_empty_init_msa(self): MultipleSequenceAlignment()
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'])