def test_mask2_wo_terminal_gap_mask(self): obs = mask(self.msa1, self.mask2, "mask", False) seqs = [ skbio.DNA('ACG', metadata=dict(id='s1')), skbio.DNA('AG-', metadata=dict(id='s2')), skbio.DNA('-C-', metadata=dict(id='s3'))] exp = skbio.TabularMSA(seqs, minter='id') self.assertEqual(obs, exp) obs = mask(self.msa1, self.mask2, "caution", False) seqs = [ skbio.DNA('AG', metadata=dict(id='s1')), skbio.DNA('A-', metadata=dict(id='s2')), skbio.DNA('--', metadata=dict(id='s3'))] exp = skbio.TabularMSA(seqs, minter='id') self.assertEqual(obs, exp)
def test_mask4_w_terminal_gap_mask(self): obs = mask(self.msa2, self.mask4, "mask", True) seqs = [ skbio.DNA('NNNGGTGCCA-CC--A', metadata=dict(id='s1')), skbio.DNA('CTCGGTGCCA-CC--A', metadata=dict(id='s2')), skbio.DNA('CTCGGTACCA-CC--A', metadata=dict(id='s3')), skbio.DNA('CTCGGTGCCA-CCGGA', metadata=dict(id='S_4')), skbio.DNA('CTCGGTGCCA-CC--A', metadata=dict(id='seq5.555')), skbio.DNA('CTCGGTGCCA-CC--A', metadata=dict(id='s11'))] exp = skbio.TabularMSA(seqs, minter='id') self.assertEqual(obs, exp) obs = mask(self.msa2, self.mask4, "caution", True) seqs = [ skbio.DNA('NNNGGCCA-CC--A', metadata=dict(id='s1')), skbio.DNA('CTCGGCCA-CC--A', metadata=dict(id='s2')), skbio.DNA('CTCGGCCA-CC--A', metadata=dict(id='s3')), skbio.DNA('CTCGGCCA-CCGGA', metadata=dict(id='S_4')), skbio.DNA('CTCGGCCA-CC--A', metadata=dict(id='seq5.555')), skbio.DNA('CTCGGCCA-CC--A', metadata=dict(id='s11'))] exp = skbio.TabularMSA(seqs, minter='id') self.assertEqual(obs, exp)