def test_vcf_to_seqs_indels1(self): input = ['thecontig', '5', '.', 'AT', 'A', '.', '.', '.', 'GT:AD', '0/1:2,10'] actual = assembly.vcf_to_seqs([input], {'thecontig': 10}, ['s1'], min_dp=2) actual = list(actual)[0][1].strip('N') self.assertEqual(actual, 'A') actual = assembly.vcf_to_seqs([input], {'thecontig': 10}, ['s1'], min_dp=2) actual = list(actual)[0][1] self.assertEqual(actual, 'NNNNANNNN')
def test_vcf_to_seqs_indels2(self): ''' More end-to-end indel handling ''' myInputDir = util.file.get_test_input_path(self) input = os.path.join(myInputDir, 'indel.vcf.gz') expected = os.path.join(myInputDir, 'output.fasta') chrlens = {'EBOV_2014_G6060.1': 18962} samples = ['G6060.1'] expected = str(Bio.SeqIO.read(expected, 'fasta').seq) actual = assembly.vcf_to_seqs(util.file.read_tabfile(input), chrlens, samples, min_dp=2) actual = list(actual)[0][1].strip('N') self.assertEqual(actual, expected)