diff --git a/genotyphi.py b/genotyphi.py index 14b4394..ba7118b 100755 --- a/genotyphi.py +++ b/genotyphi.py @@ -9,7 +9,7 @@ # Dependencies: # SAMtools (v1.2) and bcftools (v1.2) are required to genotype from BAMs. # -# Last modified - December 6th, 2020 +# Last modified - March 20th, 2021 # from argparse import (ArgumentParser, FileType) @@ -20,7 +20,7 @@ import datetime from subprocess import call, check_output, CalledProcessError, STDOUT -__version__ = '1.7.1' +__version__ = '1.8.0' def parse_args(): "Parse the input arguments, use '-h' for help" @@ -59,12 +59,15 @@ def parse_args(): 4215341, 4602946, 3368641, 2245432, 3164162, 3923165, 1811809, 3729635, 3817752, 183033, 1615350, 2342045, 3996717, 2640029, 989024, 3806278, 1611156, 2348902, 1193220, 3694947, 955875, 3498544,2424394,2272144,561056,3164873, - 751854,4680610,2587488] + 751854,4680610,2587488, + 4286788,3967063] + snp_alleles = ['T', 'A', 'C', 'A', 'A', 'T', 'A', 'C', 'T', 'A', 'T', 'T', 'A', 'T', 'T', 'G', 'G', 'A', 'A', 'A', 'T', 'A', 'T', 'A', 'A', 'A', 'A', 'T', 'C', 'A', 'C', 'A', 'A', 'A', 'T', 'T', 'T', 'T', 'G', 'C', 'A', 'T', 'T', 'C', 'C', 'T', 'G', 'A', 'T', 'G', 'C', 'T', 'T', 'A', 'A', 'A', 'T', 'T', 'T', 'T', 'T', 'A', 'T', 'A', 'T', 'A', 'A', 'T', 'C', 'G', 'A','G','A','A','A','A', - 'A','T','A'] + 'A','T','A', + 'T','T'] groups = ['0.1', '0.0.1', '0.0.2', '0.0.3', '0.1.1', '0.1.2', '0.1.3', '1', '1.1', '1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.2', '1.2.1', '2', '2.0.1', '2.0.2', '2.1', '2.1.1', '2.1.2', '2.1.3', '2.1.4', '2.1.5', '2.1.6', '2.1.7', '2.1.8', '2.1.9', '2.2', '2.2.1', '2.2.2', '2.2.3', '2.2.4', '2.3', '2.3.1', '2.3.2', '2.3.3', '2.3.4', @@ -72,7 +75,8 @@ def parse_args(): '3.2.2', '3.3', '3.3.1', '3.4', '3.5', '3.5.1', '3.5.2', '3.5.3', '3.5.4', '4', '4.1', '4.1.1', '4.2', '4.2.1', '4.2.2', '4.2.3', '4.3.1', '4.3.1.1', '4.3.1.2', '4.3.1.1.P1', '3.3.2','3.3.2.Bd1','3.3.2.Bd2','4.3.1.3','2.5.2', - '4.3.1.1.EA1','4.3.1.2.EA2','4.3.1.2.EA3'] + '4.3.1.1.EA1','4.3.1.2.EA2','4.3.1.2.EA3', + '2.1.7.1','2.1.7.2'] ### QRDR SNP definitions @@ -215,6 +219,12 @@ def parseGeno(this_groups, proportions): if ('3.3.2.Bd2' in subclades) and ('3.3.2' in subclades): subclades.remove('3.3.2') + # fix 2.1.7/2.1.7.1/2.1.7.2 nesting + if ('2.1.7.1' in subclades) and ('2.1.7' in subclades): + subclades.remove('2.1.7') + if ('2.1.7.2' in subclades) and ('2.1.7' in subclades): + subclades.remove('2.1.7') + # fix 2.3, 2.2 nesting if ('2.2' in clades) and ('2.3' in clades): clades.remove('2.2')