--- title: Core module keywords: fastai sidebar: home_sidebar summary: "API details" description: "API details" nb_path: "nbs/00_Core.ipynb" ---
{% raw %}
{% endraw %} {% raw %}
!which python
/home/yh3455/miniconda3/envs/seqpy3v0/bin/python
{% endraw %}

1. parameters

{% raw %}
from SEQLinkage.Main import *
{% endraw %}

args = Args().parser.parse_args(['--fam','../sample_i/rare_positions/sample_i_coding.hg38_multianno.fam', '--vcf', '../sample_i/rare_positions/sample_i_coding.hg38_multianno.vcf.gz', '--blueprint','./data/vipgenemap.hg38.txt','-f','MERLIN', '--tempdir','./Tempdir_s1', '--build', 'hg38', '--freq', 'AF', '-K', '0.001', '--moi', 'AD', '-W', '0', '-M', '1', '--theta-max', '0.5', '--theta-inc', '0.05','--run-linkage', '--output', './testseqlink'])

args = Args().parser.parse_args(['--fam','../sample_i/rare_positions/sample_i_coding.hg38_multianno.fam', '--vcf', '../sample_i/vcf/small_sample_i.vcf.gz', '--blueprint','./data/vipgenemap.hg38.txt','-f','MERLIN', '--tempdir','./Tempdir_s1', '--build', 'hg38', '--freq', 'AF', '-K', '0.001', '--moi', 'AD', '-W', '0', '-M', '1', '--theta-max', '0.5', '--theta-inc', '0.05','--run-linkage', '--output', './testseqlink'])

args = Args().parser.parse_args(['--fam','./seqlinkage-example/seqlinkage-example.fam','--vcf','./seqlinkage-example/seqlinkage-example.vcf.gz','-f','MERLIN', '--tempdir','./seqlinkage-example/tmprst', '--build','hg19','--blueprint','./seqlinkage-example/twogenomap.txt','--freq','EVSEAAF','-K','0.001','--moi','AR','-W','0','-M','1', '--theta-max','0.5','--theta-inc','0.05','--run-linkage','--output','./seqlinkage-example/tsq20211130'])

?shoud we set mle parameter as true?

args = Args().parser.parse_args(['--fam','../MWE/sample2_uniq.fam', '--vcf', '../MWE/sample_ii_coding.hg38_multianno.vcf.gz', '--blueprint','../MWE/genemap.hg38.txt', '--chrom-prefix','1','-f','MERLIN', '--tempdir','./Tempdir', '--build', 'hg38', '--freq', 'AF', '-K', '0.001', '--moi', 'AD', '-W', '0', '-M', '1', '--theta-max', '0.5', '--theta-inc', '0.05','--run-linkage', '--output', './testseqlink1105'])

args = Args().parser.parse_args('--bin 1 --fam ../seqlinkage-example/seqlinkage-example.fam --vcf ../seqlinkage-example/seqlinkage-example.vcf.gz -f MERLIN --blueprint ../data/genemap.txt --freq EVSEAAF'.split())

args = Args().parser.parse_args('--bin 1 --fam ../data/mwe_normal_fam.csv --vcf ../data/first1000snp_full_samples.vcf.gz --anno ../data/first1000_chr1_multianno.csv --pop ../data/full_sample_fam_pop.txt -f MERLIN --blueprint ../data/genemap.hg38.txt --freq AF'.split())

args = Args().parser.parse_args('--fam ../data/new_trim_ped_fam.fam --vcf ../data/first1000snp_full_samples.vcf.gz -f MERLIN --blueprint ../data/genemap.hg38.txt --freq AF'.split())

{% raw %}
args = Args().parser.parse_args('--fam ../data/mwe_normal_fam.csv --vcf /mnt/mfs/statgen/alzheimers-family/linkage_files/geno/full_sample/vcf/full_sample.vcf.gz --anno ../MWE/annotation/EFIGA_NIALOAD_chr19.hg38.hg38_multianno.csv --pop ../data/full_sample_fam_pop.txt -f MERLIN MEGA2 PLINK LINKAGE --build hg38 --freq AF -o data/mwechr19data -K 0.001 --moi AD -W 0 -M 1 --run-linkage -j 8'.split())
{% endraw %} {% raw %}
args
Namespace(bin=0, blueprint=None, single_markers=False, tfam='../data/mwe_normal_fam.csv', vcf='/mnt/mfs/statgen/alzheimers-family/linkage_files/geno/full_sample/vcf/full_sample.vcf.gz', anno='../MWE/annotation/EFIGA_NIALOAD_chr19.hg38.hg38_multianno.csv', pop='../data/full_sample_fam_pop.txt', build='hg38', prephased=False, freq='AF', freq_by_fam=None, mle=False, rvhaplo=False, recomb_max=1, recomb_cross_fam=False, rsq=0.0, include_vars=None, maf_cutoff=1.0, chr_prefix=None, output='data/mwechr19data', format=['MERLIN', 'MEGA2', 'PLINK', 'LINKAGE'], prevalence=0.001, inherit_mode='AD', wild_pen=0.0, muta_pen=1.0, theta_max=0.5, theta_inc=0.05, run_linkage=True, output_limit=10, jobs=8, tempdir=None, vanilla=True, quiet=False, debug=False, no_save=False, func=<function main at 0x2aafe38e5040>)
{% endraw %}

2.from Core import deepcopy

{% raw %}
{% endraw %}

3. RData class

{% raw %}
anno = pd.read_csv('../data/first1000_chr1_multianno.csv')
{% endraw %} {% raw %}
anno = anno[['Chr','Start','Otherinfo1','Ref','Alt','AF','AF_afr','AF_ami','AF_amr','AF_asj','AF_eas','AF_fin','AF_nfe','AF_oth','AF_sas']]
{% endraw %} {% raw %}
anno.index = anno.Otherinfo1
{% endraw %} {% raw %}
tmp = anno[(anno.Start>100) & (anno.Start<20000)]
{% endraw %} {% raw %}
anno = anno.replace('.',np.nan)
anno = anno.replace(0,np.nan)
{% endraw %} {% raw %}
tmp.iloc[2,5:].any()
False
{% endraw %} {% raw %}
fam_pop_file = '../data/full_sample_fam_pop.txt'
fam_pop = pd.read_csv(fam_pop_file,delim_whitespace=True,header=None,index_col=0,squeeze=True).to_dict()
{% endraw %} {% raw %}
['Chr']+list(set(fam_pop.values()))
['Chr', nan, 'AF_afr', 'AF_nfe', 'AF_amr']
{% endraw %} {% raw %}
tmp = data.genotype_all['1036_3']
{% endraw %} {% raw %}

class RData[source]

RData(vcf, tfam, anno_file=None, fam_pop_file=None, ind_sample_file=None, allele_freq_info=None) :: dict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

{% endraw %} {% raw %}
{% endraw %}

4.RegionExtractor class

{% raw %}
class RegionExtractor:
    '''Extract given genomic region from VCF
    converting genotypes into dictionary of
    genotype list'''
    def __init__(self, filename, build = env.build, chr_prefix = None, allele_freq_info = None, include_vars_file=None):
        self.vcf = cstatgen.VCFstream(filename)
        self.chrom = self.startpos = self.endpos = self.name = None
        self.chr_prefix = chr_prefix
        # name of allele frequency meta info
        self.af_info = allele_freq_info
        self.xchecker = PseudoAutoRegion('X', build)
        self.ychecker = PseudoAutoRegion('Y', build)
        self.include_vars_file = include_vars_file

    def apply(self, data):
        # Clean up
        data.reset()
        data.chrom = self.chrom
        self.vcf.Extract(self.chrom, self.startpos, self.endpos)
        varIdx = 0
        # for each variant site
        while (self.vcf.Next()):
            # skip tri-allelic sites
            if not self.vcf.IsBiAllelic():
                with env.triallelic_counter.get_lock():
                    env.triallelic_counter.value += 1
                continue
            if len(data.variants) > 0:
                if self.vcf.GetPosition()==data.variants[-1][1]:
                    continue
            # check if the line's sample number matches the entire VCF sample number
            if not self.vcf.CountSampleGenotypes() == self.vcf.sampleCount:
                raise ValueError('Genotype and sample mismatch for region {}: {:,d} vs {:,d}'.\
                             format(self.name, self.vcf.CountSampleGenotypes(), self.vcf.sampleCount))
            # valid line found, get variant info
            try:
                if type(self.af_info) is list:
                    maf = []
                    large_maf = []
                    for pop_info in self.af_info:
                        large_maf.append(False)
                        try:
                            maf.append(float(self.vcf.GetInfo(pop_info)))
                        except ValueError:
                            maf.append(0.0)
                    for idx in range(len(maf)):
                        if maf[idx] > 0.5:
                            large_maf[idx]=True
                            maf[idx] = 1-maf[idx]
                else:
                    large_maf=False
                    try:
                        maf = float(self.vcf.GetInfo(self.af_info)) if self.af_info else None
                    except ValueError:
                        maf = 0.0
                    if maf > 0.5:
                        large_maf=True
                        maf = 1 - maf
            except Exception:
                raise ValueError("VCF line {}:{} does not have valid allele frequency field {}!".\
                                 format(self.vcf.GetChrom(), self.vcf.GetPosition(), self.af_info))
            data.variants.append([self.vcf.GetChrom(), self.vcf.GetPosition(), self.name, maf])
            # for each family assign member genotype if the site is non-trivial to the family
            for k in data.families:
                gs = self.vcf.GetGenotypes(data.famsampidx[k])
                if len(data.freq_by_fam) > 0:
                    popidx=self.af_info.index(data.freq_by_fam[k])
                    if large_maf[popidx]:
                        tmpgs=[]
                        for tmpg in gs:
                            if tmpg=='00':
                                tmpgs.append(tmpg)
                            else:
                                tmpgs.append(''.join([str(3-int(tg)) for tg in tmpg]))
                        gs=tuple(tmpgs)
                else:
                    if large_maf:
                        tmpgs=[]
                        for tmpg in gs:
                            if tmpg=='00':
                                tmpgs.append(tmpg)
                            else:
                                tmpgs.append(''.join([str(3-int(tg)) for tg in tmpg]))
                        gs=tuple(tmpgs)
                for person, g in zip(data.families[k], gs):
                    data.genotype_all[person].append(g)
                if len(set(''.join(gs))) <= 1:
                    # skip monomorphic gs
                    continue
                else:
                    if len(set(''.join([x for x in gs if x != "00"]))) <= 1:
                        data.wtvar[k].append(varIdx)
                    # this variant is found in the family
                    data.famvaridx[k].append(varIdx)
                    for person, g in zip(data.families[k], gs):
                        data[person].append(g)
            varIdx += 1
        #
        if varIdx == 0:
            return 1
        else:
            if not self.include_vars_file is None:
                with open(self.include_vars_file) as invar_fh:
                    for invar_line in invar_fh:
                        chrom, pos = invar_line.split()
                        for vidx,v in enumerate(data.variants):
                            if v[0] == chrom and v[1] == int(pos):
                                data.include_vars.append("{}".format(pos))
                                break
            else:
                data.include_vars = ["{}".format(item[1]) for item in data.variants]
            with env.variants_counter.get_lock():
                env.variants_counter.value += varIdx
            return 0


    def getRegion(self, region):
        self.chrom, self.startpos, self.endpos, self.name = region[:4]
        self.startpos = int(self.startpos)
        self.endpos = int(self.endpos) + 1
        if self.chrom in ['X','23']:
            if self.xchecker.check(self.startpos) or self.xchecker.check(self.endpos):
                self.chrom = 'XY'
        if self.chrom in ['Y','24']:
            if self.ychecker.check(self.startpos) or self.ychecker.check(self.endpos):
                self.chrom = 'XY'
        if self.chr_prefix and not self.chrom.startswith(self.chr_prefix):
            self.chrom = self.chr_prefix + self.chrom
{% endraw %}

5.MarkerMaker class

{% raw %}
class MarkerMaker:
    def __init__(self, wsize, maf_cutoff = None,single_markers=False,recomb_max = 1,af_info=None,freq_by_fam=False,rsq=0.0,mle=False,rvhaplo=False,recomb_perfam=True):
        self.missings = ("0", "0")
        self.gtconv = {'1':0, '2':1}
        self.recomb_max = recomb_max
        self.haplotyper = cstatgen.HaplotypingEngine(verbose = env.debug)
        self.af_info = af_info
        self.freq_by_fam = freq_by_fam
        self.rsq=rsq
        self.mle=mle          #use MLE estimate from families for MAF
        self.count= not mle   #count founder alleles to estimate MAF
        self.rvhaplo=rvhaplo
        self.recomb_perfam=recomb_perfam
        if wsize == 0 or wsize >= 1:
            self.r2 = None
        else:
            self.r2 = wsize
        self.coder = cstatgen.HaplotypeCoder(wsize)
        self.maf_cutoff = maf_cutoff
        self.single_markers = single_markers
        self.name = None

    def apply(self, data):
        # temp raw haplotype, maf and variant names data
        haplotypes = OrderedDict()
        mafs = {}   ##Per fam per variant
        uniq_vars = []
        exclude_vars = []
        varnames = {}
        recombPos = {}
        #try:
            # haplotyping plus collect found allele counts
            # and computer founder MAFS
        self.__Haplotype(data, haplotypes, mafs, varnames,recombPos,uniq_vars,exclude_vars)
        print('__Haplotype',haplotypes, mafs, varnames,recombPos,uniq_vars,exclude_vars)
        self.haplotypes, self.mafs, self.varnames = haplotypes, mafs, varnames  ###anno
        if len(varnames):
            if not any ([len(varnames[x]) - 1 for x in varnames]):
                # all families have only one variant
                self.__AssignSNVHaplotypes(data, haplotypes, mafs, varnames)
            else:
                # calculate LD clusters using founder haplotypes
                clusters = self.__ClusterByLD(data, haplotypes, varnames)
                # recoding the genotype of the region
                self.__CodeHaplotypes(data, haplotypes, mafs, varnames, clusters)
    #except Exception as e:
        #    if env.debug:
        #        raise
        #    return -1
        self.__FormatHaplotypes(data,recombPos,varnames,uniq_vars)
        return 0

    def __getMLEfreq(self,data, markers_to_analyze, pos_all, families, rsq, output_log):
        output_sample=[]
        mle_mafs={}
        if len(markers_to_analyze)==0:
            return mle_mafs
        for fam in families:
            for person in data.tfam.sort_family(fam):
                output_sample.append([])
                last_ele=len(output_sample)-1
                output_sample[last_ele] = data.tfam.samples[person][:-1]
                if person in data.samples:
                    for marker in markers_to_analyze:
                        idx=int(marker.split('-')[0][1:])
                        output_sample[last_ele].append(data.genotype_all[person][idx])
                else:
                    output_sample[last_ele].extend(["00"] * len(markers_to_analyze))
        with stdoutRedirect(to = output_log):
            af = self.haplotyper.Execute(data.chrom, markers_to_analyze, pos_all, output_sample, rsq, output_log,False)
        with open(output_log) as mle_fh:
            for line in mle_fh:
                if line.startswith('V'):
                    tmp_eles = line.split(':')
                    if tmp_eles[0] not in mle_mafs:
                        freqs=tmp_eles[1].split()
                        mle_maf = float(freqs[1])
                        if mle_maf>0.5:
                            mle_mafs[tmp_eles[0]]=float("%.9f"%(1-mle_maf))
                        else:
                            #alt allele is more frequent
                            mle_mafs[tmp_eles[0]]=float("%.9f"%mle_maf)
                            marker_idx=int(tmp_eles[0].split('-')[0][1:])
                            for fam in families:
                                if marker_idx not in data.famvaridx[fam]:
                                    continue
                                tmp_famvaridx=data.famvaridx[fam].index(marker_idx)
                                for person in data.families[fam]:
                                    tmpg=data.genotype_all[person][marker_idx]
                                    tmpg_switch=''.join([str(3-int(tg)) for tg in tmpg]) if tmpg!='00' else tmpg
                                    data.genotype_all[person][marker_idx]=tmpg_switch
                                    tmpg2=data[person][tmp_famvaridx]
                                    tmpg_switch2=''.join([str(3-int(tg)) for tg in tmpg2]) if tmpg2!='00' else tmpg2
                                    data[person][tmp_famvaridx]=tmpg_switch2
        return mle_mafs

    def __computefounderfreq(self,data, families):
        #count founder alleles to estimate MAF
        total_founder_alleles=0
        tmp_haplotypes=OrderedDict()
        tmp_mafs={}
        for item in families:
            tmp_haplotypes[item] = self.__PedToHaplotype(data.getFamSamples(item))
            # count founder alleles
            for hap in tmp_haplotypes[item]:
                if not data.tfam.is_founder(hap[1]):
                    continue
                total_founder_alleles+=1.0
                for idxv, v in enumerate(data.getFamVariants(item,style="map")[0]):
                    if v not in tmp_mafs:
                        # [#alt, #haplotypes]
                        tmp_mafs[v] = [0, 0]
                    gt = hap[2 + idxv][1] if hap[2 + idxv][0].isupper() else hap[2 + idxv][0]
                    if not gt == "?":
                    #genotyped
                        tmp_mafs[v][0] += self.gtconv[gt]
                    else:
                    #genotype is missing
                        tmp_mafs[v][1] -= 1.0
        #compute MAFs based on counts
        for v in tmp_mafs:
            if type(tmp_mafs[v]) is not list:
                continue
            tmp_mafs[v] = tmp_mafs[v][0] / (tmp_mafs[v][1]+total_founder_alleles) if tmp_mafs[v][1]+total_founder_alleles > 0 else 0.0
        return tmp_mafs

    def __Haplotype(self, data, haplotypes, mafs, varnames,recombPos,uniq_vars,exclude_vars):
        '''genetic haplotyping. haplotypes stores per family data'''
        # FIXME: it is SWIG's (2.0.12) fault not to properly destroy the object "Pedigree" in "Execute()"
        # So there is a memory leak here which I tried to partially handle on C++
        #
        # Per family haplotyping
        #
        self.markers = ["V{}-{}".format(idx, item[1]) for idx, item in enumerate(data.variants)]
        for item in data.families:
            varnames[item], positions, vcf_mafs = data.getFamVariants(item, style = "map")
            if len(varnames[item]) == 0:
                for person in data.families[item]:
                    data[person] = self.missings
                continue
            if env.debug:
                with env.lock:
                    sys.stderr.write('\n'.join(['\t'.join(x) for x in data.getFamSamples(item)]) + '\n\n')
            # haplotyping
            self.hap = {}
            with env.lock:
                if not env.prephased:
                    tmp_log_output=env.tmp_log + str(os.getpid()) 
                    #with stdoutRedirect(to = tmp_log_output + '.log'):
                    haplotypes[item] = self.haplotyper.Execute(data.chrom, varnames[item], sorted(positions), 
                                                                   data.getFamSamples(item), self.rsq, tmp_log_output)[0]
                    print('haplotyper execute',item,haplotypes[item])
                    self.hap[item] = haplotypes[item]
                else:
                    haplotypes[item] = self.__PedToHaplotype(data.getFamSamples(item))
           
            if len(haplotypes[item]) == 0:
                # C++ haplotyping implementation failed
                with env.chperror_counter.get_lock():
                    env.chperror_counter.value += 1
            # either use privided MAF or computer MAF
            if all(vcf_mafs):
                for idx, v in enumerate(varnames[item]):
                    if v not in mafs:
                        mafs[v] = vcf_mafs[idx]
            else:
                # count founder alleles
                for hap in haplotypes[item]:
                    if not data.tfam.is_founder(hap[1]):
                        continue
                    for idxv, v in enumerate(varnames[item]):
                        if v not in mafs:
                            # [#alt, #haplotypes]
                            mafs[v] = [0, 0]
                        gt = hap[2 + idxv][1] if hap[2 + idxv][0].isupper() else hap[2 + idxv][0]
                        if not gt == "?":
                            mafs[v][0] += self.gtconv[gt]
                            mafs[v][1] += 1.0
        #
        # Compute founder MAFs
        #
        for v in mafs:
            if type(mafs[v]) is not list:
                continue
            mafs[v] = mafs[v][0] / mafs[v][1] if mafs[v][1] > 0 else 0.0
        if env.debug:
            with env.lock:
                print("variant mafs = ", mafs, "\n", file = sys.stderr)
        #
        # Drop some variants if maf is greater than given threshold
        #
        if self.maf_cutoff is not None:
            exclude_vars = []
            for v in mafs.keys():
                if mafs[v] > self.maf_cutoff:
                    exclude_vars.append(v)
            for i in haplotypes.keys():
                haplotypes[i] = listit(haplotypes[i])
                for j in range(len(haplotypes[i])):
                    haplotypes[i][j] = haplotypes[i][j][:2] + \
                      [x for idx, x in enumerate(haplotypes[i][j][2:]) if varnames[i][idx] not in exclude_vars]
                varnames[i] = [x for x in varnames[i] if x not in exclude_vars]
                # handle trivial data
                if len(varnames[i]) == 0:
                    for person in data.families[i]:
                        data[person] = self.missings
                    del varnames[i]
                    del haplotypes[i]
            # count how many variants are removed
            with env.commonvar_counter.get_lock():
                env.commonvar_counter.value += len(exclude_vars)

    def __ClusterByLD(self, data, haplotypes, varnames):
        if self.r2 is None:
            return None
        # get founder haplotypes
        founder_haplotypes = []
        markers = sorted(set(itertools.chain(*varnames.values())), key = lambda x: int(x.split("-")[0][1:]))
        for item in haplotypes:
            for ihap, hap in enumerate(haplotypes[item]):
                if not data.tfam.is_founder(hap[1]):
                    continue
                gt = [hap[2 + varnames[item].index(v)] if v in varnames[item] else '?' for v in markers]
                founder_haplotypes.append(("{}-{}".format(hap[1], ihap % 2), "".join([x[1] if x[0].isupper() else x[0] for x in gt])))
        # calculate LD blocks, use r2 measure
        ld = Align.create(founder_haplotypes).matrixLD(validCharacters="12")["r2"]
        blocks = []
        for j in ld:
            block = [j]
            for k in ld[j]:
                if ld[j][k] > self.r2:
                    block.append(k)
            if len(block) > 1:
                blocks.append(block)
        self.ld, self.blocks = ld, blocks
        # get LD clusters
        clusters = [[markers[idx] for idx in item] for item in list(connected_components(blocks))]
        if env.debug:
            with env.lock:
                print("LD blocks: ", blocks, file = sys.stderr)
                print("LD clusters: ", clusters, file = sys.stderr)
        return clusters


    def __CodeHaplotypes(self, data, haplotypes, mafs, varnames, clusters):
        # apply CHP coding
        for item in data.famvaridx:
            if item not in haplotypes and data[data.families[item][0]] != ('0','0'):
                # when only wild-type haplotypes are present in a family, still code them instead of ignoring the family
                if self.freq_by_fam:
                    pop=data.freq_by_fam[item]
                    try:
                        varnames[item]=data.total_varnames[pop]
                        mafs[item]=data.total_mafs[pop]
                    except:
                        continue
                else:
                    varnames[item]=data.total_varnames['pop']
                    mafs[item]=data.total_mafs
                haplotypes[item]=[]
                for person in data.families[item]:
                    tmp_person=[item, person]
                    if '00' in data[person]:
                        tmp_person+=['?:']*len(varnames[item])
                    else:
                        tmp_person+=['1:']*len(varnames[item])
                    haplotypes[item].append(tmp_person)
                    haplotypes[item].append(tmp_person)
            elif item in haplotypes:
                nonvar_hap_flag=False
                #determine if wild-type haplotype is present in a family
                for hap in haplotypes[item]:
                    tmp_genes=[]
                    for tmpa in hap[2:]:
                        if 'A' in tmpa or 'B' in tmpa:
                            tmp_genes.append(tmpa[1])
                        else:
                            tmp_genes.append(tmpa[0])
                    if set(tmp_genes)==set(['1']):
                        #non variant haplotype
                        nonvar_hap_flag=True
                        break
                if not nonvar_hap_flag:
                    #if family don't have wild-type haplotype, add a fake one to ensure correct coding
                    var_num=len(varnames[item])
                    fake_person=[item, 'FAKEPERSON']+['1:']*var_num
                    haplotypes[item].append(fake_person)
                for hidx,hap in enumerate(haplotypes[item]):
                    if hap[1] in data.missing_persons:
                        missing_person=[item,hap[1]]+['?:']*len(varnames[item])
                        haplotypes[item][hidx]=missing_person

        if not clusters is None:
            clusters_idx = [[[varnames[item].index(x) for x in y] for y in clusters] for item in haplotypes]
        else:
            clusters_idx = [[[]] for item in haplotypes]
        if env.debug:
            for item in haplotypes:
                with env.lock:
                    print(varnames[item],file=sys.stderr)
                    print("hap{0}\t{1}\n".format(item,haplotypes[item]),file=sys.stderr)
        self.coder.Execute(haplotypes.values(), [[mafs[item][v] for v in varnames[item]] for item in haplotypes], clusters_idx)
        if env.debug:
            with env.lock:
                if clusters:
                    print("Family LD clusters: ", clusters_idx, "\n", file = sys.stderr)
                self.coder.Print()
        # line: [fid, sid, hap1, hap2]
        for line in self.coder.GetHaplotypes():
            if not line[1] in data:
                # this sample is not in VCF file. Every variant site should be missing
                # they have to be skipped for now
                continue
            data[line[1]] = (line[2].split(','), line[4].split(','))
            #sub-region count for each sample individual
            superMarkerCount=len(data[line[1]][0])
            if line[0] not in data.patterns:
                data.patterns[line[0]]=[[] for x in range(superMarkerCount)]
            for t_Marker in range(superMarkerCount):
                t_pat1=line[3].split(',')[t_Marker]
                t_pat2=line[5].split(',')[t_Marker]
                if t_pat1 not in data.patterns[line[0]][t_Marker]:
                    data.patterns[line[0]][t_Marker].append(t_pat1)
                if t_pat2 not in data.patterns[line[0]][t_Marker]:
                    data.patterns[line[0]][t_Marker].append(t_pat2)
            if len(data[line[1]][0]) > data.superMarkerCount:
                data.superMarkerCount = len(data[line[1]][0])
        # get MAF
        for item in data.famvaridx:
            if item not in haplotypes:
                for person in data.families[item]:
                    data[person]=(['0']*data.superMarkerCount,['0']*data.superMarkerCount)
        for item in haplotypes:
            data.maf[item] = self.coder.GetAlleleFrequencies(item)
            if not len(data.maf[item][0]):
                continue
            data.varnames_by_fam[item]=varnames[item]
            wt_maf=0
            if self.freq_by_fam:
                try:
                    wt_maf=data.wt_maf[data.freq_by_fam[item]]
                except:
                    pass
            else:
                wt_maf=data.wt_maf['pop']
            tmp_data_maf=[]
            for v in data.maf[item]:
                if len(v)==1:
                    tmp_data_maf.append((v[0],1-v[0]))
                else:
                    if np.sum(v)<1:
                        tmp_ratio=sum(v[1:])/(1-wt_maf)
                        tmp_list=[wt_maf]
                        if tmp_ratio==0:
                            tmp_list.append(1-wt_maf)
                        else:
                            for tmpv in v[1:]:
                                tmp_list.append(tmpv/tmp_ratio)
                        tmp_data_maf.append(tuple(tmp_list))
                    else:
                        tmp_data_maf.append(v)
            data.maf[item]=tuple(tmp_data_maf)
        if env.debug:
            with env.lock:
                print("marker freqs = ", data.maf, "\n", file = sys.stderr)


    def __AssignSNVHaplotypes(self, data, haplotypes, mafs, varnames):
        for item in haplotypes:
            # each person's haplotype
            data.varnames_by_fam[item]=varnames[item]
            token = ''
            for idx,line in enumerate(haplotypes[item]):
                if line[1] in data.missing_persons:
                    data[line[1]]=('0','0')
                else:
                    if not idx % 2:
                        token = line[2][1] if line[2][0].isupper() else line[2][0]
                        if token=='?':
                            token='0'
                    else:
                        tmp_token = line[2][1] if line[2][0].isupper() else line[2][0]
                        if tmp_token=='?':
                            tmp_token='0'
                        data[line[1]] = (token, tmp_token)

            # get MAF
            data.maf[item] = [(1 - mafs[item][varnames[item][0]], mafs[item][varnames[item][0]])]
            data.maf[item] = tuple(tuple(np.array(v) / np.sum(v)) if np.sum(v) else v
                              for v in data.maf[item])
        for item in data.famvaridx:
            if item not in haplotypes and data[data.families[item][0]] != ('0','0'):
                for person in data.families[item]:
                    if '00' in data[person]:
                        data[person]=('0','0')
                    else:
                        data[person]=('1','1')
                t_maf=0
                if self.freq_by_fam:
                    try:
                        t_maf=data.wt_maf[data.freq_by_fam[item]]
                    except:
                        for person in data.families[item]:
                            data[person]=('0','0')
                else:
                    t_maf=data.wt_maf['pop']
                data.maf[item]=((t_maf,1-t_maf),)
        if env.debug:
            with env.lock:
                print("marker freqs = ", data.maf, "\n", file = sys.stderr)


    def __FormatHaplotypes(self, data,recombPos,varnames,uniq_vars):
        # Reformat sample genotypes
        ## Linhai Edit: Reformat to deal with recombination events in families
        if self.recomb_perfam:
            #code recombination per family basis, no need to consider overlap across families
            for person in data:
                if type(data[person]) is not tuple:
                    data[person] = self.missings
                    continue
                diff = data.superMarkerCount - len(data[person][0])
                data[person] = zip(*data[person])
                if diff > 0:
                    data[person].extend([self.missings] * diff)
        else:
            #code recombination across families to generate sub-regions that extend across families
            tmp_combined_recombPos={}
            sorted_var = sorted(uniq_vars, key=lambda x: int(x.split('-')[0][1:]))
            for fam in data.maf.keys():
                if len(data.maf[fam])>1:
                    for pair in sorted(recombPos[fam].keys(), key=lambda x:(sorted_var.index(x[0]),sorted_var.index(x[1]))):
                        if pair[1] == varnames[fam][0]:
                            ##remove recombination event if occurred at 1st RV
                            del recombPos[fam][pair]
                            continue
                        if fam not in tmp_combined_recombPos:
                            tmp_combined_recombPos[fam]=[pair]
                        else:
                            tmp_combined_recombPos[fam].append(pair)
            tmp_all_recombs=[pair for pairs in tmp_combined_recombPos.values() for pair in pairs]
            sorted_combined_recombPos=sorted(list(set(tmp_all_recombs)),key=lambda x:(sorted_var.index(x[0]),sorted_var.index(x[1])))
            recomb_fams=tmp_combined_recombPos.keys()
            ##get sub-regions that applies to all families
            for varidx,variant in enumerate(sorted_var):
                included_fams=len(recomb_fams)
                for recomb_region in sorted_combined_recombPos:
                    if varidx > sorted_var.index(recomb_region[0]) and varidx < sorted_var.index(recomb_region[1]):
                        ##if the variant is in a recombination region
                        included_fams-=1
                if included_fams==len(recomb_fams):
                    if data.combined_regions==[]:
                        data.combined_regions.append([variant])
                    else:
                        if sorted_var.index(data.combined_regions[-1][-1])==varidx-1:
                            neighbour_recomb_flag=False
                            for recomb_region in sorted_combined_recombPos:
                                recomb_idx=sorted_var.index(recomb_region[1])
                                if recomb_idx==varidx:
                                    neighbour_recomb_flag=True
                                    break
                                elif recomb_idx>varidx:
                                    break
                            if neighbour_recomb_flag:
                                data.combined_regions.append([variant])
                            else:
                                data.combined_regions[-1].append(variant)
                        else:
                            data.combined_regions.append([variant])
            ##Get the markers in families compliant with the sub_regions
            for sub_region in data.combined_regions:
                markers={}
                for fam in recomb_fams:
                    pidx=0
                    for pair in sorted(recombPos[fam].keys(), key=lambda x:(sorted_var.index(x[0]),sorted_var.index(x[1]))):
                        sub_region_start=sorted_var.index(sub_region[0])
                        sub_region_end=sorted_var.index(sub_region[-1])
                        recomb_start=sorted_var.index(pair[0])
                        recomb_end=sorted_var.index(pair[1])
                        if sub_region_end <= recomb_start:
                            markers[fam]=pidx
                            break
                        elif sub_region_end > recomb_start and sub_region_start>recomb_start and sub_region_end<recomb_end:
                            ##within the recombination region
                            markers[fam]=None
                            break
                        pidx+=1
                    if fam not in markers:
                        markers[fam]=pidx
                data.complied_markers.append(markers)
            data.superMarkerCount=len(data.combined_regions)
            #coordinates for sub_regions
            data.coordinates_by_region=[(int(sub_region[0].split('-')[1])+int(sub_region[-1].split('-')[1]))/2 for sub_region in data.combined_regions]
            for person in data:
                if type(data[person]) is not tuple:
                    data[person] = self.missings
                    continue
                diff = data.superMarkerCount - len(data[person][0])
                data[person] = zip(*data[person])
                if diff > 0:
                    if len(data[person]) == 1:
                        ##only one whole region with no recombination
                        data[person].extend(data[person] * diff)
                    else:
                        famid=''
                        for fam in data.complied_markers[0].keys():
                            if person in data.families[fam]:
                                famid=fam
                        complied_data=[]
                        for marker in data.complied_markers:
                            complied_data.append(data[person][marker[famid]])
                        data[person]=complied_data

    def __PedToHaplotype(self, ped):
        '''convert prephased ped format to haplotype format.
        Input: e.g. [['13346', '5888', '0', '0', '1', '11', '11', '11'], ['13346', '5856', '0', '0', '2', '12', '12', '12'], ['13346', '5920', '5888', '5856', '1', '12', '12', '12'], ['13346', '6589', '5888', '5856', '1', '11', '11', '11']]
        Output: e.g. (('13346', '5856', '1:', '1:', '1:'), ('13346', '5856', '2:', '2:', '2:'), ('13346', '5888', '1:', '1:', '1:'), ('13346', '5888', '1:', '1:', '1:'), ('13346', '6589', '1:', '1|', '1|'), ('13346', '6589', '1:', '1|', '1|'), ('13346', '5920', '2:', '2|', '2|'), ('13346', '5920', '1:', '1|', '1|'))
        '''
        haps = []
        for item in ped:
            entry = [item[0], item[1]] + [x[0] + ':' if x[0] != '0' else '?:' for x in item[5:]]
            haps.append(tuple(entry))
            entry = [item[0], item[1]] + [x[1] + ':' if x[1] != '0' else '?:' for x in item[5:]]
            haps.append(tuple(entry))
        return tuple(haps)

    def getRegion(self, region):
        self.name = region[3]
{% endraw %}

6.LinkageWriter class

{% raw %}
class LinkageWriter:
    def __init__(self, num_missing_append = 0):
        self.chrom = self.prev_chrom = self.name = self.distance = self.distance_avg = self.distance_m = self.distance_f = None
        self.distance_by_region=[]
        self.mid_position=None
        self.reset()
        self.missings = ["0", "0"]
        self.num_missing = num_missing_append

    def apply(self, data):
        if self.chrom != self.prev_chrom:
            if self.prev_chrom is None:
                self.prev_chrom = self.chrom
            else:
                # new chrom entered,
                # commit whatever is in buffer before accepting new data
                self.commit()
        # write tped output
        position = str(data.getMidPosition())
        if data.superMarkerCount <= 1:
            # genotypes
            gs = [data[s][0] for s in data.samples]
            if len(set(gs)) == 1:
                # everyone's genotype is the same (most likely missing or monomorphic)
                return 2
            self.tped += env.delimiter.join([self.chrom, self.name, self.distance, position] + \
                list(itertools.chain(*gs)) + self.missings*self.num_missing) + "\n"
            # freqs
            for k in data.maf:
                self.freq += env.delimiter.join([k, self.name] + map(str, data.maf[k][0])) + "\n"
        else:
            # have to expand each region into mutiple chunks to account for different recomb points
            gs = zip(*[data[s] for s in data.samples])
            # sub-chunk id
            cid = 0
            skipped_chunk = []
            self.distance_by_region=[self.distance_converter(x,int(position)) for x in data.coordinates_by_region]
            for idx, g in enumerate(gs):
                if len(set(g)) == 1:
                    skipped_chunk.append(idx)
                    continue
                cid += 1
                self.tped += \
                  env.delimiter.join([self.chrom, '{}[{}]'.format(self.name, cid), self.distance_by_region[cid-1], position] + \
                  list(itertools.chain(*g)) + self.missings*self.num_missing) + "\n"
            if cid == 0:
                # everyone's genotype is the same (most likely missing or monomorphic)
                return 2
            # freqs
            for k in data.maf:
                cid = 0
                for idx in range(data.superMarkerCount):
                    if idx in skipped_chunk:
                        continue
                    if not data.complied_markers:
                        #if recombination coded per family instead of across families
                        if idx >= len(data.maf[k]):
                            break
                        cid += 1
                        self.freq += env.delimiter.join([k, '{}[{}]'.format(self.name, cid)] + \
                                                    map(str, data.maf[k][idx])) + "\n"
                    else:
                        if len(data.maf[k])>1:
                            matched_idx=data.complied_markers[idx][k]
                            cid += 1
                            self.freq += env.delimiter.join([k, '{}[{}]'.format(self.name, cid)] + \
                                                map(str, data.maf[k][matched_idx])) + "\n"
                        elif len(data.maf[k])==1:
                            cid += 1
                            self.freq += env.delimiter.join([k, '{}[{}]'.format(self.name, cid)] + \
                                                map(str, data.maf[k][0])) + "\n"
        if data.combined_regions:
            self.chp += "CHP Super Marker positions: "+repr(data.combined_regions)+"\n"
        for item in data.varnames_by_fam:
            try:
                pattern_txt=[tuple(sorted(data.patterns[item][tmarker],key=lambda x:x.count('2') )) for tmarker in range(len(data.patterns[item]))]
            except:
                pattern_txt=''
            self.varfam += "{}\t{}\t{}\n".format(item,data.varnames_by_fam[item],pattern_txt)
        if self.counter < env.batch:
            self.counter += data.superMarkerCount
        else:
            self.commit()
        return 0

    def commit(self):
        if self.tped:
            with env.lock:
                with open(os.path.join(env.tmp_cache, '{}.chr{}.tped'.format(env.output, self.prev_chrom)),
                          'a') as f:
                    f.write(self.tped)
        if self.freq:
            with env.lock:
                with open(os.path.join(env.tmp_cache, '{}.chr{}.freq'.format(env.output, self.prev_chrom)),
                          'a') as f:
                    f.write(self.freq)
        if self.chp:
            with env.lock:
                with open(os.path.join(env.tmp_cache, '{}.chr{}.chp'.format(env.output, self.prev_chrom)),
                          'a') as f:
                    f.write(self.chp)
        if self.varfam:
            with env.lock:
                with open(os.path.join(env.tmp_cache, '{}.chr{}.var'.format(env.output, self.prev_chrom)),
                          'a') as f:
                    f.write(self.varfam)
        self.reset()

    def reset(self):
        self.tped = ''
        self.freq = ''
        self.chp = ''
        self.varfam = ''
        self.counter = 0
        self.prev_chrom = self.chrom

    def distance_converter(self, x, mid_position):
        delta=(x-mid_position)/1000000.0
        distance='%.5f'%(float(self.distance_avg)+delta)
        distance_m='%.5f'%(float(self.distance_m)+delta)
        distance_f='%.5f'%(float(self.distance_f)+delta)
        return ";".join([distance,distance_m,distance_f])

    def getRegion(self, region):
        self.chrom = region[0]
        self.name, self.distance_avg, self.distance_m, self.distance_f = region[3:]
        self.distance = ";".join([self.distance_avg, self.distance_m, self.distance_f])
{% endraw %}

7.EncoderWorker class

{% raw %}
class EncoderWorker(Process):
    def __init__(self, queue, length, data, extractor, coder, writer):
        Process.__init__(self)
        self.queue = queue
        self.numGrps = float(length)
        self.data = data
        self.extractor = extractor
        self.maker = coder
        self.writer = writer

    def report(self):
        env.log('{:,d} units processed {{{:.2%}}} ...'.\
                format(env.success_counter.value, env.total_counter.value / self.numGrps), flush = True)

    def run(self):
        while True:
            try:
                region = self.queue.pop(0) if isinstance(self.queue, list) else self.queue.get()
                if region is None:
                    self.writer.commit()
                    self.report()
                    # total mendelian errors found
                    with env.mendelerror_counter.get_lock():
                        env.mendelerror_counter.value += self.maker.haplotyper.CountMendelianErrors()
                    # total recombination events found
                    with env.recomb_counter.get_lock():
                        env.recomb_counter.value += self.maker.coder.CountRecombinations()
                    break
                else:
                    with env.total_counter.get_lock():
                        env.total_counter.value += 1
                    self.extractor.getRegion(region)
                    self.writer.getRegion(region)
                    self.maker.getRegion(region)
                    isSuccess = True
                    for m in [self.extractor, self.maker, self.writer]:
                        status = m.apply(self.data)
                        if status == -1:
                            with env.chperror_counter.get_lock():
                                # previous module failed
                                env.chperror_counter.value += 1
                        if status == 1:
                            with env.null_counter.get_lock():
                                env.null_counter.value += 1
                        if status == 2:
                            with env.trivial_counter.get_lock():
                                env.trivial_counter.value += 1
                        if status != 0:
                            isSuccess = False
                            break
                    if isSuccess:
                        with env.success_counter.get_lock():
                            env.success_counter.value += 1
                    if env.total_counter.value % (env.batch * env.jobs) == 0:
                        self.report()
            except KeyboardInterrupt:
                break
{% endraw %}

Old version

{% raw %}
class RData(dict):
    def __init__(self, samples_vcf, tfam):
        # tfam.samples: a dict of {sid:[fid, pid, mid, sex, trait], ...}
        # tfam.families: a dict of {fid:[s1, s2 ...], ...}
        self.tfam = tfam
        # samples have to be in both vcf and tfam data
        self.samples = OrderedDict([(k, tfam.samples[k]) for k in samples_vcf if k in tfam.samples])
        # a dict of {fid:[member names], ...}
        self.families = {k : [x for x in self.samples if x in tfam.families[k]] for k in tfam.families}
        # a dict of {fid:[idx ...], ...}
        self.famsampidx = {}
        # a dict of {fid:[maf1, maf2 ...]}
        self.maf = OrderedDict()
        # reorder family samples based on order of VCF file
        for k in self.families.keys():
            if len(self.families[k]) == 0:
                # skip families having no samples in VCF file
                del self.families[k]
            else:
                self.famsampidx[k] = [i for i, x in enumerate(samples_vcf) if x in self.families[k]]
        # a dict of {fid:[idx ...], ...}
        self.famvaridx = {}
        self.gss = {} #test line
        self.reset()

    def reset(self):
        for item in self.samples:
            self[item] = []
        self.variants = []
        self.chrom = None
        for k in self.families:
            self.famvaridx[k] = []
        self.maf = OrderedDict()
        # superMarkerCount is the max num. of recombinant fragments among all fams
        self.superMarkerCount = 0
        self.gss = {} #test line

    def getMidPosition(self):
        if len(self.variants) == 0:
            return None
        return sum([x[1] for x in self.variants]) / len(self.variants)

    def getFamVariants(self, fam, style = None):
        if style is None:
            return [item for idx, item in enumerate(self.variants) if idx in self.famvaridx[fam]]
        elif style == "map":
            names = []
            pos = []
            mafs = []
            for idx in self.famvaridx[fam]:
                names.append("V{}-{}".format(idx, self.variants[idx][1]))
                pos.append(self.variants[idx][1])
                mafs.append(self.variants[idx][-1])
            return names, pos, mafs
        else:
            raise ValueError("Unknown style '{}'".format(style))

    def getFamSamples(self, fam):
        nvar = len([item for idx, item in enumerate(self.variants) if idx in self.famvaridx[fam]])
        output = [[]] * len(self.tfam.families[fam])
        for idx, item in enumerate(self.tfam.sort_family(fam)):
            # sample info, first 5 columns of ped
            output[idx] = self.tfam.samples[item][:-1]
            # sample genotypes
            if item in self.samples:
                output[idx].extend(self[item])
            else:
                output[idx].extend(["00"] * nvar)
        return output
{% endraw %}

Old maker

{% raw %}

class RegionExtractor[source]

RegionExtractor(filename, build=None, chr_prefix=None)

Extract given genomic region from VCF converting genotypes into dictionary of genotype list

{% endraw %} {% raw %}

class MarkerMaker[source]

MarkerMaker(wsize, maf_cutoff=None, recomb=False)

{% endraw %} {% raw %}

class LinkageWriter[source]

LinkageWriter(num_missing_append=0)

{% endraw %} {% raw %}

class EncoderWorker[source]

EncoderWorker(queue, length, data, extractor, coder, writer) :: Process

Process objects represent activity that is run in a separate process

The class is analogous to threading.Thread

{% endraw %} {% raw %}
{% endraw %}

Main function

{% raw %}
checkParams(args)
MESSAGE: Binary trait detected in [/mnt/mfs/statgen/yin/Github/linkage/SEQpy3/data/mwe_normal_fam.csv]
True
{% endraw %} {% raw %}
args.freq 
'AF'
{% endraw %} {% raw %}
if args.no_save:
    cache = NoCache()
else:
    cache = Cache(env.cache_dir, env.output, vars(args))
cache.setID('vcf')
{% endraw %} {% raw %}
if not args.vanilla and cache.check():
    env.log('Loading regional marker data from archive ...')
    cache.load(target_dir = env.tmp_dir, names = ['CACHE'])
    env.success_counter.value = sum(map(fileLinesCount, glob.glob('{}/*.tped'.format(env.tmp_cache))))
    env.batch = 10
else:
    # load VCF file header
    data = RData(args.vcf, args.tfam,args.anno,args.pop,allele_freq_info=args.freq)
    vs = data.vs
    samples_vcf = data.samples_vcf

if len(samples_vcf) == 0:
    env.error("Fail to extract samples from [{}]".format(args.vcf), exit = True)
env.log('{:,d} samples found in [{}]'.format(len(samples_vcf), args.vcf))
samples_not_vcf = data.samples_not_vcf
anno (2036189, 6)
MESSAGE: 7 samples found in FAM file but not in VCF file:
28_9_186, 22_1_10, 1036_2, 22_1_20, 28_9_101, 1036_1, 28_9_100
MESSAGE: 3,461 samples in VCF file will be ignored due to absence in FAM file
MESSAGE: 3,479 samples found in [/mnt/mfs/statgen/alzheimers-family/linkage_files/geno/full_sample/vcf/full_sample.vcf.gz]
{% endraw %} {% raw %}
len(samples_not_vcf),len(samples_vcf)
(7, 3479)
{% endraw %} {% raw %}
if len(data.families) == 0:
    env.error('No valid family to process. ' \
              'Families have to be at least trio with at least one member in VCF file.', exit = True)
if len(data.samples) == 0:
    env.error('No valid sample to process. ' \
              'Samples have to be in families, and present in both TFAM and VCF files.', exit = True)
rewriteFamfile(os.path.join(env.tmp_cache, '{}.tfam'.format(env.output)),
               data.tfam.samples, list(data.samples.keys()) + samples_not_vcf)
{% endraw %} {% raw %}
if args.single_markers:
    regions=[]
    for x in vs.GetGenomeCoordinates():
        region_info = (x[0], x[1], x[1], "{}:{}".format(x[0], x[1]), '.', '.', '.')
        if region_info not in regions:
            regions.append(region_info)
    args.blueprint = None
else:
    # load blueprint
    try:
        with open(args.blueprint, 'r') as f:
            regions = [x.strip().split() for x in f.readlines()]
    except IOError:
        env.error("Cannot load regional marker blueprint [{}]. ".format(args.blueprint), exit = True)
env.log('{:,d} families with a total of {:,d} samples will be scanned for {:,d} pre-defined units'.\
        format(len(data.families), len(data.samples), len(regions)))
env.jobs = max(min(args.jobs, len(regions)), 1)
regions.extend([None] * env.jobs)
queue = [] if env.jobs == 1 else Queue()  
MESSAGE: 3 families with a total of 18 samples will be scanned for 28,325 pre-defined units
{% endraw %}

Testing

{% raw %}
extractor =RegionExtractor(args.vcf, build=env.build,chr_prefix = args.chr_prefix)
maker =            MarkerMaker(args.bin, maf_cutoff = args.maf_cutoff)
writer =             LinkageWriter(len(samples_not_vcf))
{% endraw %} {% raw %}
for j, region in enumerate(regions[:-100]):#[:20]):
    i = 0
    #for region in rg:
    extractor.getRegion(region)
    maker.getRegion(region)
    writer.getRegion(region)
    isSuccess = True
    for m in [extractor, maker, writer]:
        status = m.apply(data)
        #print(data,data.genotype_all)
        i+=1
        if status == -1:
            with env.chperror_counter.get_lock():
                # previous module failed
                env.chperror_counter.value += 1
        if status == 1:
            with env.null_counter.get_lock():
                env.null_counter.value += 1
        if status == 2:
            with env.trivial_counter.get_lock():
                env.trivial_counter.value += 1
        if status != 0:
            isSuccess = False
            break
    if isSuccess:
        with env.success_counter.get_lock():
            env.success_counter.value += 1
    if j%1000==0:
        print(j,i,len(data.variants),region)
['V6-13273' 'V10-13302' 'V15-13417'] [13273, 13302, 13417] [1.886e-01 9.542e-05 1.477e-01]
['V6-13273' 'V13-13380' 'V15-13417']Estimating allele frequencies... [using maximum likelihood]0
   V6-13273 V10-13302 V15-13417 

V6-13273: 0 0.707106 0.292894 
total familyCount:1
V10-13302: 0 0.75 0.25 
total familyCount:1
V15-13417: 0 0.75 0.25 
total familyCount:1
 [13273, 13380, 13417] [2.165e-01 1.980e-05 1.712e-01]
[] Estimating allele frequencies... [using maximum likelihood]0
   V6-13273 V13-13380 V15-13417 

V6-13273: 0 0.744757 0.255243 
total familyCount:1
V13-13380: 0 0.744757 0.255243 
total familyCount:1
V15-13417: 0 0.744757 0.255243 
total familyCount:1
[] []
0 3 23 ['1', '11868', '14362', 'LOC102725121@1', '9.177127474362311e-07', '1.1657192989882668e-06', '6.814189157634088e-07']
['V6-13273' 'V10-13302' 'V15-13417'] [13273, 13302, 13417] [1.886e-01 9.542e-05 1.477e-01]
['V6-13273' 'V13-13380' 'V15-13417'] [13273, 13380, 13417] [2.165e-01 1.980e-05 1.712e-01]
Estimating allele frequencies... [using maximum likelihood]0
   V6-13273 V10-13302 V15-13417 

V6-13273: 0 0.707106 0.292894 
total familyCount:1
V10-13302: 0 0.75 0.25 
total familyCount:1
V15-13417: 0 0.75 0.25 
total familyCount:1
[] [] []
Estimating allele frequencies... [using maximum likelihood]0
   V6-13273 V13-13380 V15-13417 

V6-13273: 0 0.744757 0.255243 
total familyCount:1
V13-13380: 0 0.744757 0.255243 
total familyCount:1
V15-13417: 0 0.744757 0.255243 
total familyCount:1
['V3-14464' 'V8-14653' 'V16-14907' 'V17-14930' 'V18-14933' 'V36-16103'
 'V44-16378' 'V49-16487' 'V71-17358' 'V77-17385' 'V81-17407' 'V114-17697'
 'V139-17928' 'V140-17929' 'V146-20184' 'V147-20191' 'V149-20212'
 'V152-20227' 'V156-20235' 'V158-20250' 'V165-20316' 'V167-20485'
 'V169-20522' 'V171-20547' 'V180-29368'] [14464, 14653, 14907, 14930, 14933, 16103, 16378, 16487, 17358, 17385, 17407, 17697, 17928, 17929, 20184, 20191, 20212, 20227, 20235, 20250, 20316, 20485, 20522, 20547, 29368] [0.1907 0.4209 0.335  0.2784 0.0084 0.0294 0.5035 0.0695 0.0017 0.2078
 0.0224 0.1217 0.0146 0.0136 0.0305 0.075  0.0933 0.0745 0.0926 0.3311
 0.3091 0.003  0.0031 0.3041 0.0084]
['V3-14464' 'V8-14653' 'V9-14677' 'V16-14907' 'V17-14930' 'V36-16103'
 'V44-16378' 'V49-16487' 'V72-17365' 'V77-17385' 'V78-17398' 'V81-17407'
 'V86-17479' 'V99-17559' 'V114-17697' 'V119-17722' 'V121-17746'
 'V131-17829' 'V142-19190' 'V146-20184' 'V147-20191' 'V149-20212'
 'V152-20227' 'V156-20235' 'V158-20250' 'V165-20316' 'V171-20547']Estimating allele frequencies... [using maximum likelihood]0
   V3-14464 V8-14653 V16-14907 V17-14930 V18-14933 V36-16103 V44-16378 
   V49-16487 V71-17358 V77-17385 V81-17407 V114-17697 V139-17928 V140-17929 
   V146-20184 V147-20191 V149-20212 V152-20227 V156-20235 V158-20250 
   V165-20316 V167-20485 V169-20522 V171-20547 V180-29368 

V3-14464: 0 0.75 0.25 
total familyCount:1
V8-14653: 0 0.75 0.25 
total familyCount:1
V16-14907: 0 0.5 0.5 
total familyCount:1
V17-14930: 0 0.5 0.5 
total familyCount:1
V18-14933: 0 1 
total familyCount:1
V36-16103: 0 0.707106 0.292894 
total familyCount:1
V44-16378: 0 0.5 0.5 
total familyCount:1
V49-16487: 0 0.75 0.25 
total familyCount:1
V71-17358: 0 1 
total familyCount:1
V77-17385: 0 1 
total familyCount:1
V81-17407: 0 0.5 0.5 
total familyCount:1
V114-17697: 0 0.5 0.5 
total familyCount:1
 [14464, 14653, 14677, 14907, 14930, 16103, 16378, 16487, 17365, 17385, 17398, 17407, 17479, 17559, 17697, 17722, 17746, 17829, 19190, 20184, 20191, 20212, 20227, 20235, 20250, 20316, 20547] [3.038e-01 4.487e-01 7.190e-02 3.680e-01 3.322e-01 2.290e-02 4.994e-01
 9.850e-02 2.210e-02 2.135e-01 3.000e-04 2.090e-02 1.000e-04 2.000e-04
 1.783e-01 2.810e-02 3.420e-02 1.150e-02 2.301e-05 3.830e-02 1.485e-01
 1.807e-01 1.247e-01 5.090e-02 3.512e-01 3.466e-01 3.344e-01]
['V3-14464' 'V5-14470' 'V8-14653' 'V9-14677' 'V16-14907' 'V17-14930'
 'V31-16068' 'V36-16103' 'V44-16378' 'V76-17379' 'V77-17385' 'V82-17408'
 'V96-17519' 'V98-17556' 'V107-17614' 'V142-19190' 'V145-20166'
 'V147-20191' 'V149-20212' 'V152-20227' 'V153-20227' 'V156-20235'
 'V158-20250' 'V161-20254' 'V165-20316' 'V170-20545' 'V171-20547'
 'V180-29368'] [14464, 14470, 14653, 14677, 14907, 14930, 16068, 16103, 16378, 17379, 17385, 17408, 17519, 17556, 17614, 19190, 20166, 20191, 20212, 20227, 20227, 20235, 20250, 20254, 20316, 20545, 20547, 29368] [3.038e-01 5.100e-03 4.487e-01 7.190e-02 3.680e-01 3.322e-01 2.400e-03
 2.290e-02 4.994e-01 8.800e-03 2.135e-01 1.040e-02 4.100e-03 1.790e-02
 5.700e-02 2.301e-05 1.064e-01 1.485e-01 1.807e-01 1.247e-01 7.220e-02
 5.090e-02 3.512e-01 1.430e-02 3.466e-01 1.400e-03 3.344e-01 1.110e-02]
V139-17928: 0 0.5 0.5 
total familyCount:1
V140-17929: 0 0.5 0.5 
total familyCount:1
V146-20184: 0 0.5 0.5 
total familyCount:1
V147-20191: 0 1 
total familyCount:1
V149-20212: 0 1 
total familyCount:1
V152-20227: 0 1 
total familyCount:1
V156-20235: 0 1 
total familyCount:1
V158-20250: 0 1 
total familyCount:1
V165-20316: 0 1 
total familyCount:1
V167-20485: 0 1 
total familyCount:1
V169-20522: 0 1 
total familyCount:1
V171-20547: 0 0.75 0.25 
total familyCount:1
V180-29368: 0 1 
total familyCount:1
Estimating allele frequencies... [using maximum likelihood]0
   V3-14464 V8-14653 V9-14677 V16-14907 V17-14930 V36-16103 V44-16378 
   V49-16487 V72-17365 V77-17385 V78-17398 V81-17407 V86-17479 V99-17559 
   V114-17697 V119-17722 V121-17746 V131-17829 V142-19190 V146-20184 
   V147-20191 V149-20212 V152-20227 V156-20235 V158-20250 V165-20316 
   V171-20547 

V3-14464: 0 0.739454 0.260546 
total familyCount:1
V8-14653: 0 0.707103 0.292897 
total familyCount:1
V9-14677: 0 0.739454 0.260546['V4-17385' 'V8-17407'] 
total familyCount:1
V16-14907: 0 0.707103 0.292897 
total familyCount:1
V17-14930: 0 0.728713 0.271287 
total familyCount:1
V36-16103: 0 0.5 0.5 
total familyCount:1
V44-16378: 0 0.5 0.5 
total familyCount:1
V49-16487: 0 0.744757 0.255243 
total familyCount:1
V72-17365: 0 0.744757 0.255243 
total familyCount:1
V77-17385: 0 0.739454 0.260546 
total familyCount:1
V78-17398: 0 0.744757 0.255243 
total familyCount:1
V81-17407: 0 0.744757 0.255243 
total familyCount:1
V86-17479: 0 0.744757 0.255243 
total familyCount:1
V99-17559: 0 0.744757 0.255243 
total familyCount:1
V114-17697: 0 0.739454 0.260546 
total familyCount:1
V119-17722: 0 0.744757 0.255243 
total familyCount:1
V121-17746: 0 0.739454 0.260546 
total familyCount:1
V131-17829: 0 0.744757 0.255243 
total familyCount:1
V142-19190: 0 0.739454 0.260546 
total familyCount:1
V146-20184: 0 0.744757 0.255243 
total familyCount:1
V147-20191: 0 0.744757 0.255243 
total familyCount:1
V149-20212: 0 0.744757 0.255243 
total familyCount:1
V1 [17385, 17407] [0.2078 0.0224]
['V4-17385' 'V5-17398' 'V8-17407'] [17385, 17398, 17407] [0.2135 0.0003 0.0209]
52-20227: 0 0.744757 0.255243 
total familyCount:1
V156-20235: 0 0.744757 0.255243 
total familyCount:1
V158-20250: 0 0.739454 0.260546 
total familyCount:1
V165-20316: 0 0.739454 0.260546 
total familyCount:1
V171-20547: 0 0.739454 0.260546 
total familyCount:1
Estimating allele frequencies... [using maximum likelihood]0
   V3-14464 V5-14470 V8-14653 V9-14677 V16-14907 V17-14930 V31-16068 V36-16103 
   V44-16378 V76-17379 V77-17385 V82-17408 V96-17519 V98-17556 V107-17614 
   V142-19190 V145-20166 V147-20191 V149-20212 V152-20227 V153-20227 
   V156-20235 V158-20250 V161-20254 V165-20316 V170-20545 V171-20547 
   V180-29368 

V3-14464: 0 0.646634 0.353366 
total familyCount:1
V5-14470: 0 0.824706 0.175294 
total familyCount:1
V8-14653: 0 0.452863 0.547137 
total familyCount:1
V9-14677: 0 0.656432 0.343568 
total familyCount:1
V16-14907: 0 0.5 0.5 
total familyCount:1
V17-14930: 0 0.628665 0.371335 
total familyCount:1
V31-16068: 0 0.5 0.5 
total familyCount:1
V36-16103: 0 0.628667 0.3['V3-17379' 'V4-17385' 'V9-17408'] [17379, 17385, 17408] [0.0088 0.2135 0.0104]
71333 
total familyCount:1
V44-16378: 0 0.617751 0.382249 
total familyCount:1
V76-17379: 0 0.824706 0.175294 
total familyCount:1
V77-17385: 0 0.5 0.5 
total familyCount:1
V82-17408: 0 0.824706 0.175294 
total familyCount:1
V96-17519: 0 0.824706 0.175294 
total familyCount:1
V98-17556: 0 0.820231 0.179769 
total familyCount:1
V107-17614: 0 0.824706 0.175294 
total familyCount:1
V142-19190: 0 0.6 0.4 
total familyCount:1
V145-20166: 0 0.628665 0.371335 
total familyCount:1
V147-20191: 0 0.628665 0.371335 
total familyCount:1
V149-20212: 0 0.628665 0.371335 
total familyCount:1
V152-20227: 0 0.656432 0.343568 
total familyCount:1
V153-20227: 0 0.646634 0.353366 
total familyCount:1
V156-20235: 0 0.824706 0.175294 
total familyCount:1
V158-20250: 0 0.628665 0.371335 
total familyCount:1
V161-20254: 0 0.824706 0.175294 
total familyCount:1
V165-20316: 0 0.628665 0.371335 
total familyCount:1
V170-20545: 0 0.820231 0.179769 
total familyCount:1
V171-20547: 0 0.617751 0.382249 
total familyCount:1
V180-29368: 0 0.656432 0.343568 
total familyCount:1
Estimating allele frequencies... [using maximum likelihood]0          
   V4-17385 V8-17407 

V4-17385: 0 1 
total familyCount:1
V8-17407: 0 0.5 0.5 
total familyCount:1
Estimating allele frequencies... [using maximum likelihood]0
   V4-17385 V5-17398 V8-17407 

V4-17385: 0 0.739454 0.260546 
total familyCount:1
V5-17398: 0 0.744757 0.255243 
total familyCount:1
V8-17407: 0 0.744757 0.255243 
total familyCount:1
Estimating allele frequencies... [using maximum likelihood]0
   V3-17379 V4-17385 V9-17408 

V3-17379: 0 0.824706 0.175294 
total familyCount:1
V4-17385: 0 0.5 0.5 
total familyCount:1
V9-17408: 0 0.824706 0.175294 
total familyCount:1
1000 1 0 ['1', '61742479', '62163915', 'PATJ', '94.08912254193991', '118.69606841169087', '71.63174343660968']
2000 1 0 ['1', '162790701', '162812818', 'HSD17B7', '168.91829636079495', '218.49549236802426', '122.20452659549645']
3000 1 0 ['2', '27212359', '27217182', 'ATRAID', '48.19894998090023', '54.585310839481366', '42.49830744092714']
4000 1 0 ['2', '168920780', '169031324', 'ABCB11', '174.1718395156357', '222.22338807109554', '127.6844708222256']
5000 1 0 ['3', '47413680', '47475941', 'SCAP', '68.99620573382401', '81.61445932132666', '57.9855449134992']
6000 1 0 ['3', '184230352', '184242329', 'VWA5B2', '192.1275334861548', '247.45672160907745', '139.2580545053618']
7000 1 0 ['4', '138164096', '138242349', 'SLC7A11', '140.35374100483878', '186.05001188945482', '97.20783019850205']
8000 1 0 ['5', '132190146', '132227853', 'P4HA2', '138.85770413097532', '173.97439801388742', '105.14936291323124']
9000 1 0 ['6', '31615233', '31617015', 'AIF1', '53.57404706283638', '56.98460061173304', '51.484032621407884']
10000 1 0 ['6', '167155246', '167157980', 'GPR31', '187.8212404552102', '243.3868606324144', '134.9096549771634']
11000 1 0 ['7', '113080412', '113087778', 'GPR85', '121.94724950804803', '163.03027920118186', '82.53468270653605']
12000 1 0 ['8', '81478418', '81483233', 'FABP4', '95.00012872224329', '125.79097683477232', '65.891333925847']
13000 1 0 ['9', '95085207', '95085304', 'MIR23B', '100.77698198363763', '124.30346632003499', '78.55681544180344']
14000 1 0 ['10', '58325628', '58329679', 'LOC112268068', '74.88956742062021', '94.58971593360282', '57.27601225803206']
15000 1 0 ['11', '12286899', '12362138', 'MICALCL', '25.200421811362663', '19.780182273947002', '30.47861020169645']
16000 1 0 ['11', '101890673', '101916522', 'ANGPTL5', '109.59131065684834', '139.3668510208155', '80.95094926518013']
17000 1 0 ['12', '54395260', '54419266', 'ITGA5', '72.35531487721212', '85.30635133411202', '60.57391809500565']
18000 1 0 ['13', '46455203', '46466776', 'LINC01198', '50.167966040012665', '57.175574695883995', '43.125175052271366']
19000 1 0 ['14', '86905777', '86922755', 'LINC01148', '84.32939464542692', '103.04064213211844', '66.78106340164302']
20000 1 0 ['15', '73873563', '73889214', 'TBC1D21', '77.64806530153696', '97.22184379127768', '58.61042722911022']
21000 1 0 ['16', '33495800', '33496235', 'LOC390705@2', '59.597025459459736', '64.51252841288981', '55.757286567026384']
22000 1 0 ['17', '28360653', '28360734', 'MIR4723', '53.29906731104194', '56.137810791384275', '49.8686532838509']
23000 1 0 ['17', '79823451', '79827704', 'LINC01977', '129.41707434188964', '161.0935891249485', '98.15793907670367']
24000 1 0 ['19', '12953118', '12957223', 'GADD45GIP1', '33.20123193440195', '31.021078181726253', '35.714493705610096']
25000 1 0 ['19', '51964339', '51986840', 'ZNF350', '89.6950481101567', '113.9831205106624', '66.44497607852102']
26000 1 0 ['20', '62143768', '62182514', 'SS18L1', '110.30700665717275', '124.48353231287628', '98.56286538747486']
27000 1 0 ['22', '43110749', '43129712', 'BIK', '54.13818873093194', '71.04904715507725', '37.884233842626216']
28000 1 0 ['X', '130494940', '130497447', 'DENND10P1', 'NA', '146.88487435565696', 'NA']
{% endraw %} {% raw %}
env.dtest['PAPPA2']
OrderedDict([('dregions',
              [['1',
                '176463174',
                '176845601',
                'PAPPA2',
                '186.27975412824702',
                '238.992712111315',
                '136.40298421566155']]),
             ('dvariants', []),
             ('dfamvaridx', []),
             ('dgeno', []),
             ('gss', []),
             ('hapimp', {}),
             ('ld', []),
             ('coder', {}),
             ('format', [])])
{% endraw %} {% raw %}
env.dtest['MC1R']
OrderedDict([('dregions',
              [['16',
                '89918861',
                '89920972',
                'MC1R',
                '133.68971029636177',
                '159.0516420273219',
                '111.19712545131974']]),
             ('dvariants', []),
             ('dfamvaridx', []),
             ('dgeno', []),
             ('gss', []),
             ('hapimp', {}),
             ('ld', []),
             ('coder', {}),
             ('format', [])])
{% endraw %} {% raw %}
env.dtest['WASH7P']
OrderedDict([('dregions',
              [['1',
                '14361',
                '29370',
                'WASH7P',
                '1.5299877409602128e-06',
                '1.94345806118021e-06',
                '1.136044574393209e-06']]),
             ('dvariants',
              [[['1', 14378, 'WASH7P'],
                ['1', 14429, 'WASH7P'],
                ['1', 14458, 'WASH7P'],
                ['1', 14464, 'WASH7P'],
                ['1', 14469, 'WASH7P'],
                ['1', 14470, 'WASH7P'],
                ['1', 14488, 'WASH7P'],
                ['1', 14521, 'WASH7P'],
                ['1', 14653, 'WASH7P'],
                ['1', 14677, 'WASH7P'],
                ['1', 14731, 'WASH7P'],
                ['1', 14742, 'WASH7P'],
                ['1', 14747, 'WASH7P'],
                ['1', 14773, 'WASH7P'],
                ['1', 14792, 'WASH7P'],
                ['1', 14843, 'WASH7P'],
                ['1', 14907, 'WASH7P'],
                ['1', 14930, 'WASH7P'],
                ['1', 14933, 'WASH7P'],
                ['1', 15207, 'WASH7P'],
                ['1', 15219, 'WASH7P'],
                ['1', 15219, 'WASH7P'],
                ['1', 15746, 'WASH7P'],
                ['1', 15773, 'WASH7P'],
                ['1', 15777, 'WASH7P'],
                ['1', 15811, 'WASH7P'],
                ['1', 15835, 'WASH7P'],
                ['1', 15849, 'WASH7P'],
                ['1', 15913, 'WASH7P'],
                ['1', 15989, 'WASH7P'],
                ['1', 16006, 'WASH7P'],
                ['1', 16068, 'WASH7P'],
                ['1', 16071, 'WASH7P'],
                ['1', 16079, 'WASH7P'],
                ['1', 16101, 'WASH7P'],
                ['1', 16102, 'WASH7P'],
                ['1', 16103, 'WASH7P'],
                ['1', 16127, 'WASH7P'],
                ['1', 16128, 'WASH7P'],
                ['1', 16158, 'WASH7P'],
                ['1', 16206, 'WASH7P'],
                ['1', 16280, 'WASH7P'],
                ['1', 16310, 'WASH7P'],
                ['1', 16337, 'WASH7P'],
                ['1', 16378, 'WASH7P'],
                ['1', 16397, 'WASH7P'],
                ['1', 16443, 'WASH7P'],
                ['1', 16451, 'WASH7P'],
                ['1', 16474, 'WASH7P'],
                ['1', 16487, 'WASH7P'],
                ['1', 16531, 'WASH7P'],
                ['1', 16555, 'WASH7P'],
                ['1', 16633, 'WASH7P'],
                ['1', 16722, 'WASH7P'],
                ['1', 16731, 'WASH7P'],
                ['1', 16731, 'WASH7P'],
                ['1', 16734, 'WASH7P'],
                ['1', 16911, 'WASH7P'],
                ['1', 17005, 'WASH7P'],
                ['1', 17135, 'WASH7P'],
                ['1', 17146, 'WASH7P'],
                ['1', 17147, 'WASH7P'],
                ['1', 17151, 'WASH7P'],
                ['1', 17181, 'WASH7P'],
                ['1', 17212, 'WASH7P'],
                ['1', 17213, 'WASH7P'],
                ['1', 17217, 'WASH7P'],
                ['1', 17222, 'WASH7P'],
                ['1', 17223, 'WASH7P'],
                ['1', 17289, 'WASH7P'],
                ['1', 17353, 'WASH7P'],
                ['1', 17358, 'WASH7P'],
                ['1', 17365, 'WASH7P'],
                ['1', 17373, 'WASH7P'],
                ['1', 17375, 'WASH7P'],
                ['1', 17378, 'WASH7P'],
                ['1', 17379, 'WASH7P'],
                ['1', 17385, 'WASH7P'],
                ['1', 17398, 'WASH7P'],
                ['1', 17403, 'WASH7P'],
                ['1', 17406, 'WASH7P'],
                ['1', 17407, 'WASH7P'],
                ['1', 17408, 'WASH7P'],
                ['1', 17452, 'WASH7P'],
                ['1', 17453, 'WASH7P'],
                ['1', 17478, 'WASH7P'],
                ['1', 17479, 'WASH7P'],
                ['1', 17483, 'WASH7P'],
                ['1', 17484, 'WASH7P'],
                ['1', 17492, 'WASH7P'],
                ['1', 17493, 'WASH7P'],
                ['1', 17496, 'WASH7P'],
                ['1', 17501, 'WASH7P'],
                ['1', 17511, 'WASH7P'],
                ['1', 17512, 'WASH7P'],
                ['1', 17517, 'WASH7P'],
                ['1', 17519, 'WASH7P'],
                ['1', 17538, 'WASH7P'],
                ['1', 17556, 'WASH7P'],
                ['1', 17559, 'WASH7P'],
                ['1', 17563, 'WASH7P'],
                ['1', 17569, 'WASH7P'],
                ['1', 17585, 'WASH7P'],
                ['1', 17589, 'WASH7P'],
                ['1', 17594, 'WASH7P'],
                ['1', 17596, 'WASH7P'],
                ['1', 17606, 'WASH7P'],
                ['1', 17614, 'WASH7P'],
                ['1', 17626, 'WASH7P'],
                ['1', 17647, 'WASH7P'],
                ['1', 17672, 'WASH7P'],
                ['1', 17688, 'WASH7P'],
                ['1', 17689, 'WASH7P'],
                ['1', 17695, 'WASH7P'],
                ['1', 17697, 'WASH7P'],
                ['1', 17701, 'WASH7P'],
                ['1', 17709, 'WASH7P'],
                ['1', 17716, 'WASH7P'],
                ['1', 17721, 'WASH7P'],
                ['1', 17722, 'WASH7P'],
                ['1', 17728, 'WASH7P'],
                ['1', 17746, 'WASH7P'],
                ['1', 17747, 'WASH7P'],
                ['1', 17748, 'WASH7P'],
                ['1', 17750, 'WASH7P'],
                ['1', 17753, 'WASH7P'],
                ['1', 17765, 'WASH7P'],
                ['1', 17765, 'WASH7P'],
                ['1', 17767, 'WASH7P'],
                ['1', 17781, 'WASH7P'],
                ['1', 17805, 'WASH7P'],
                ['1', 17829, 'WASH7P'],
                ['1', 17842, 'WASH7P'],
                ['1', 17843, 'WASH7P'],
                ['1', 17844, 'WASH7P'],
                ['1', 17853, 'WASH7P'],
                ['1', 17854, 'WASH7P'],
                ['1', 17901, 'WASH7P'],
                ['1', 17904, 'WASH7P'],
                ['1', 17928, 'WASH7P'],
                ['1', 17929, 'WASH7P'],
                ['1', 19190, 'WASH7P'],
                ['1', 19190, 'WASH7P'],
                ['1', 19254, 'WASH7P'],
                ['1', 19535, 'WASH7P'],
                ['1', 20166, 'WASH7P'],
                ['1', 20184, 'WASH7P'],
                ['1', 20191, 'WASH7P'],
                ['1', 20210, 'WASH7P'],
                ['1', 20212, 'WASH7P'],
                ['1', 20217, 'WASH7P'],
                ['1', 20225, 'WASH7P'],
                ['1', 20227, 'WASH7P'],
                ['1', 20227, 'WASH7P'],
                ['1', 20231, 'WASH7P'],
                ['1', 20231, 'WASH7P'],
                ['1', 20235, 'WASH7P'],
                ['1', 20237, 'WASH7P'],
                ['1', 20250, 'WASH7P'],
                ['1', 20251, 'WASH7P'],
                ['1', 20253, 'WASH7P'],
                ['1', 20254, 'WASH7P'],
                ['1', 20273, 'WASH7P'],
                ['1', 20280, 'WASH7P'],
                ['1', 20297, 'WASH7P'],
                ['1', 20316, 'WASH7P'],
                ['1', 20443, 'WASH7P'],
                ['1', 20485, 'WASH7P'],
                ['1', 20496, 'WASH7P'],
                ['1', 20522, 'WASH7P'],
                ['1', 20545, 'WASH7P'],
                ['1', 20547, 'WASH7P'],
                ['1', 20552, 'WASH7P'],
                ['1', 20554, 'WASH7P'],
                ['1', 28588, 'WASH7P'],
                ['1', 28588, 'WASH7P'],
                ['1', 28588, 'WASH7P'],
                ['1', 29278, 'WASH7P'],
                ['1', 29300, 'WASH7P'],
                ['1', 29359, 'WASH7P'],
                ['1', 29368, 'WASH7P']]]),
             ('dfamvaridx',
              [{'1036': [3,
                 8,
                 16,
                 17,
                 18,
                 36,
                 44,
                 49,
                 71,
                 77,
                 81,
                 114,
                 139,
                 140,
                 146,
                 147,
                 149,
                 152,
                 156,
                 158,
                 165,
                 167,
                 169,
                 171,
                 180],
                '22_1': [3,
                 8,
                 9,
                 16,
                 17,
                 36,
                 44,
                 49,
                 72,
                 77,
                 78,
                 81,
                 86,
                 99,
                 114,
                 119,
                 121,
                 131,
                 142,
                 146,
                 147,
                 149,
                 152,
                 156,
                 158,
                 165,
                 171],
                '28_9': [3,
                 5,
                 8,
                 9,
                 16,
                 17,
                 31,
                 36,
                 44,
                 76,
                 77,
                 82,
                 96,
                 98,
                 107,
                 142,
                 145,
                 147,
                 149,
                 152,
                 153,
                 156,
                 158,
                 161,
                 165,
                 170,
                 171,
                 180]}]),
             ('dgeno',
              [{'28_9_103': ['11',
                 '11',
                 '22',
                 '11',
                 '12',
                 '22',
                 '22',
                 '22',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '22',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11'],
                '28_9_106': ['11',
                 '11',
                 '00',
                 '12',
                 '12',
                 '12',
                 '00',
                 '00',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12'],
                '28_9_108': ['12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11'],
                '28_9_109': ['11',
                 '11',
                 '12',
                 '11',
                 '12',
                 '22',
                 '00',
                 '22',
                 '22',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11'],
                '28_9_111': ['12',
                 '12',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12'],
                '28_9_105': ['12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '12',
                 '11'],
                '28_9_114': ['12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '12',
                 '11'],
                '28_9_110': ['12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11'],
                '1036_5': ['11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '12',
                 '12'],
                '1036_99': ['12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11'],
                '1036_6': ['11',
                 '12',
                 '12',
                 '12',
                 '11',
                 '00',
                 '12',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11'],
                '1036_4': ['11',
                 '11',
                 '12',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '11'],
                '1036_3': ['11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11'],
                '22_1_2': ['11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12'],
                '22_1_3': ['11',
                 '22',
                 '11',
                 '11',
                 '11',
                 '22',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11'],
                '22_1_4': ['11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11'],
                '22_1_5': ['12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11'],
                '22_1_99': ['12',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12'],
                '1036_1': [('1', '0')],
                '1036_2': [('3', '0')],
                '22_1_10': [('3', '1')],
                '22_1_20': [('1', '2')]}]),
             ('gss',
              [Empty DataFrame
               Columns: []
               Index: []]),
             ('hapimp',
              {'1036': ['1036',
                array(['V3-14464', 'V8-14653', 'V16-14907', 'V17-14930', 'V18-14933',
                       'V36-16103', 'V44-16378', 'V49-16487', 'V71-17358', 'V77-17385',
                       'V81-17407', 'V114-17697', 'V139-17928', 'V140-17929',
                       'V146-20184', 'V147-20191', 'V149-20212', 'V152-20227',
                       'V156-20235', 'V158-20250', 'V165-20316', 'V167-20485',
                       'V169-20522', 'V171-20547', 'V180-29368'], dtype='<U10'),
                [14464,
                 14653,
                 14907,
                 14930,
                 14933,
                 16103,
                 16378,
                 16487,
                 17358,
                 17385,
                 17407,
                 17697,
                 17928,
                 17929,
                 20184,
                 20191,
                 20212,
                 20227,
                 20235,
                 20250,
                 20316,
                 20485,
                 20522,
                 20547,
                 29368],
                array([0.1907, 0.4209, 0.335 , 0.2784, 0.0084, 0.0294, 0.5035, 0.0695,
                       0.0017, 0.2078, 0.0224, 0.1217, 0.0146, 0.0136, 0.0305, 0.075 ,
                       0.0933, 0.0745, 0.0926, 0.3311, 0.3091, 0.003 , 0.0031, 0.3041,
                       0.0084]),
                array([['1036', '1036_1', '2:', '1:', '2:', '2:', '1:', '2:', 'A2,1:',
                        '2:', '1:', '1:', '1:', 'A2,1:', '2:', '2:', '2:', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                       ['1036', '1036_1', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:',
                        '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:',
                        '?:', '?:', '?:', '?:', '?:', '?:'],
                       ['1036', '1036_2', '1:', '1:', '1:', '1:', '1:', '1:', 'A1,2:',
                        '1:', '1:', '1:', '2:', 'A1,2:', '1:', '1:', '1:', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                       ['1036', '1036_2', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:',
                        '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:',
                        '?:', '?:', '?:', '?:', '?:', '?:'],
                       ['1036', '1036_6', '1:', '1:', '1:', '1:', '1:', '1:', 'A1,2:',
                        '1:', '1:', '1:', '2:', 'A2,1:', '2:', '2:', '2:', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                       ['1036', '1036_6', '1:', '2:', '2:', '2:', '1:', '1:', 'A2,1:',
                        '1:', '1:', '1:', '1:', 'A1,2:', '1:', '1:', '1:', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '2:', '1:'],
                       ['1036', '1036_99', '1:', '1|', '1|', '1|', '1:', '1|', 'A1,2|',
                        '1|', '1:', '1:', '2|', 'A1,2|', '1|', '1|', '1|', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                       ['1036', '1036_99', '2:', '1|', '2|', '2|', '1:', '2|', 'A2,1|',
                        '2|', '1:', '1:', '1|', 'A2,1|', '2|', '2|', '2|', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                       ['1036', '1036_5', '1:', '1|', '1|', '1|', '1:', '2/', 'A2,1|',
                        '2|', '1:', '1:', '1\\', 'A2,1|', '1/', '1|', '1|', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                       ['1036', '1036_5', '1:', '1|', '1|', '1|', '1:', '1/', 'A1,2|',
                        '1|', '1:', '1:', '1\\', 'A1,2|', '1/', '1|', '1|', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '2|', '1:'],
                       ['1036', '1036_4', '1:', '1|', '1\\', '1|', '1:', '1|', 'A1,2|',
                        '1|', '1:', '1:', '2|', 'A2,1/', '2|', '2|', '2|', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                       ['1036', '1036_4', '1:', '1|', '2\\', '2|', '1:', '1|', 'A2,1|',
                        '1|', '1:', '1:', '1|', 'A1,2/', '1|', '1|', '1|', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '2|', '1:'],
                       ['1036', '1036_3', '1:', '1|', '1|', '1|', '1:', '1|', 'A1,2|',
                        '1|', '1:', '1:', '1/', 'A2,1|', '2|', '2|', '2|', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                       ['1036', '1036_3', '1:', '2|', '2|', '2|', '1:', '1|', 'A2,1|',
                        '1|', '1:', '1:', '1/', 'A1,2|', '1|', '1|', '1|', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '2|', '1:']], dtype='<U7')],
               '22_1': ['22_1',
                array(['V3-14464', 'V8-14653', 'V9-14677', 'V16-14907', 'V17-14930',
                       'V36-16103', 'V44-16378', 'V49-16487', 'V72-17365', 'V77-17385',
                       'V78-17398', 'V81-17407', 'V86-17479', 'V99-17559', 'V114-17697',
                       'V119-17722', 'V121-17746', 'V131-17829', 'V142-19190',
                       'V146-20184', 'V147-20191', 'V149-20212', 'V152-20227',
                       'V156-20235', 'V158-20250', 'V165-20316', 'V171-20547'],
                      dtype='<U10'),
                [14464,
                 14653,
                 14677,
                 14907,
                 14930,
                 16103,
                 16378,
                 16487,
                 17365,
                 17385,
                 17398,
                 17407,
                 17479,
                 17559,
                 17697,
                 17722,
                 17746,
                 17829,
                 19190,
                 20184,
                 20191,
                 20212,
                 20227,
                 20235,
                 20250,
                 20316,
                 20547],
                array([3.038e-01, 4.487e-01, 7.190e-02, 3.680e-01, 3.322e-01, 2.290e-02,
                       4.994e-01, 9.850e-02, 2.210e-02, 2.135e-01, 3.000e-04, 2.090e-02,
                       1.000e-04, 2.000e-04, 1.783e-01, 2.810e-02, 3.420e-02, 1.150e-02,
                       2.301e-05, 3.830e-02, 1.485e-01, 1.807e-01, 1.247e-01, 5.090e-02,
                       3.512e-01, 3.466e-01, 3.344e-01]),
                array([['22_1', '22_1_10', '1:', '1:', '1:', '2:', '1:', '1:', 'A1,2:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2:', '2:', '2:',
                        '2:', '2:', '1:', '1:', '1:', '2:', '1:', '1:', '1:'],
                       ['22_1', '22_1_10', '1:', '2:', '1:', '1:', '1:', '2:', 'A1,2:',
                        '1:', '2:', '1:', '2:', '1:', '2:', '1:', '2:', '1:', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2:', '1:'],
                       ['22_1', '22_1_20', '2:', '2:', '2:', '1:', '1:', '2:', 'A2,1:',
                        '2:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                       ['22_1', '22_1_20', '1:', '2:', '1:', '1:', '2:', '1:', 'A2,1:',
                        '1:', '1:', '2:', '1:', '2:', '?:', '2:', '1:', '1:', '2:', '1:',
                        '1:', '1:', '2:', '2:', '2:', '1:', '2:', '1:', '2:'],
                       ['22_1', '22_1_99', '2:', '2|', '2|', '1/', '2|', '1|', 'A2,1/',
                        '2|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|',
                        '1|', '1\\', '1|', '1|', '1|', '1|', '2/', '1|', '2|'],
                       ['22_1', '22_1_99', '1:', '1|', '1|', '2/', '1|', '1|', 'A1,2/',
                        '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '2|', '2|', '2|',
                        '2|', '1\\', '1|', '1|', '1|', '1|', '1/', '2|', '1|'],
                       ['22_1', '22_1_5', '2:', '2|', '2|', '1|', '1|', '1/', 'A2,1|',
                        '1|', '1|', '2|', '1|', '2|', '1/', '1|', '1|', '1\\', '1|',
                        '1|', '1\\', '1|', '1|', '1\\', '1|', '1|', '1|', '1|', '1|'],
                       ['22_1', '22_1_5', '1:', '1|', '1|', '2|', '1|', '1/', 'A1,2|',
                        '1|', '1|', '1|', '1|', '1|', '1/', '1|', '1|', '1\\', '1|',
                        '1|', '2\\', '2|', '1|', '1\\', '1|', '1|', '1|', '2|', '1|'],
                       ['22_1', '22_1_4', '1:', '2|', '1|', '1|', '2|', '1|', 'A2,1|',
                        '1|', '1/', '1|', '1|', '1|', '1|', '2/', '1|', '1\\', '2|',
                        '1|', '1/', '1|', '1|', '1|', '1|', '1|', '1|', '1\\', '1|'],
                       ['22_1', '22_1_4', '1:', '1|', '1|', '2|', '1|', '1|', 'A1,2|',
                        '1|', '1/', '1|', '1|', '1|', '1|', '1/', '1|', '1\\', '1|',
                        '1|', '1/', '1|', '1|', '1|', '1|', '1|', '1|', '1\\', '1|'],
                       ['22_1', '22_1_3', '1:', '2|', '1|', '1/', '1|', '2|', 'A2,1/',
                        '1|', '1/', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|',
                        '1|', '1|', '1|', '1\\', '1|', '1|', '1|', '1|', '1|'],
                       ['22_1', '22_1_3', '1:', '2|', '1|', '1/', '1|', '2|', 'A1,2/',
                        '1|', '2/', '1|', '2|', '1|', '2|', '1|', '2|', '1|', '1|', '1|',
                        '1|', '1|', '1|', '1\\', '1|', '2|', '1|', '1|', '1|'],
                       ['22_1', '22_1_2', '1:', '2|', '1|', '1|', '2|', '1|', 'A2,1|',
                        '1|', '1|', '2|', '1/', '1|', '1|', '1|', '1\\', '1|', '1|',
                        '1|', '1/', '1|', '2|', '2|', '2|', '1|', '2|', '1\\', '2|'],
                       ['22_1', '22_1_2', '1:', '1|', '1|', '2|', '1|', '1|', 'A1,2|',
                        '1|', '1|', '1|', '1/', '1|', '1|', '1|', '2\\', '1|', '1|',
                        '1|', '1/', '1|', '1|', '1|', '1|', '1|', '1|', '1\\', '1|']],
                      dtype='<U7')],
               '28_9': ['28_9',
                array(['V3-14464', 'V5-14470', 'V8-14653', 'V9-14677', 'V16-14907',
                       'V17-14930', 'V31-16068', 'V36-16103', 'V44-16378', 'V76-17379',
                       'V77-17385', 'V82-17408', 'V96-17519', 'V98-17556', 'V107-17614',
                       'V142-19190', 'V145-20166', 'V147-20191', 'V149-20212',
                       'V152-20227', 'V153-20227', 'V156-20235', 'V158-20250',
                       'V161-20254', 'V165-20316', 'V170-20545', 'V171-20547',
                       'V180-29368'], dtype='<U10'),
                [14464,
                 14470,
                 14653,
                 14677,
                 14907,
                 14930,
                 16068,
                 16103,
                 16378,
                 17379,
                 17385,
                 17408,
                 17519,
                 17556,
                 17614,
                 19190,
                 20166,
                 20191,
                 20212,
                 20227,
                 20227,
                 20235,
                 20250,
                 20254,
                 20316,
                 20545,
                 20547,
                 29368],
                array([3.038e-01, 5.100e-03, 4.487e-01, 7.190e-02, 3.680e-01, 3.322e-01,
                       2.400e-03, 2.290e-02, 4.994e-01, 8.800e-03, 2.135e-01, 1.040e-02,
                       4.100e-03, 1.790e-02, 5.700e-02, 2.301e-05, 1.064e-01, 1.485e-01,
                       1.807e-01, 1.247e-01, 7.220e-02, 5.090e-02, 3.512e-01, 1.430e-02,
                       3.466e-01, 1.400e-03, 3.344e-01, 1.110e-02]),
                array([['28_9', '28_9_100', '1:', '1:', '2:', '1:', 'A1,2:', '2:', '2:',
                        '2:', '2:', '1:', 'A1,2:', '1:', '1:', '1:', '1:', '2:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                       ['28_9', '28_9_100', '2:', '1:', '1:', '1:', 'A1,2:', '1:', '1:',
                        'A1,2:', 'A1,2:', '1:', 'A1,2:', '1:', '1:', '1:', '1:', '1:',
                        '2:', '2:', '2:', '1:', '2:', '1:', '2:', '1:', '2:', '1:', '1:',
                        '2:'],
                       ['28_9', '28_9_101', '1:', '1:', '2:', '1:', 'A2,1:', '2:', '1:',
                        'A2,1:', 'A2,1:', '1:', 'A2,1:', '1:', '1:', '1:', '1:', '2:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2:',
                        '1:'],
                       ['28_9', '28_9_101', '1:', '1:', '?:', '2:', 'A2,1:', '1:', '2:',
                        '2:', '1:', '1:', 'A2,1:', '2:', '1:', '2:', '1:', '1:', '2:',
                        '2:', '2:', '2:', '1:', '1:', '2:', '1:', '2:', '2:', '2:', '1:'],
                       ['28_9', '28_9_186', '2:', '2:', '1:', '2:', 'A2,1:', '1:', '?:',
                        '1:', '1:', '1:', 'A2,1:', '1:', '1:', '1:', '2:', '?:', '2:',
                        '2:', '2:', '2:', '2:', '1:', '2:', '2:', '2:', '1:', '2:', '1:'],
                       ['28_9', '28_9_186', '1:', '1:', '1:', '1:', 'A2,1:', '2:', '?:',
                        '2:', '2:', '2:', 'A2,1:', '1:', '2:', '1:', '1:', '1:', '1:',
                        '1:', '1:', '1:', '1:', '2:', '1:', '1:', '1:', '1:', '1:', '2:'],
                       ['28_9', '28_9_114', '2:', '1|', '1|', '1|', 'A1,2|', '1|', '1|',
                        'A1,2|', 'A1,2|', '1|', 'A1,2|', '1|', '1\\', '1|', '1|', '1|',
                        '1/', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|',
                        '1|'],
                       ['28_9', '28_9_114', '1:', '1|', '2|', '1|', 'A2,1|', '2|', '1|',
                        'A2,1|', 'A2,1|', '1|', 'A2,1|', '1|', '1\\', '2|', '1|', '1|',
                        '2/', '2|', '2|', '2|', '1|', '1|', '2|', '1|', '2|', '2|', '2|',
                        '1|'],
                       ['28_9', '28_9_105', '2:', '1|', '1|', '1|', 'A1,2|', '1|', '1|',
                        'A1,2|', 'A1,2|', '1|', 'A1,2|', '1|', '1|', '1|', '1|', '1|',
                        '2|', '2|', '2|', '1|', '2|', '1|', '2|', '1|', '2|', '1\\',
                        '1|', '1/'],
                       ['28_9', '28_9_105', '1:', '1|', '2|', '1|', 'A2,1|', '2|', '1|',
                        'A2,1|', 'A2,1|', '1|', 'A2,1|', '1|', '1|', '1|', '1|', '2|',
                        '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '2\\',
                        '2|', '1/'],
                       ['28_9', '28_9_103', '1:', '1|', '2|', '1|', 'A1,2|', '2|', '2\\',
                        '2|', '2|', '1\\', 'A1,2|', '1|', '1|', '1|', '1|', '2|', '1|',
                        '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|'],
                       ['28_9', '28_9_103', '1:', '1|', '2|', '1|', 'A2,1|', '2|', '2\\',
                        '2|', '1|', '1\\', 'A2,1|', '1|', '1|', '1|', '1|', '2|', '1|',
                        '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '2|', '1|'],
                       ['28_9', '28_9_111', '1:', '1|', '2|', '1|', 'A1,2|', '2|', '2|',
                        '2|', '2|', '1|', 'A1,2|', '1|', '1|', '1|', '1|', '2\\', '1|',
                        '1|', '1|', '1|', '1|', '1\\', '1|', '1\\', '1\\', '1|', '1|',
                        '1\\'],
                       ['28_9', '28_9_111', '2:', '2|', '1|', '2|', 'A2,1|', '1|', '?|',
                        '1|', '1|', '1|', 'A2,1|', '1|', '1|', '1|', '2|', '1\\', '1|',
                        '1|', '1|', '1|', '1|', '1\\', '2|', '1\\', '2\\', '1|', '2|',
                        '2\\'],
                       ['28_9', '28_9_110', '1:', '1\\', '2|', '1|', 'A1,2\\', '2|',
                        '2|', '2|', '2|', '1|', 'A1,2|', '1|', '1|', '1|', '1\\', '2|',
                        '1|', '1|', '1|', '1|', '1|', '1|', '1\\', '1|', '1|', '1|',
                        '1|', '1|'],
                       ['28_9', '28_9_110', '2:', '1\\', '1|', '1|', 'A2,1\\', '1|',
                        '?|', '1|', '1|', '1|', 'A2,1|', '1|', '1|', '1|', '1\\', '1|',
                        '1|', '1|', '1|', '1|', '1|', '2|', '2\\', '2|', '2|', '1|',
                        '2|', '1|'],
                       ['28_9', '28_9_108', '1:', '1\\', '2|', '1|', 'A1,2\\', '2|',
                        '2|', '2|', '2|', '1|', 'A1,2|', '1|', '1\\', '1|', '1|', '2|',
                        '1|', '1|', '1|', '1|', '1\\', '1\\', '1|', '1|', '1|', '1|',
                        '1|', '1\\'],
                       ['28_9', '28_9_108', '2:', '1\\', '1|', '1|', 'A2,1\\', '1|',
                        '?|', '1|', '1|', '1|', 'A2,1|', '1|', '2\\', '1|', '1|', '1|',
                        '1|', '1|', '1|', '1|', '2\\', '2\\', '1|', '1|', '1|', '1|',
                        '1|', '1\\'],
                       ['28_9', '28_9_109', '1:', '1|', '2|', '1|', 'A1,2|', '2|', '2|',
                        '2|', '2|', '1|', 'A1,2|', '1|', '1|', '1|', '1|', '2\\', '1|',
                        '1|', '1|', '1|', '1\\', '1|', '1\\', '1|', '1|', '1|', '1|',
                        '1|'],
                       ['28_9', '28_9_109', '1:', '1|', '1|', '1|', 'A2,1|', '2|', '?|',
                        '2|', '2|', '2|', 'A2,1|', '1|', '2|', '1|', '1|', '?\\', '2|',
                        '2|', '2|', '2|', '1\\', '2|', '2\\', '2|', '2|', '1|', '2|',
                        '1|'],
                       ['28_9', '28_9_106', '1:', '1|', '2|', '1|', 'A1,2|', '2|', '2|',
                        '2|', '2|', '1|', 'A1,2|', '1|', '1|', '1|', '1|', '1/', '2\\',
                        '2|', '2|', '1|', '2|', '1|', '2|', '1|', '2|', '1|', '1|', '2|'],
                       ['28_9', '28_9_106', '1:', '1|', '?|', '2|', 'A2,1|', '1|', '2|',
                        '2|', '1|', '1|', 'A2,1|', '2|', '1|', '2|', '1|', '1/', '1\\',
                        '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '2|', '1|']],
                      dtype='<U8')]}),
             ('ld', []),
             ('coder',
              {'input': [{'28_9_103': ['11',
                  '11',
                  '22',
                  '11',
                  '12',
                  '22',
                  '22',
                  '22',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '22',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11'],
                 '28_9_106': ['11',
                  '11',
                  '00',
                  '12',
                  '12',
                  '12',
                  '00',
                  '00',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12'],
                 '28_9_108': ['12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11'],
                 '28_9_109': ['11',
                  '11',
                  '12',
                  '11',
                  '12',
                  '22',
                  '00',
                  '22',
                  '22',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11'],
                 '28_9_111': ['12',
                  '12',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12'],
                 '28_9_105': ['12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '12',
                  '11'],
                 '28_9_114': ['12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '12',
                  '11'],
                 '28_9_110': ['12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11'],
                 '1036_5': ['11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '12',
                  '12'],
                 '1036_99': ['12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11'],
                 '1036_6': ['11',
                  '12',
                  '12',
                  '12',
                  '11',
                  '00',
                  '12',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11'],
                 '1036_4': ['11',
                  '11',
                  '12',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '11'],
                 '1036_3': ['11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11'],
                 '22_1_2': ['11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12'],
                 '22_1_3': ['11',
                  '22',
                  '11',
                  '11',
                  '11',
                  '22',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11'],
                 '22_1_4': ['11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11'],
                 '22_1_5': ['12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11'],
                 '22_1_99': ['12',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12'],
                 '1036_1': [('1', '0')],
                 '1036_2': [('3', '0')],
                 '22_1_10': [('3', '1')],
                 '22_1_20': [('1', '2')]},
                OrderedDict([('1036',
                              array([['1036', '1036_1', '2:', '1:', '2:', '2:', '1:', '2:', 'A2,1:',
                                      '2:', '1:', '1:', '1:', 'A2,1:', '2:', '2:', '2:', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                                     ['1036', '1036_1', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:',
                                      '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:',
                                      '?:', '?:', '?:', '?:', '?:', '?:'],
                                     ['1036', '1036_2', '1:', '1:', '1:', '1:', '1:', '1:', 'A1,2:',
                                      '1:', '1:', '1:', '2:', 'A1,2:', '1:', '1:', '1:', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                                     ['1036', '1036_2', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:',
                                      '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:',
                                      '?:', '?:', '?:', '?:', '?:', '?:'],
                                     ['1036', '1036_6', '1:', '1:', '1:', '1:', '1:', '1:', 'A1,2:',
                                      '1:', '1:', '1:', '2:', 'A2,1:', '2:', '2:', '2:', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                                     ['1036', '1036_6', '1:', '2:', '2:', '2:', '1:', '1:', 'A2,1:',
                                      '1:', '1:', '1:', '1:', 'A1,2:', '1:', '1:', '1:', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '2:', '1:'],
                                     ['1036', '1036_99', '1:', '1|', '1|', '1|', '1:', '1|', 'A1,2|',
                                      '1|', '1:', '1:', '2|', 'A1,2|', '1|', '1|', '1|', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                                     ['1036', '1036_99', '2:', '1|', '2|', '2|', '1:', '2|', 'A2,1|',
                                      '2|', '1:', '1:', '1|', 'A2,1|', '2|', '2|', '2|', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                                     ['1036', '1036_5', '1:', '1|', '1|', '1|', '1:', '2/', 'A2,1|',
                                      '2|', '1:', '1:', '1\\', 'A2,1|', '1/', '1|', '1|', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                                     ['1036', '1036_5', '1:', '1|', '1|', '1|', '1:', '1/', 'A1,2|',
                                      '1|', '1:', '1:', '1\\', 'A1,2|', '1/', '1|', '1|', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '2|', '1:'],
                                     ['1036', '1036_4', '1:', '1|', '1\\', '1|', '1:', '1|', 'A1,2|',
                                      '1|', '1:', '1:', '2|', 'A2,1/', '2|', '2|', '2|', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                                     ['1036', '1036_4', '1:', '1|', '2\\', '2|', '1:', '1|', 'A2,1|',
                                      '1|', '1:', '1:', '1|', 'A1,2/', '1|', '1|', '1|', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '2|', '1:'],
                                     ['1036', '1036_3', '1:', '1|', '1|', '1|', '1:', '1|', 'A1,2|',
                                      '1|', '1:', '1:', '1/', 'A2,1|', '2|', '2|', '2|', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                                     ['1036', '1036_3', '1:', '2|', '2|', '2|', '1:', '1|', 'A2,1|',
                                      '1|', '1:', '1:', '1/', 'A1,2|', '1|', '1|', '1|', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '2|', '1:']], dtype='<U7')),
                             ('22_1',
                              array([['22_1', '22_1_10', '1:', '1:', '1:', '2:', '1:', '1:', 'A1,2:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2:', '2:', '2:',
                                      '2:', '2:', '1:', '1:', '1:', '2:', '1:', '1:', '1:'],
                                     ['22_1', '22_1_10', '1:', '2:', '1:', '1:', '1:', '2:', 'A1,2:',
                                      '1:', '2:', '1:', '2:', '1:', '2:', '1:', '2:', '1:', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2:', '1:'],
                                     ['22_1', '22_1_20', '2:', '2:', '2:', '1:', '1:', '2:', 'A2,1:',
                                      '2:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                                     ['22_1', '22_1_20', '1:', '2:', '1:', '1:', '2:', '1:', 'A2,1:',
                                      '1:', '1:', '2:', '1:', '2:', '?:', '2:', '1:', '1:', '2:', '1:',
                                      '1:', '1:', '2:', '2:', '2:', '1:', '2:', '1:', '2:'],
                                     ['22_1', '22_1_99', '2:', '2|', '2|', '1/', '2|', '1|', 'A2,1/',
                                      '2|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|',
                                      '1|', '1\\', '1|', '1|', '1|', '1|', '2/', '1|', '2|'],
                                     ['22_1', '22_1_99', '1:', '1|', '1|', '2/', '1|', '1|', 'A1,2/',
                                      '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '2|', '2|', '2|',
                                      '2|', '1\\', '1|', '1|', '1|', '1|', '1/', '2|', '1|'],
                                     ['22_1', '22_1_5', '2:', '2|', '2|', '1|', '1|', '1/', 'A2,1|',
                                      '1|', '1|', '2|', '1|', '2|', '1/', '1|', '1|', '1\\', '1|',
                                      '1|', '1\\', '1|', '1|', '1\\', '1|', '1|', '1|', '1|', '1|'],
                                     ['22_1', '22_1_5', '1:', '1|', '1|', '2|', '1|', '1/', 'A1,2|',
                                      '1|', '1|', '1|', '1|', '1|', '1/', '1|', '1|', '1\\', '1|',
                                      '1|', '2\\', '2|', '1|', '1\\', '1|', '1|', '1|', '2|', '1|'],
                                     ['22_1', '22_1_4', '1:', '2|', '1|', '1|', '2|', '1|', 'A2,1|',
                                      '1|', '1/', '1|', '1|', '1|', '1|', '2/', '1|', '1\\', '2|',
                                      '1|', '1/', '1|', '1|', '1|', '1|', '1|', '1|', '1\\', '1|'],
                                     ['22_1', '22_1_4', '1:', '1|', '1|', '2|', '1|', '1|', 'A1,2|',
                                      '1|', '1/', '1|', '1|', '1|', '1|', '1/', '1|', '1\\', '1|',
                                      '1|', '1/', '1|', '1|', '1|', '1|', '1|', '1|', '1\\', '1|'],
                                     ['22_1', '22_1_3', '1:', '2|', '1|', '1/', '1|', '2|', 'A2,1/',
                                      '1|', '1/', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|',
                                      '1|', '1|', '1|', '1\\', '1|', '1|', '1|', '1|', '1|'],
                                     ['22_1', '22_1_3', '1:', '2|', '1|', '1/', '1|', '2|', 'A1,2/',
                                      '1|', '2/', '1|', '2|', '1|', '2|', '1|', '2|', '1|', '1|', '1|',
                                      '1|', '1|', '1|', '1\\', '1|', '2|', '1|', '1|', '1|'],
                                     ['22_1', '22_1_2', '1:', '2|', '1|', '1|', '2|', '1|', 'A2,1|',
                                      '1|', '1|', '2|', '1/', '1|', '1|', '1|', '1\\', '1|', '1|',
                                      '1|', '1/', '1|', '2|', '2|', '2|', '1|', '2|', '1\\', '2|'],
                                     ['22_1', '22_1_2', '1:', '1|', '1|', '2|', '1|', '1|', 'A1,2|',
                                      '1|', '1|', '1|', '1/', '1|', '1|', '1|', '2\\', '1|', '1|',
                                      '1|', '1/', '1|', '1|', '1|', '1|', '1|', '1|', '1\\', '1|']],
                                    dtype='<U7')),
                             ('28_9',
                              array([['28_9', '28_9_100', '1:', '1:', '2:', '1:', 'A1,2:', '2:', '2:',
                                      '2:', '2:', '1:', 'A1,2:', '1:', '1:', '1:', '1:', '2:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                                     ['28_9', '28_9_100', '2:', '1:', '1:', '1:', 'A1,2:', '1:', '1:',
                                      'A1,2:', 'A1,2:', '1:', 'A1,2:', '1:', '1:', '1:', '1:', '1:',
                                      '2:', '2:', '2:', '1:', '2:', '1:', '2:', '1:', '2:', '1:', '1:',
                                      '2:'],
                                     ['28_9', '28_9_101', '1:', '1:', '2:', '1:', 'A2,1:', '2:', '1:',
                                      'A2,1:', 'A2,1:', '1:', 'A2,1:', '1:', '1:', '1:', '1:', '2:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2:',
                                      '1:'],
                                     ['28_9', '28_9_101', '1:', '1:', '?:', '2:', 'A2,1:', '1:', '2:',
                                      '2:', '1:', '1:', 'A2,1:', '2:', '1:', '2:', '1:', '1:', '2:',
                                      '2:', '2:', '2:', '1:', '1:', '2:', '1:', '2:', '2:', '2:', '1:'],
                                     ['28_9', '28_9_186', '2:', '2:', '1:', '2:', 'A2,1:', '1:', '?:',
                                      '1:', '1:', '1:', 'A2,1:', '1:', '1:', '1:', '2:', '?:', '2:',
                                      '2:', '2:', '2:', '2:', '1:', '2:', '2:', '2:', '1:', '2:', '1:'],
                                     ['28_9', '28_9_186', '1:', '1:', '1:', '1:', 'A2,1:', '2:', '?:',
                                      '2:', '2:', '2:', 'A2,1:', '1:', '2:', '1:', '1:', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '2:', '1:', '1:', '1:', '1:', '1:', '2:'],
                                     ['28_9', '28_9_114', '2:', '1|', '1|', '1|', 'A1,2|', '1|', '1|',
                                      'A1,2|', 'A1,2|', '1|', 'A1,2|', '1|', '1\\', '1|', '1|', '1|',
                                      '1/', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|',
                                      '1|'],
                                     ['28_9', '28_9_114', '1:', '1|', '2|', '1|', 'A2,1|', '2|', '1|',
                                      'A2,1|', 'A2,1|', '1|', 'A2,1|', '1|', '1\\', '2|', '1|', '1|',
                                      '2/', '2|', '2|', '2|', '1|', '1|', '2|', '1|', '2|', '2|', '2|',
                                      '1|'],
                                     ['28_9', '28_9_105', '2:', '1|', '1|', '1|', 'A1,2|', '1|', '1|',
                                      'A1,2|', 'A1,2|', '1|', 'A1,2|', '1|', '1|', '1|', '1|', '1|',
                                      '2|', '2|', '2|', '1|', '2|', '1|', '2|', '1|', '2|', '1\\',
                                      '1|', '1/'],
                                     ['28_9', '28_9_105', '1:', '1|', '2|', '1|', 'A2,1|', '2|', '1|',
                                      'A2,1|', 'A2,1|', '1|', 'A2,1|', '1|', '1|', '1|', '1|', '2|',
                                      '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '2\\',
                                      '2|', '1/'],
                                     ['28_9', '28_9_103', '1:', '1|', '2|', '1|', 'A1,2|', '2|', '2\\',
                                      '2|', '2|', '1\\', 'A1,2|', '1|', '1|', '1|', '1|', '2|', '1|',
                                      '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|'],
                                     ['28_9', '28_9_103', '1:', '1|', '2|', '1|', 'A2,1|', '2|', '2\\',
                                      '2|', '1|', '1\\', 'A2,1|', '1|', '1|', '1|', '1|', '2|', '1|',
                                      '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '2|', '1|'],
                                     ['28_9', '28_9_111', '1:', '1|', '2|', '1|', 'A1,2|', '2|', '2|',
                                      '2|', '2|', '1|', 'A1,2|', '1|', '1|', '1|', '1|', '2\\', '1|',
                                      '1|', '1|', '1|', '1|', '1\\', '1|', '1\\', '1\\', '1|', '1|',
                                      '1\\'],
                                     ['28_9', '28_9_111', '2:', '2|', '1|', '2|', 'A2,1|', '1|', '?|',
                                      '1|', '1|', '1|', 'A2,1|', '1|', '1|', '1|', '2|', '1\\', '1|',
                                      '1|', '1|', '1|', '1|', '1\\', '2|', '1\\', '2\\', '1|', '2|',
                                      '2\\'],
                                     ['28_9', '28_9_110', '1:', '1\\', '2|', '1|', 'A1,2\\', '2|',
                                      '2|', '2|', '2|', '1|', 'A1,2|', '1|', '1|', '1|', '1\\', '2|',
                                      '1|', '1|', '1|', '1|', '1|', '1|', '1\\', '1|', '1|', '1|',
                                      '1|', '1|'],
                                     ['28_9', '28_9_110', '2:', '1\\', '1|', '1|', 'A2,1\\', '1|',
                                      '?|', '1|', '1|', '1|', 'A2,1|', '1|', '1|', '1|', '1\\', '1|',
                                      '1|', '1|', '1|', '1|', '1|', '2|', '2\\', '2|', '2|', '1|',
                                      '2|', '1|'],
                                     ['28_9', '28_9_108', '1:', '1\\', '2|', '1|', 'A1,2\\', '2|',
                                      '2|', '2|', '2|', '1|', 'A1,2|', '1|', '1\\', '1|', '1|', '2|',
                                      '1|', '1|', '1|', '1|', '1\\', '1\\', '1|', '1|', '1|', '1|',
                                      '1|', '1\\'],
                                     ['28_9', '28_9_108', '2:', '1\\', '1|', '1|', 'A2,1\\', '1|',
                                      '?|', '1|', '1|', '1|', 'A2,1|', '1|', '2\\', '1|', '1|', '1|',
                                      '1|', '1|', '1|', '1|', '2\\', '2\\', '1|', '1|', '1|', '1|',
                                      '1|', '1\\'],
                                     ['28_9', '28_9_109', '1:', '1|', '2|', '1|', 'A1,2|', '2|', '2|',
                                      '2|', '2|', '1|', 'A1,2|', '1|', '1|', '1|', '1|', '2\\', '1|',
                                      '1|', '1|', '1|', '1\\', '1|', '1\\', '1|', '1|', '1|', '1|',
                                      '1|'],
                                     ['28_9', '28_9_109', '1:', '1|', '1|', '1|', 'A2,1|', '2|', '?|',
                                      '2|', '2|', '2|', 'A2,1|', '1|', '2|', '1|', '1|', '?\\', '2|',
                                      '2|', '2|', '2|', '1\\', '2|', '2\\', '2|', '2|', '1|', '2|',
                                      '1|'],
                                     ['28_9', '28_9_106', '1:', '1|', '2|', '1|', 'A1,2|', '2|', '2|',
                                      '2|', '2|', '1|', 'A1,2|', '1|', '1|', '1|', '1|', '1/', '2\\',
                                      '2|', '2|', '1|', '2|', '1|', '2|', '1|', '2|', '1|', '1|', '2|'],
                                     ['28_9', '28_9_106', '1:', '1|', '?|', '2|', 'A2,1|', '1|', '2|',
                                      '2|', '1|', '1|', 'A2,1|', '2|', '1|', '2|', '1|', '1/', '1\\',
                                      '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '2|', '1|']],
                                    dtype='<U8'))]),
                OrderedDict([('1036',
                              array([0.1907, 0.4209, 0.335 , 0.2784, 0.0084, 0.0294, 0.5035, 0.0695,
                                     0.0017, 0.2078, 0.0224, 0.1217, 0.0146, 0.0136, 0.0305, 0.075 ,
                                     0.0933, 0.0745, 0.0926, 0.3311, 0.3091, 0.003 , 0.0031, 0.3041,
                                     0.0084])),
                             ('22_1',
                              array([3.038e-01, 4.487e-01, 7.190e-02, 3.680e-01, 3.322e-01, 2.290e-02,
                                     4.994e-01, 9.850e-02, 2.210e-02, 2.135e-01, 3.000e-04, 2.090e-02,
                                     1.000e-04, 2.000e-04, 1.783e-01, 2.810e-02, 3.420e-02, 1.150e-02,
                                     2.301e-05, 3.830e-02, 1.485e-01, 1.807e-01, 1.247e-01, 5.090e-02,
                                     3.512e-01, 3.466e-01, 3.344e-01])),
                             ('28_9',
                              array([3.038e-01, 5.100e-03, 4.487e-01, 7.190e-02, 3.680e-01, 3.322e-01,
                                     2.400e-03, 2.290e-02, 4.994e-01, 8.800e-03, 2.135e-01, 1.040e-02,
                                     4.100e-03, 1.790e-02, 5.700e-02, 2.301e-05, 1.064e-01, 1.485e-01,
                                     1.807e-01, 1.247e-01, 7.220e-02, 5.090e-02, 3.512e-01, 1.430e-02,
                                     3.466e-01, 1.400e-03, 3.344e-01, 1.110e-02]))]),
                OrderedDict([('1036',
                              array(['V3-14464', 'V8-14653', 'V16-14907', 'V17-14930', 'V18-14933',
                                     'V36-16103', 'V44-16378', 'V49-16487', 'V71-17358', 'V77-17385',
                                     'V81-17407', 'V114-17697', 'V139-17928', 'V140-17929',
                                     'V146-20184', 'V147-20191', 'V149-20212', 'V152-20227',
                                     'V156-20235', 'V158-20250', 'V165-20316', 'V167-20485',
                                     'V169-20522', 'V171-20547', 'V180-29368'], dtype='<U10')),
                             ('22_1',
                              array(['V3-14464', 'V8-14653', 'V9-14677', 'V16-14907', 'V17-14930',
                                     'V36-16103', 'V44-16378', 'V49-16487', 'V72-17365', 'V77-17385',
                                     'V78-17398', 'V81-17407', 'V86-17479', 'V99-17559', 'V114-17697',
                                     'V119-17722', 'V121-17746', 'V131-17829', 'V142-19190',
                                     'V146-20184', 'V147-20191', 'V149-20212', 'V152-20227',
                                     'V156-20235', 'V158-20250', 'V165-20316', 'V171-20547'],
                                    dtype='<U10')),
                             ('28_9',
                              array(['V3-14464', 'V5-14470', 'V8-14653', 'V9-14677', 'V16-14907',
                                     'V17-14930', 'V31-16068', 'V36-16103', 'V44-16378', 'V76-17379',
                                     'V77-17385', 'V82-17408', 'V96-17519', 'V98-17556', 'V107-17614',
                                     'V142-19190', 'V145-20166', 'V147-20191', 'V149-20212',
                                     'V152-20227', 'V153-20227', 'V156-20235', 'V158-20250',
                                     'V161-20254', 'V165-20316', 'V170-20545', 'V171-20547',
                                     'V180-29368'], dtype='<U10'))]),
                None],
               'output': [(('1036',
                  '1036_1',
                  '2,2,3,1,2,3',
                  '21,221,22211,1,2,2221111111111',
                  '0,0,0,0,0,0',
                  'NULL,NULL,NULL,NULL,NULL,NULL'),
                 ('1036',
                  '1036_2',
                  '1,1,1,2,1,1',
                  '11,111,11111,2,1,1111111111111',
                  '0,0,0,0,0,0',
                  'NULL,NULL,NULL,NULL,NULL,NULL'),
                 ('1036',
                  '1036_6',
                  '1,1,1,2,2,3',
                  '11,111,11111,2,2,2221111111111',
                  '3,2,2,1,1,2',
                  '12,221,12111,1,1,1111111111121'),
                 ('1036',
                  '1036_99',
                  '1,1,1,2,1,1',
                  '11,111,11111,2,1,1111111111111',
                  '2,2,3,1,2,3',
                  '21,221,22211,1,2,2221111111111'),
                 ('1036',
                  '1036_5',
                  '1,1,3,1,2,1',
                  '11,111,22211,1,2,1111111111111',
                  '1,1,1,1,1,2',
                  '11,111,11111,1,1,1111111111121'),
                 ('1036',
                  '1036_4',
                  '1,1,1,2,2,3',
                  '11,111,11111,2,2,2221111111111',
                  '1,2,2,1,1,2',
                  '11,221,12111,1,1,1111111111121'),
                 ('1036',
                  '1036_3',
                  '1,1,1,1,2,3',
                  '11,111,11111,1,2,2221111111111',
                  '3,2,2,1,1,2',
                  '12,221,12111,1,1,1111111111121'),
                 ('22_1',
                  '22_1_10',
                  '1,2,1,1,1,1,1,1,1,3,2,2,2,1,1',
                  '111,21,1,11,11,11,1,1,1,222,2,21,112,1,11',
                  '2,1,2,1,2,2,2,1,2,1,1,1,1,1,2',
                  '121,11,2,11,21,21,2,1,2,111,1,11,111,1,21'),
                 ('22_1',
                  '22_1_20',
                  '3,1,2,3,1,1,1,1,1,1,1,1,1,1,1',
                  '222,11,2,22,11,11,1,1,1,111,1,11,111,1,11',
                  '2,3,1,2,3,3,0,2,1,2,1,3,3,2,3',
                  '121,12,1,21,12,12,NULL,2,1,121,1,12,221,2,12'),
                 ('22_1',
                  '22_1_99',
                  '3,3,1,3,1,1,1,1,1,1,1,1,1,2,3',
                  '222,12,1,22,11,11,1,1,1,111,1,11,111,2,12',
                  '1,2,1,1,1,1,1,1,1,3,2,1,1,1,2',
                  '111,21,1,11,11,11,1,1,1,222,2,11,111,1,21'),
                 ('22_1',
                  '22_1_5',
                  '3,1,1,2,3,3,1,1,1,1,1,1,1,1,1',
                  '222,11,1,21,12,12,1,1,1,111,1,11,111,1,11',
                  '1,2,1,1,1,1,1,1,1,1,2,2,1,1,2',
                  '111,21,1,11,11,11,1,1,1,111,2,21,111,1,21'),
                 ('22_1',
                  '22_1_4',
                  '2,3,1,2,1,1,1,2,1,2,1,1,1,1,1',
                  '121,12,1,21,11,11,1,2,1,121,1,11,111,1,11',
                  '1,2,1,1,1,1,1,1,1,1,1,1,1,1,1',
                  '111,21,1,11,11,11,1,1,1,111,1,11,111,1,11'),
                 ('22_1',
                  '22_1_3',
                  '2,1,2,2,1,1,1,1,1,1,1,1,1,1,1',
                  '121,11,2,21,11,11,1,1,1,111,1,11,111,1,11',
                  '2,1,2,1,2,2,2,1,2,1,1,1,2,1,1',
                  '121,11,2,11,21,21,2,1,2,111,1,11,112,1,11'),
                 ('22_1',
                  '22_1_2',
                  '2,3,1,2,3,1,1,1,1,1,1,3,3,2,3',
                  '121,12,1,21,12,11,1,1,1,111,1,12,221,2,12',
                  '1,2,1,1,1,1,1,1,2,1,1,1,1,1,1',
                  '111,21,1,11,11,11,1,1,2,111,1,11,111,1,11'),
                 ('28_9',
                  '28_9_100',
                  '1,2,2,4,1,1,1,2,1,1,1,1,1,1,1,1',
                  '1,121,12,222,111,11,1,2,1111,1,1,1,1,1,11,1',
                  '2,1,1,1,1,1,1,1,2,2,1,2,1,2,1,2',
                  '2,111,11,111,111,11,1,1,2221,2,1,2,1,2,11,2'),
                 ('28_9',
                  '28_9_101',
                  '1,2,4,2,2,1,1,2,1,1,1,1,1,1,2,1',
                  '1,121,22,122,121,11,1,2,1111,1,1,1,1,1,12,1',
                  '1,0,3,3,3,2,1,1,3,1,1,2,1,2,3,1',
                  '1,NULL,21,221,122,12,1,1,2222,1,1,2,1,2,22,1'),
                 ('28_9',
                  '28_9_186',
                  '2,3,3,0,2,1,2,0,3,2,1,2,2,2,2,1',
                  '2,212,21,NULL,121,11,2,NULL,2222,2,1,2,2,2,12,1',
                  '1,1,4,0,4,3,1,1,1,1,2,1,1,1,1,2',
                  '1,111,22,NULL,221,21,1,1,1111,1,2,1,1,1,11,2'),
                 ('28_9',
                  '28_9_114',
                  '2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1',
                  '2,111,11,111,111,11,1,1,1111,1,1,1,1,1,11,1',
                  '1,2,4,2,2,2,1,1,3,1,1,2,1,2,3,1',
                  '1,121,22,122,121,12,1,1,2222,1,1,2,1,2,22,1'),
                 ('28_9',
                  '28_9_105',
                  '2,1,1,1,1,1,1,1,2,2,1,2,1,2,1,1',
                  '2,111,11,111,111,11,1,1,2221,2,1,2,1,2,11,1',
                  '1,2,4,2,2,1,1,2,1,1,1,1,1,1,3,1',
                  '1,121,22,122,121,11,1,2,1111,1,1,1,1,1,22,1'),
                 ('28_9',
                  '28_9_103',
                  '1,2,2,4,1,1,1,2,1,1,1,1,1,1,1,1',
                  '1,121,12,222,111,11,1,2,1111,1,1,1,1,1,11,1',
                  '1,2,4,3,2,1,1,2,1,1,1,1,1,1,2,1',
                  '1,121,22,221,121,11,1,2,1111,1,1,1,1,1,12,1'),
                 ('28_9',
                  '28_9_111',
                  '1,2,2,4,1,1,1,2,1,1,1,1,1,1,1,1',
                  '1,121,12,222,111,11,1,2,1111,1,1,1,1,1,11,1',
                  '2,3,3,0,2,1,2,1,1,1,1,2,1,2,2,2',
                  '2,212,21,NULL,121,11,2,1,1111,1,1,2,1,2,12,2'),
                 ('28_9',
                  '28_9_110',
                  '1,2,2,4,1,1,1,2,1,1,1,1,1,1,1,1',
                  '1,121,12,222,111,11,1,2,1111,1,1,1,1,1,11,1',
                  '2,1,3,0,2,1,1,1,1,1,2,2,2,2,2,1',
                  '2,111,21,NULL,121,11,1,1,1111,1,2,2,2,2,12,1'),
                 ('28_9',
                  '28_9_108',
                  '1,2,2,4,1,1,1,2,1,1,1,1,1,1,1,1',
                  '1,121,12,222,111,11,1,2,1111,1,1,1,1,1,11,1',
                  '2,1,3,0,2,3,1,1,1,2,2,1,1,1,1,1',
                  '2,111,21,NULL,121,21,1,1,1111,2,2,1,1,1,11,1'),
                 ('28_9',
                  '28_9_109',
                  '1,2,2,4,1,1,1,2,1,1,1,1,1,1,1,1',
                  '1,121,12,222,111,11,1,2,1111,1,1,1,1,1,11,1',
                  '1,1,4,0,4,3,1,0,3,1,2,2,2,2,2,1',
                  '1,111,22,NULL,221,21,1,NULL,2222,1,2,2,2,2,12,1'),
                 ('28_9',
                  '28_9_106',
                  '1,2,2,4,1,1,1,1,2,2,1,2,1,2,1,2',
                  '1,121,12,222,111,11,1,1,2221,2,1,2,1,2,11,2',
                  '1,0,3,3,3,2,1,1,1,1,1,1,1,1,2,1',
                  '1,NULL,21,221,122,12,1,1,1111,1,1,1,1,1,12,1')),
                {'28_9_103': (['1',
                   '2',
                   '2',
                   '4',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['1',
                   '2',
                   '4',
                   '3',
                   '2',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1']),
                 '28_9_106': (['1',
                   '2',
                   '2',
                   '4',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '2',
                   '1',
                   '2',
                   '1',
                   '2',
                   '1',
                   '2'],
                  ['1',
                   '0',
                   '3',
                   '3',
                   '3',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1']),
                 '28_9_108': (['1',
                   '2',
                   '2',
                   '4',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['2',
                   '1',
                   '3',
                   '0',
                   '2',
                   '3',
                   '1',
                   '1',
                   '1',
                   '2',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1']),
                 '28_9_109': (['1',
                   '2',
                   '2',
                   '4',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['1',
                   '1',
                   '4',
                   '0',
                   '4',
                   '3',
                   '1',
                   '0',
                   '3',
                   '1',
                   '2',
                   '2',
                   '2',
                   '2',
                   '2',
                   '1']),
                 '28_9_111': (['1',
                   '2',
                   '2',
                   '4',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['2',
                   '3',
                   '3',
                   '0',
                   '2',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '2',
                   '2',
                   '2']),
                 '28_9_105': (['2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '2',
                   '1',
                   '2',
                   '1',
                   '2',
                   '1',
                   '1'],
                  ['1',
                   '2',
                   '4',
                   '2',
                   '2',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '3',
                   '1']),
                 '28_9_114': (['2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['1',
                   '2',
                   '4',
                   '2',
                   '2',
                   '2',
                   '1',
                   '1',
                   '3',
                   '1',
                   '1',
                   '2',
                   '1',
                   '2',
                   '3',
                   '1']),
                 '28_9_110': (['1',
                   '2',
                   '2',
                   '4',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['2',
                   '1',
                   '3',
                   '0',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '2',
                   '2',
                   '2',
                   '2',
                   '1']),
                 '1036_5': (['1', '1', '3', '1', '2', '1'],
                  ['1', '1', '1', '1', '1', '2']),
                 '1036_99': (['1', '1', '1', '2', '1', '1'],
                  ['2', '2', '3', '1', '2', '3']),
                 '1036_6': (['1', '1', '1', '2', '2', '3'],
                  ['3', '2', '2', '1', '1', '2']),
                 '1036_4': (['1', '1', '1', '2', '2', '3'],
                  ['1', '2', '2', '1', '1', '2']),
                 '1036_3': (['1', '1', '1', '1', '2', '3'],
                  ['3', '2', '2', '1', '1', '2']),
                 '22_1_2': (['2',
                   '3',
                   '1',
                   '2',
                   '3',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '3',
                   '3',
                   '2',
                   '3'],
                  ['1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1']),
                 '22_1_3': (['2',
                   '1',
                   '2',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['2',
                   '1',
                   '2',
                   '1',
                   '2',
                   '2',
                   '2',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1']),
                 '22_1_4': (['2',
                   '3',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1']),
                 '22_1_5': (['3',
                   '1',
                   '1',
                   '2',
                   '3',
                   '3',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '2',
                   '1',
                   '1',
                   '2']),
                 '22_1_99': (['3',
                   '3',
                   '1',
                   '3',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '3'],
                  ['1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '3',
                   '2',
                   '1',
                   '1',
                   '1',
                   '2']),
                 '1036_1': (['2', '2', '3', '1', '2', '3'],
                  ['0', '0', '0', '0', '0', '0']),
                 '1036_2': (['1', '1', '1', '2', '1', '1'],
                  ['0', '0', '0', '0', '0', '0']),
                 '22_1_10': (['1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '3',
                   '2',
                   '2',
                   '2',
                   '1',
                   '1'],
                  ['2',
                   '1',
                   '2',
                   '1',
                   '2',
                   '2',
                   '2',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2']),
                 '22_1_20': (['3',
                   '1',
                   '2',
                   '3',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['2',
                   '3',
                   '1',
                   '2',
                   '3',
                   '3',
                   '0',
                   '2',
                   '1',
                   '2',
                   '1',
                   '3',
                   '3',
                   '2',
                   '3']),
                 '28_9_100': (['1',
                   '2',
                   '2',
                   '4',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '2',
                   '1',
                   '2',
                   '1',
                   '2',
                   '1',
                   '2']),
                 '28_9_101': (['1',
                   '2',
                   '4',
                   '2',
                   '2',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1'],
                  ['1',
                   '0',
                   '3',
                   '3',
                   '3',
                   '2',
                   '1',
                   '1',
                   '3',
                   '1',
                   '1',
                   '2',
                   '1',
                   '2',
                   '3',
                   '1']),
                 '28_9_186': (['2',
                   '3',
                   '3',
                   '0',
                   '2',
                   '1',
                   '2',
                   '0',
                   '3',
                   '2',
                   '1',
                   '2',
                   '2',
                   '2',
                   '2',
                   '1'],
                  ['1',
                   '1',
                   '4',
                   '0',
                   '4',
                   '3',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2'])},
                16,
                OrderedDict([('1036',
                              ((0.5095662892319659,
                                0.1200720268831532,
                                0.3703616838848809),
                               (0.8372719532111501, 0.16272804678884994),
                               (0.4959350633372792,
                                0.5029270984699294,
                                0.001137838192791339),
                               (0.9776, 0.022399999999999975),
                               (0.8783, 0.12170000000000003),
                               (0.6958968877827948,
                                0.3040986399982008,
                                4.4722190044708225e-06))),
                             ('22_1',
                              ((0.5430625312998345,
                                0.441995570096564,
                                0.014941898603601638),
                               (0.4808309970579335,
                                0.27997754259069546,
                                0.23919146035137098),
                               (0.9771, 0.02290000000000003),
                               (0.4746978223942187,
                                0.47355991311161183,
                                0.05174226449416947),
                               (0.7727645234894062,
                                0.01746405150743009,
                                0.20977142500316368),
                               (0.9788124071537928,
                                0.0002937318416986151,
                                0.02089386100450853),
                               (0.9999, 9.999999999998899e-05),
                               (0.9998, 0.00019999999999997797),
                               (0.8217, 0.17830000000000001),
                               (0.9657888899959897,
                                0.03419960658300151,
                                1.1503421008744192e-05),
                               (0.99997699, 2.3010000000045494e-05),
                               (0.823571654966203,
                                0.03279899592929768,
                                0.14362934910449926),
                               (0.9216155844553127,
                                0.049426017541645106,
                                0.02895839800304216),
                               (0.6488, 0.35119999999999996),
                               (0.4919178095579019,
                                0.26094079092863304,
                                0.24714139951346517))),
                             ('28_9',
                              ((0.6961999999999999, 0.30380000000000007),
                               (0.5511793282039936,
                                0.4486017858972101,
                                0.00021888589879619984),
                               (0.42204959999999997,
                                0.20995040000000004,
                                0.24575039999999998,
                                0.12224960000000001),
                               (0.9770461078438263,
                                0.022843845846329314,
                                5.508918270812987e-05,
                                5.4957127136316546e-05),
                               (0.7832579269862147,
                                0.2126199204215599,
                                0.002234485824963839,
                                0.001887666767261636),
                               (0.9781451760744719,
                                0.017827918390930737,
                                0.004026905534597177),
                               (0.943, 0.05700000000000005),
                               (0.99997699, 2.3010000000045494e-05),
                               (0.9947948641004132,
                                0.004556055452908289,
                                0.000649080446678469),
                               (0.9278, 0.07220000000000004),
                               (0.9491, 0.050899999999999945),
                               (0.6488, 0.35119999999999996),
                               (0.9857, 0.01429999999999998),
                               (0.6534, 0.3466),
                               (0.6652881020650283,
                                0.33424330127786284,
                                0.0004685966571089461),
                               (0.9889, 0.011099999999999999)))])]}),
             ('format',
                 28_9_103 28_9_106 28_9_108 28_9_109 28_9_111 28_9_105 28_9_114 28_9_110  \
              0    (1, 1)   (1, 1)   (1, 2)   (1, 1)   (1, 2)   (2, 1)   (2, 1)   (1, 2)   
              1    (2, 2)   (2, 0)   (2, 1)   (2, 1)   (2, 3)   (1, 2)   (1, 2)   (2, 1)   
              2    (2, 4)   (2, 3)   (2, 3)   (2, 4)   (2, 3)   (1, 4)   (1, 4)   (2, 3)   
              3    (4, 3)   (4, 3)   (4, 0)   (4, 0)   (4, 0)   (1, 2)   (1, 2)   (4, 0)   
              4    (1, 2)   (1, 3)   (1, 2)   (1, 4)   (1, 2)   (1, 2)   (1, 2)   (1, 2)   
              5    (1, 1)   (1, 2)   (1, 3)   (1, 3)   (1, 1)   (1, 1)   (1, 2)   (1, 1)   
              6    (1, 1)   (1, 1)   (1, 1)   (1, 1)   (1, 2)   (1, 1)   (1, 1)   (1, 1)   
              7    (2, 2)   (1, 1)   (2, 1)   (2, 0)   (2, 1)   (1, 2)   (1, 1)   (2, 1)   
              8    (1, 1)   (2, 1)   (1, 1)   (1, 3)   (1, 1)   (2, 1)   (1, 3)   (1, 1)   
              9    (1, 1)   (2, 1)   (1, 2)   (1, 1)   (1, 1)   (2, 1)   (1, 1)   (1, 1)   
              10   (1, 1)   (1, 1)   (1, 2)   (1, 2)   (1, 1)   (1, 1)   (1, 1)   (1, 2)   
              11   (1, 1)   (2, 1)   (1, 1)   (1, 2)   (1, 2)   (2, 1)   (1, 2)   (1, 2)   
              12   (1, 1)   (1, 1)   (1, 1)   (1, 2)   (1, 1)   (1, 1)   (1, 1)   (1, 2)   
              13   (1, 1)   (2, 1)   (1, 1)   (1, 2)   (1, 2)   (2, 1)   (1, 2)   (1, 2)   
              14   (1, 2)   (1, 2)   (1, 1)   (1, 2)   (1, 2)   (1, 3)   (1, 3)   (1, 2)   
              15   (1, 1)   (2, 1)   (1, 1)   (1, 1)   (1, 2)   (1, 1)   (1, 1)   (1, 1)   
              
                  1036_5 1036_99  ...  22_1_4  22_1_5 22_1_99  1036_1  1036_2 22_1_10  \
              0   (1, 1)  (1, 2)  ...  (2, 1)  (3, 1)  (3, 1)  (2, 0)  (1, 0)  (1, 2)   
              1   (1, 1)  (1, 2)  ...  (3, 2)  (1, 2)  (3, 2)  (2, 0)  (1, 0)  (2, 1)   
              2   (3, 1)  (1, 3)  ...  (1, 1)  (1, 1)  (1, 1)  (3, 0)  (1, 0)  (1, 2)   
              3   (1, 1)  (2, 1)  ...  (2, 1)  (2, 1)  (3, 1)  (1, 0)  (2, 0)  (1, 1)   
              4   (2, 1)  (1, 2)  ...  (1, 1)  (3, 1)  (1, 1)  (2, 0)  (1, 0)  (1, 2)   
              5   (1, 2)  (1, 3)  ...  (1, 1)  (3, 1)  (1, 1)  (3, 0)  (1, 0)  (1, 2)   
              6   (0, 0)  (0, 0)  ...  (1, 1)  (1, 1)  (1, 1)  (0, 0)  (0, 0)  (1, 2)   
              7   (0, 0)  (0, 0)  ...  (2, 1)  (1, 1)  (1, 1)  (0, 0)  (0, 0)  (1, 1)   
              8   (0, 0)  (0, 0)  ...  (1, 1)  (1, 1)  (1, 1)  (0, 0)  (0, 0)  (1, 2)   
              9   (0, 0)  (0, 0)  ...  (2, 1)  (1, 1)  (1, 3)  (0, 0)  (0, 0)  (3, 1)   
              10  (0, 0)  (0, 0)  ...  (1, 1)  (1, 2)  (1, 2)  (0, 0)  (0, 0)  (2, 1)   
              11  (0, 0)  (0, 0)  ...  (1, 1)  (1, 2)  (1, 1)  (0, 0)  (0, 0)  (2, 1)   
              12  (0, 0)  (0, 0)  ...  (1, 1)  (1, 1)  (1, 1)  (0, 0)  (0, 0)  (2, 1)   
              13  (0, 0)  (0, 0)  ...  (1, 1)  (1, 1)  (2, 1)  (0, 0)  (0, 0)  (1, 1)   
              14  (0, 0)  (0, 0)  ...  (1, 1)  (1, 2)  (3, 2)  (0, 0)  (0, 0)  (1, 2)   
              15  (0, 0)  (0, 0)  ...  (0, 0)  (0, 0)  (0, 0)  (0, 0)  (0, 0)  (0, 0)   
              
                 22_1_20 28_9_100 28_9_101 28_9_186  
              0   (3, 2)   (1, 2)   (1, 1)   (2, 1)  
              1   (1, 3)   (2, 1)   (2, 0)   (3, 1)  
              2   (2, 1)   (2, 1)   (4, 3)   (3, 4)  
              3   (3, 2)   (4, 1)   (2, 3)   (0, 0)  
              4   (1, 3)   (1, 1)   (2, 3)   (2, 4)  
              5   (1, 3)   (1, 1)   (1, 2)   (1, 3)  
              6   (1, 0)   (1, 1)   (1, 1)   (2, 1)  
              7   (1, 2)   (2, 1)   (2, 1)   (0, 1)  
              8   (1, 1)   (1, 2)   (1, 3)   (3, 1)  
              9   (1, 2)   (1, 2)   (1, 1)   (2, 1)  
              10  (1, 1)   (1, 1)   (1, 1)   (1, 2)  
              11  (1, 3)   (1, 2)   (1, 2)   (2, 1)  
              12  (1, 3)   (1, 1)   (1, 1)   (2, 1)  
              13  (1, 2)   (1, 2)   (1, 2)   (2, 1)  
              14  (1, 3)   (1, 1)   (2, 3)   (2, 1)  
              15  (0, 0)   (1, 2)   (1, 1)   (1, 2)  
              
              [16 rows x 25 columns])])
{% endraw %} {% raw %}
env.dtest['WASH7P']
OrderedDict([('dregions',
              [['1',
                '14361',
                '29370',
                'WASH7P',
                '1.5299877409602128e-06',
                '1.94345806118021e-06',
                '1.136044574393209e-06']]),
             ('dvariants',
              [[['1', 14378, 'WASH7P'],
                ['1', 14429, 'WASH7P'],
                ['1', 14458, 'WASH7P'],
                ['1', 14464, 'WASH7P'],
                ['1', 14469, 'WASH7P'],
                ['1', 14470, 'WASH7P'],
                ['1', 14488, 'WASH7P'],
                ['1', 14521, 'WASH7P'],
                ['1', 14653, 'WASH7P'],
                ['1', 14662, 'WASH7P'],
                ['1', 14677, 'WASH7P'],
                ['1', 14731, 'WASH7P'],
                ['1', 14742, 'WASH7P'],
                ['1', 14747, 'WASH7P'],
                ['1', 14773, 'WASH7P'],
                ['1', 14792, 'WASH7P'],
                ['1', 14843, 'WASH7P'],
                ['1', 14861, 'WASH7P'],
                ['1', 14907, 'WASH7P'],
                ['1', 14930, 'WASH7P'],
                ['1', 14933, 'WASH7P'],
                ['1', 15207, 'WASH7P'],
                ['1', 15219, 'WASH7P'],
                ['1', 15219, 'WASH7P'],
                ['1', 15746, 'WASH7P'],
                ['1', 15773, 'WASH7P'],
                ['1', 15777, 'WASH7P'],
                ['1', 15811, 'WASH7P'],
                ['1', 15835, 'WASH7P'],
                ['1', 15837, 'WASH7P'],
                ['1', 15849, 'WASH7P'],
                ['1', 15913, 'WASH7P'],
                ['1', 15989, 'WASH7P'],
                ['1', 16006, 'WASH7P'],
                ['1', 16068, 'WASH7P'],
                ['1', 16071, 'WASH7P'],
                ['1', 16074, 'WASH7P'],
                ['1', 16079, 'WASH7P'],
                ['1', 16101, 'WASH7P'],
                ['1', 16102, 'WASH7P'],
                ['1', 16103, 'WASH7P'],
                ['1', 16127, 'WASH7P'],
                ['1', 16128, 'WASH7P'],
                ['1', 16158, 'WASH7P'],
                ['1', 16206, 'WASH7P'],
                ['1', 16225, 'WASH7P'],
                ['1', 16280, 'WASH7P'],
                ['1', 16310, 'WASH7P'],
                ['1', 16337, 'WASH7P'],
                ['1', 16360, 'WASH7P'],
                ['1', 16378, 'WASH7P'],
                ['1', 16397, 'WASH7P'],
                ['1', 16443, 'WASH7P'],
                ['1', 16451, 'WASH7P'],
                ['1', 16474, 'WASH7P'],
                ['1', 16487, 'WASH7P'],
                ['1', 16531, 'WASH7P'],
                ['1', 16555, 'WASH7P'],
                ['1', 16633, 'WASH7P'],
                ['1', 16722, 'WASH7P'],
                ['1', 16731, 'WASH7P'],
                ['1', 16731, 'WASH7P'],
                ['1', 16734, 'WASH7P'],
                ['1', 16734, 'WASH7P'],
                ['1', 16911, 'WASH7P'],
                ['1', 17005, 'WASH7P'],
                ['1', 17135, 'WASH7P'],
                ['1', 17146, 'WASH7P'],
                ['1', 17147, 'WASH7P'],
                ['1', 17147, 'WASH7P'],
                ['1', 17151, 'WASH7P'],
                ['1', 17181, 'WASH7P'],
                ['1', 17212, 'WASH7P'],
                ['1', 17213, 'WASH7P'],
                ['1', 17217, 'WASH7P'],
                ['1', 17222, 'WASH7P'],
                ['1', 17223, 'WASH7P'],
                ['1', 17289, 'WASH7P'],
                ['1', 17353, 'WASH7P'],
                ['1', 17358, 'WASH7P'],
                ['1', 17365, 'WASH7P'],
                ['1', 17373, 'WASH7P'],
                ['1', 17375, 'WASH7P'],
                ['1', 17378, 'WASH7P'],
                ['1', 17379, 'WASH7P'],
                ['1', 17385, 'WASH7P'],
                ['1', 17398, 'WASH7P'],
                ['1', 17403, 'WASH7P'],
                ['1', 17406, 'WASH7P'],
                ['1', 17407, 'WASH7P'],
                ['1', 17408, 'WASH7P'],
                ['1', 17452, 'WASH7P'],
                ['1', 17453, 'WASH7P'],
                ['1', 17478, 'WASH7P'],
                ['1', 17479, 'WASH7P'],
                ['1', 17483, 'WASH7P'],
                ['1', 17484, 'WASH7P'],
                ['1', 17492, 'WASH7P'],
                ['1', 17493, 'WASH7P'],
                ['1', 17496, 'WASH7P'],
                ['1', 17501, 'WASH7P'],
                ['1', 17511, 'WASH7P'],
                ['1', 17512, 'WASH7P'],
                ['1', 17517, 'WASH7P'],
                ['1', 17519, 'WASH7P'],
                ['1', 17538, 'WASH7P'],
                ['1', 17556, 'WASH7P'],
                ['1', 17559, 'WASH7P'],
                ['1', 17563, 'WASH7P'],
                ['1', 17569, 'WASH7P'],
                ['1', 17585, 'WASH7P'],
                ['1', 17589, 'WASH7P'],
                ['1', 17594, 'WASH7P'],
                ['1', 17596, 'WASH7P'],
                ['1', 17606, 'WASH7P'],
                ['1', 17614, 'WASH7P'],
                ['1', 17626, 'WASH7P'],
                ['1', 17647, 'WASH7P'],
                ['1', 17672, 'WASH7P'],
                ['1', 17688, 'WASH7P'],
                ['1', 17689, 'WASH7P'],
                ['1', 17695, 'WASH7P'],
                ['1', 17697, 'WASH7P'],
                ['1', 17701, 'WASH7P'],
                ['1', 17709, 'WASH7P'],
                ['1', 17716, 'WASH7P'],
                ['1', 17721, 'WASH7P'],
                ['1', 17722, 'WASH7P'],
                ['1', 17728, 'WASH7P'],
                ['1', 17746, 'WASH7P'],
                ['1', 17747, 'WASH7P'],
                ['1', 17748, 'WASH7P'],
                ['1', 17750, 'WASH7P'],
                ['1', 17753, 'WASH7P'],
                ['1', 17765, 'WASH7P'],
                ['1', 17765, 'WASH7P'],
                ['1', 17767, 'WASH7P'],
                ['1', 17781, 'WASH7P'],
                ['1', 17793, 'WASH7P'],
                ['1', 17805, 'WASH7P'],
                ['1', 17829, 'WASH7P'],
                ['1', 17842, 'WASH7P'],
                ['1', 17843, 'WASH7P'],
                ['1', 17843, 'WASH7P'],
                ['1', 17844, 'WASH7P'],
                ['1', 17853, 'WASH7P'],
                ['1', 17854, 'WASH7P'],
                ['1', 17901, 'WASH7P'],
                ['1', 17904, 'WASH7P'],
                ['1', 17928, 'WASH7P'],
                ['1', 17929, 'WASH7P'],
                ['1', 19190, 'WASH7P'],
                ['1', 19190, 'WASH7P'],
                ['1', 19254, 'WASH7P'],
                ['1', 19535, 'WASH7P'],
                ['1', 20166, 'WASH7P'],
                ['1', 20184, 'WASH7P'],
                ['1', 20191, 'WASH7P'],
                ['1', 20210, 'WASH7P'],
                ['1', 20212, 'WASH7P'],
                ['1', 20217, 'WASH7P'],
                ['1', 20225, 'WASH7P'],
                ['1', 20227, 'WASH7P'],
                ['1', 20227, 'WASH7P'],
                ['1', 20231, 'WASH7P'],
                ['1', 20231, 'WASH7P'],
                ['1', 20235, 'WASH7P'],
                ['1', 20237, 'WASH7P'],
                ['1', 20250, 'WASH7P'],
                ['1', 20251, 'WASH7P'],
                ['1', 20253, 'WASH7P'],
                ['1', 20254, 'WASH7P'],
                ['1', 20273, 'WASH7P'],
                ['1', 20280, 'WASH7P'],
                ['1', 20297, 'WASH7P'],
                ['1', 20316, 'WASH7P'],
                ['1', 20443, 'WASH7P'],
                ['1', 20485, 'WASH7P'],
                ['1', 20496, 'WASH7P'],
                ['1', 20522, 'WASH7P'],
                ['1', 20545, 'WASH7P'],
                ['1', 20547, 'WASH7P'],
                ['1', 20552, 'WASH7P'],
                ['1', 20554, 'WASH7P'],
                ['1', 28588, 'WASH7P'],
                ['1', 28588, 'WASH7P'],
                ['1', 28588, 'WASH7P'],
                ['1', 29278, 'WASH7P'],
                ['1', 29300, 'WASH7P'],
                ['1', 29359, 'WASH7P'],
                ['1', 29368, 'WASH7P']]]),
             ('dfamvaridx',
              [{'1036': [3,
                 8,
                 18,
                 19,
                 20,
                 40,
                 50,
                 55,
                 69,
                 79,
                 85,
                 89,
                 122,
                 149,
                 150,
                 156,
                 157,
                 159,
                 162,
                 166,
                 168,
                 175,
                 177,
                 179,
                 181,
                 190],
                '22_1': [3,
                 8,
                 10,
                 18,
                 19,
                 40,
                 50,
                 55,
                 69,
                 80,
                 85,
                 86,
                 89,
                 94,
                 107,
                 111,
                 122,
                 127,
                 129,
                 140,
                 152,
                 156,
                 157,
                 159,
                 162,
                 166,
                 168,
                 175,
                 181],
                '28_9': [3,
                 5,
                 8,
                 10,
                 18,
                 19,
                 34,
                 40,
                 50,
                 84,
                 85,
                 90,
                 104,
                 106,
                 115,
                 152,
                 155,
                 157,
                 159,
                 162,
                 163,
                 165,
                 166,
                 168,
                 171,
                 175,
                 180,
                 181,
                 190]}]),
             ('dgeno',
              [{'28_9_103': ['11',
                 '11',
                 '22',
                 '11',
                 '12',
                 '22',
                 '22',
                 '22',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '22',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11'],
                '28_9_106': ['11',
                 '11',
                 '00',
                 '12',
                 '12',
                 '12',
                 '00',
                 '00',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12'],
                '28_9_108': ['12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11'],
                '28_9_109': ['11',
                 '11',
                 '12',
                 '11',
                 '12',
                 '22',
                 '00',
                 '22',
                 '22',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11'],
                '28_9_111': ['12',
                 '12',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12'],
                '28_9_105': ['12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '12',
                 '11'],
                '28_9_114': ['12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '12',
                 '11'],
                '28_9_110': ['12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11'],
                '1036_5': ['11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '12',
                 '12'],
                '1036_99': ['12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11'],
                '1036_6': ['11',
                 '12',
                 '12',
                 '12',
                 '11',
                 '00',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11'],
                '1036_4': ['11',
                 '11',
                 '12',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '11'],
                '1036_3': ['11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11'],
                '22_1_2': ['11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12'],
                '22_1_3': ['11',
                 '22',
                 '11',
                 '11',
                 '11',
                 '22',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11'],
                '22_1_4': ['11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11'],
                '22_1_5': ['12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '11'],
                '22_1_99': ['12',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12'],
                '1036_1': [('1', '0'), ('1', '0')],
                '1036_2': [('3', '0'), ('1', '0')],
                '22_1_10': [('3', '1'), ('0', '0')],
                '22_1_20': [('1', '2'), ('0', '0')]}]),
             ('gss',
              [Empty DataFrame
               Columns: []
               Index: []]),
             ('hapimp',
              {'1036': ['1036',
                array(['V3-14464', 'V8-14653', 'V18-14907', 'V19-14930', 'V20-14933',
                       'V40-16103', 'V50-16378', 'V55-16487', 'V69-17147', 'V79-17358',
                       'V85-17385', 'V89-17407', 'V122-17697', 'V149-17928', 'V150-17929',
                       'V156-20184', 'V157-20191', 'V159-20212', 'V162-20227',
                       'V166-20235', 'V168-20250', 'V175-20316', 'V177-20485',
                       'V179-20522', 'V181-20547', 'V190-29368'], dtype='<U10'),
                [14464,
                 14653,
                 14907,
                 14930,
                 14933,
                 16103,
                 16378,
                 16487,
                 17147,
                 17358,
                 17385,
                 17407,
                 17697,
                 17928,
                 17929,
                 20184,
                 20191,
                 20212,
                 20227,
                 20235,
                 20250,
                 20316,
                 20485,
                 20522,
                 20547,
                 29368],
                array([1.977e-01, 3.922e-01, 3.110e-01, 2.629e-01, 1.030e-02, 2.320e-02,
                       4.985e-01, 6.610e-02, 1.000e-05, 1.700e-03, 1.934e-01, 1.790e-02,
                       1.534e-01, 1.470e-02, 1.450e-02, 2.840e-02, 1.115e-01, 1.383e-01,
                       1.008e-01, 4.680e-02, 2.925e-01, 2.719e-01, 6.900e-03, 6.300e-03,
                       2.689e-01, 8.300e-03]),
                array([['1036', '1036_1', '2:', '1:', '2:', '2:', '1:', '2:', 'A2,1:',
                        '2:', '2:', '1:', '1:', '2:', 'A1,2:', '1:', '1:', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                       ['1036', '1036_1', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:',
                        '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:',
                        '?:', '?:', '?:', '?:', '?:', '?:', '?:'],
                       ['1036', '1036_2', '1:', '1:', '1:', '1:', '1:', '1:', 'A1,2:',
                        '1:', '1:', '1:', '1:', '1:', 'A2,1:', '2:', '2:', '2:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                       ['1036', '1036_2', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:',
                        '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:',
                        '?:', '?:', '?:', '?:', '?:', '?:', '?:'],
                       ['1036', '1036_6', '1:', '1:', '1:', '1:', '1:', '1:', 'A1,2:',
                        '1:', '1:', '1:', '1:', '1:', 'A1,2:', '1:', '1:', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2:', '1:'],
                       ['1036', '1036_6', '1:', '2:', '2:', '2:', '1:', '1:', 'A2,1:',
                        '1:', '2:', '1:', '1:', '2:', 'A2,1:', '2:', '2:', '2:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                       ['1036', '1036_99', '1:', '1|', '1|', '1|', '1:', '1|', 'A1,2|',
                        '1|', '1|', '1:', '1:', '1|', 'A2,1|', '2|', '2|', '2|', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                       ['1036', '1036_99', '2:', '1|', '2|', '2|', '1:', '2|', 'A2,1|',
                        '2|', '2|', '1:', '1:', '2|', 'A1,2|', '1|', '1|', '1|', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                       ['1036', '1036_5', '1:', '1|', '1|', '1|', '1:', '2/', 'A2,1|',
                        '2|', '1/', '1:', '1:', '1|', 'A2,1|', '1/', '1|', '1|', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                       ['1036', '1036_5', '1:', '1|', '1|', '1|', '1:', '1/', 'A1,2|',
                        '1|', '1/', '1:', '1:', '1|', 'A1,2|', '1/', '1|', '1|', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2|', '1:'],
                       ['1036', '1036_4', '1:', '1|', '1\\', '1|', '1:', '1|', 'A1,2|',
                        '1|', '1|', '1:', '1:', '1|', 'A2,1\\', '2|', '2|', '2|', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                       ['1036', '1036_4', '1:', '1|', '2\\', '2|', '1:', '1|', 'A2,1|',
                        '1|', '2|', '1:', '1:', '2|', 'A1,2\\', '1|', '1|', '1|', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2|', '1:'],
                       ['1036', '1036_3', '1:', '1|', '1|', '1|', '1:', '1|', 'A1,2|',
                        '1|', '1|', '1:', '1:', '1\\', 'A2,1|', '2|', '2|', '2|', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                       ['1036', '1036_3', '1:', '2|', '2|', '2|', '1:', '1|', 'A2,1|',
                        '1|', '2|', '1:', '1:', '1\\', 'A1,2|', '1|', '1|', '1|', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2|', '1:']],
                      dtype='<U7')],
               '22_1': ['22_1',
                array(['V3-14464', 'V8-14653', 'V10-14677', 'V18-14907', 'V19-14930',
                       'V40-16103', 'V50-16378', 'V55-16487', 'V69-17147', 'V80-17365',
                       'V85-17385', 'V86-17398', 'V89-17407', 'V94-17479', 'V107-17559',
                       'V111-17589', 'V122-17697', 'V127-17722', 'V129-17746',
                       'V140-17829', 'V152-19190', 'V156-20184', 'V157-20191',
                       'V159-20212', 'V162-20227', 'V166-20235', 'V168-20250',
                       'V175-20316', 'V181-20547'], dtype='<U10'),
                [14464,
                 14653,
                 14677,
                 14907,
                 14930,
                 16103,
                 16378,
                 16487,
                 17147,
                 17365,
                 17385,
                 17398,
                 17407,
                 17479,
                 17559,
                 17589,
                 17697,
                 17722,
                 17746,
                 17829,
                 19190,
                 20184,
                 20191,
                 20212,
                 20227,
                 20235,
                 20250,
                 20316,
                 20547],
                array([1.977e-01, 3.922e-01, 5.000e-02, 3.110e-01, 2.629e-01, 2.320e-02,
                       4.985e-01, 6.610e-02, 1.000e-05, 2.120e-02, 1.934e-01, 5.700e-03,
                       1.790e-02, 1.400e-03, 2.090e-02, 1.600e-03, 1.534e-01, 2.320e-02,
                       6.950e-02, 8.500e-03, 5.000e-04, 2.840e-02, 1.115e-01, 1.383e-01,
                       1.008e-01, 4.680e-02, 2.925e-01, 2.719e-01, 2.689e-01]),
                array([['22_1', '22_1_10', '1:', '1:', '1:', '2:', '1:', '1:', 'A1,2:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2:',
                        '2:', '2:', '2:', '2:', '1:', '1:', '1:', '2:', '1:', '1:', '1:'],
                       ['22_1', '22_1_10', '1:', '2:', '1:', '1:', '1:', '2:', 'A1,2:',
                        '1:', '1:', '2:', '1:', '2:', '1:', '2:', '1:', '1:', '2:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2:', '1:'],
                       ['22_1', '22_1_20', '2:', '2:', '2:', '1:', '1:', '2:', 'A2,1:',
                        '2:', '2:', '1:', '2:', '1:', '2:', '?:', '2:', '2:', '1:', '1:',
                        '2:', '1:', '1:', '1:', '2:', '2:', '2:', '1:', '2:', '1:', '2:'],
                       ['22_1', '22_1_20', '1:', '2:', '1:', '1:', '2:', '1:', 'A2,1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                       ['22_1', '22_1_99', '2:', '2|', '2|', '1/', '2|', '1|', 'A2,1/',
                        '2|', '1/', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|',
                        '1|', '1|', '1|', '1\\', '1|', '1|', '1|', '1|', '2/', '1|',
                        '2|'],
                       ['22_1', '22_1_99', '1:', '1|', '1|', '2/', '1|', '1|', 'A1,2/',
                        '1|', '1/', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '2|',
                        '2|', '2|', '2|', '1\\', '1|', '1|', '1|', '1|', '1/', '2|',
                        '1|'],
                       ['22_1', '22_1_5', '2:', '2|', '2|', '1|', '1|', '1/', 'A2,1|',
                        '1|', '2/', '1|', '2|', '1|', '2|', '1/', '1|', '1|', '1|',
                        '1\\', '1|', '1|', '1\\', '1|', '1|', '1\\', '1|', '1|', '1|',
                        '1|', '1|'],
                       ['22_1', '22_1_5', '1:', '1|', '1|', '2|', '1|', '1/', 'A1,2|',
                        '1|', '1/', '1|', '1|', '1|', '1|', '1/', '1|', '1|', '1|',
                        '1\\', '1|', '1|', '2\\', '2|', '1|', '1\\', '1|', '1|', '1|',
                        '2|', '1|'],
                       ['22_1', '22_1_4', '1:', '2|', '1|', '1|', '2|', '1|', 'A2,1|',
                        '1|', '1|', '1|', '1|', '1|', '1|', '1|', '2/', '2|', '1|',
                        '1\\', '2|', '1|', '1/', '1|', '1|', '1|', '1|', '1|', '1|',
                        '1\\', '1|'],
                       ['22_1', '22_1_4', '1:', '1|', '1|', '2|', '1|', '1|', 'A1,2|',
                        '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1/', '1|', '1|',
                        '1\\', '1|', '1|', '1/', '1|', '1|', '1|', '1|', '1|', '1|',
                        '1\\', '1|'],
                       ['22_1', '22_1_3', '1:', '2|', '1|', '1/', '1|', '2|', 'A2,1/',
                        '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|',
                        '1|', '1|', '1|', '1|', '1|', '1\\', '1|', '1|', '1|', '1|',
                        '1|'],
                       ['22_1', '22_1_3', '1:', '2|', '1|', '1/', '1|', '2|', 'A1,2/',
                        '1|', '1|', '2|', '1|', '2|', '1|', '2|', '1|', '1|', '2|', '1|',
                        '1|', '1|', '1|', '1|', '1|', '1\\', '1|', '2|', '1|', '1|',
                        '1|'],
                       ['22_1', '22_1_2', '1:', '2|', '1|', '1|', '2|', '1|', 'A2,1|',
                        '1|', '1|', '1/', '2|', '1/', '1|', '1|', '1|', '1|', '1\\',
                        '1|', '1|', '1|', '1/', '1|', '2|', '2|', '2|', '1|', '2|',
                        '1\\', '2|'],
                       ['22_1', '22_1_2', '1:', '1|', '1|', '2|', '1|', '1|', 'A1,2|',
                        '1|', '1|', '1/', '1|', '1/', '1|', '1|', '1|', '1|', '2\\',
                        '1|', '1|', '1|', '1/', '1|', '1|', '1|', '1|', '1|', '1|',
                        '1\\', '1|']], dtype='<U7')],
               '28_9': ['28_9',
                array(['V3-14464', 'V5-14470', 'V8-14653', 'V10-14677', 'V18-14907',
                       'V19-14930', 'V34-16068', 'V40-16103', 'V50-16378', 'V84-17379',
                       'V85-17385', 'V90-17408', 'V104-17519', 'V106-17556', 'V115-17614',
                       'V152-19190', 'V155-20166', 'V157-20191', 'V159-20212',
                       'V162-20227', 'V163-20227', 'V165-20231', 'V166-20235',
                       'V168-20250', 'V171-20254', 'V175-20316', 'V180-20545',
                       'V181-20547', 'V190-29368'], dtype='<U10'),
                [14464,
                 14470,
                 14653,
                 14677,
                 14907,
                 14930,
                 16068,
                 16103,
                 16378,
                 17379,
                 17385,
                 17408,
                 17519,
                 17556,
                 17614,
                 19190,
                 20166,
                 20191,
                 20212,
                 20227,
                 20227,
                 20231,
                 20235,
                 20250,
                 20254,
                 20316,
                 20545,
                 20547,
                 29368],
                array([1.977e-01, 4.000e-03, 3.922e-01, 5.000e-02, 3.110e-01, 2.629e-01,
                       2.200e-03, 2.320e-02, 4.985e-01, 5.800e-03, 1.934e-01, 1.070e-02,
                       3.000e-03, 1.180e-02, 4.790e-02, 5.000e-04, 8.310e-02, 1.115e-01,
                       1.383e-01, 1.008e-01, 4.840e-02, 9.437e-05, 4.680e-02, 2.925e-01,
                       2.290e-02, 2.719e-01, 8.000e-04, 2.689e-01, 8.300e-03]),
                array([['28_9', '28_9_100', '1:', '1:', '2:', '1:', 'A1,2:', '2:', '2:',
                        '2:', '2:', '1:', 'A1,2:', '1:', '1:', '1:', '1:', '2:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:',
                        '1:'],
                       ['28_9', '28_9_100', '2:', '1:', '1:', '1:', 'A1,2:', '1:', '1:',
                        'A1,2:', 'A1,2:', '1:', 'A1,2:', '1:', '1:', '1:', '1:', '1:',
                        '2:', '2:', '2:', '1:', '2:', '2:', '1:', '2:', '1:', '2:', '1:',
                        '1:', '2:'],
                       ['28_9', '28_9_101', '1:', '1:', '2:', '1:', 'A2,1:', '2:', '1:',
                        'A2,1:', 'A2,1:', '1:', 'A2,1:', '1:', '1:', '1:', '1:', '2:',
                        '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:',
                        '2:', '1:'],
                       ['28_9', '28_9_101', '1:', '1:', '?:', '2:', 'A2,1:', '1:', '2:',
                        '2:', '1:', '1:', 'A2,1:', '2:', '1:', '2:', '1:', '1:', '2:',
                        '2:', '2:', '2:', '1:', '2:', '1:', '2:', '1:', '2:', '2:', '2:',
                        '1:'],
                       ['28_9', '28_9_186', '2:', '2:', '1:', '2:', 'A2,1:', '1:', '?:',
                        '1:', '1:', '1:', 'A2,1:', '1:', '1:', '1:', '2:', '?:', '2:',
                        '2:', '2:', '2:', '2:', '1:', '1:', '2:', '2:', '2:', '1:', '2:',
                        '1:'],
                       ['28_9', '28_9_186', '1:', '1:', '1:', '1:', 'A2,1:', '2:', '?:',
                        '2:', '2:', '2:', 'A2,1:', '1:', '2:', '1:', '1:', '1:', '1:',
                        '1:', '1:', '1:', '1:', '1:', '2:', '1:', '1:', '1:', '1:', '1:',
                        '2:'],
                       ['28_9', '28_9_114', '2:', '1|', '1|', '1|', 'A1,2|', '1|', '1|',
                        'A1,2|', 'A1,2|', '1|', 'A1,2|', '1|', '1\\', '1|', '1|', '1|',
                        '1/', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|',
                        '1|', '1|'],
                       ['28_9', '28_9_114', '1:', '1|', '2|', '1|', 'A2,1|', '2|', '1|',
                        'A2,1|', 'A2,1|', '1|', 'A2,1|', '1|', '1\\', '2|', '1|', '1|',
                        '2/', '2|', '2|', '2|', '1|', '2|', '1|', '2|', '1|', '2|', '2|',
                        '2|', '1|'],
                       ['28_9', '28_9_105', '2:', '1|', '1|', '1|', 'A1,2|', '1|', '1|',
                        'A1,2|', 'A1,2|', '1|', 'A1,2|', '1|', '1|', '1|', '1|', '1|',
                        '2|', '2|', '2|', '1|', '2|', '2|', '1|', '2|', '1|', '2|',
                        '1\\', '1|', '1/'],
                       ['28_9', '28_9_105', '1:', '1|', '2|', '1|', 'A2,1|', '2|', '1|',
                        'A2,1|', 'A2,1|', '1|', 'A2,1|', '1|', '1|', '1|', '1|', '2|',
                        '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|',
                        '2\\', '2|', '1/'],
                       ['28_9', '28_9_103', '1:', '1|', '2|', '1|', 'A1,2|', '2|', '2\\',
                        '2|', '2|', '1\\', 'A1,2|', '1|', '1|', '1|', '1|', '2|', '1|',
                        '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|',
                        '1|'],
                       ['28_9', '28_9_103', '1:', '1|', '2|', '1|', 'A2,1|', '2|', '2\\',
                        '2|', '1|', '1\\', 'A2,1|', '1|', '1|', '1|', '1|', '2|', '1|',
                        '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '2|',
                        '1|'],
                       ['28_9', '28_9_111', '1:', '1|', '2|', '1|', 'A1,2|', '2|', '2|',
                        '2|', '2|', '1|', 'A1,2|', '1|', '1|', '1|', '1|', '2\\', '1|',
                        '1|', '1|', '1|', '1|', '1|', '1\\', '1|', '1\\', '1\\', '1|',
                        '1|', '1\\'],
                       ['28_9', '28_9_111', '2:', '2|', '1|', '2|', 'A2,1|', '1|', '?|',
                        '1|', '1|', '1|', 'A2,1|', '1|', '1|', '1|', '2|', '1\\', '1|',
                        '1|', '1|', '1|', '1|', '1|', '1\\', '2|', '1\\', '2\\', '1|',
                        '2|', '2\\'],
                       ['28_9', '28_9_110', '1:', '1\\', '2|', '1|', 'A1,2\\', '2|',
                        '2|', '2|', '2|', '1|', 'A1,2|', '1|', '1|', '1|', '1\\', '2|',
                        '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1\\', '1|', '1|',
                        '1|', '1|', '1|'],
                       ['28_9', '28_9_110', '2:', '1\\', '1|', '1|', 'A2,1\\', '1|',
                        '?|', '1|', '1|', '1|', 'A2,1|', '1|', '1|', '1|', '1\\', '1|',
                        '1|', '1|', '1|', '1|', '1|', '1|', '2|', '2\\', '2|', '2|',
                        '1|', '2|', '1|'],
                       ['28_9', '28_9_108', '1:', '1\\', '2|', '1|', 'A1,2\\', '2|',
                        '2|', '2|', '2|', '1|', 'A1,2|', '1|', '1\\', '1|', '1|', '2|',
                        '1|', '1|', '1|', '1|', '1\\', '1|', '1\\', '1|', '1|', '1|',
                        '1|', '1|', '1\\'],
                       ['28_9', '28_9_108', '2:', '1\\', '1|', '1|', 'A2,1\\', '1|',
                        '?|', '1|', '1|', '1|', 'A2,1|', '1|', '2\\', '1|', '1|', '1|',
                        '1|', '1|', '1|', '1|', '2\\', '1|', '2\\', '1|', '1|', '1|',
                        '1|', '1|', '1\\'],
                       ['28_9', '28_9_109', '1:', '1|', '2|', '1|', 'A1,2|', '2|', '2|',
                        '2|', '2|', '1|', 'A1,2|', '1|', '1|', '1|', '1|', '2\\', '1|',
                        '1|', '1|', '1|', '1\\', '1|', '1|', '1\\', '1|', '1|', '1|',
                        '1|', '1|'],
                       ['28_9', '28_9_109', '1:', '1|', '1|', '1|', 'A2,1|', '2|', '?|',
                        '2|', '2|', '2|', 'A2,1|', '1|', '2|', '1|', '1|', '?\\', '2|',
                        '2|', '2|', '2|', '1\\', '1|', '2|', '2\\', '2|', '2|', '1|',
                        '2|', '1|'],
                       ['28_9', '28_9_106', '1:', '1|', '2|', '1|', 'A1,2|', '2|', '2|',
                        '2|', '2|', '1|', 'A1,2|', '1|', '1|', '1|', '1|', '1/', '2\\',
                        '2|', '2|', '1|', '2|', '2|', '1|', '2|', '1|', '2|', '1|', '1|',
                        '2|'],
                       ['28_9', '28_9_106', '1:', '1|', '?|', '2|', 'A2,1|', '1|', '2|',
                        '2|', '1|', '1|', 'A2,1|', '2|', '1|', '2|', '1|', '1/', '1\\',
                        '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '2|',
                        '1|']], dtype='<U8')]}),
             ('ld', []),
             ('coder',
              {'input': [{'28_9_103': ['11',
                  '11',
                  '22',
                  '11',
                  '12',
                  '22',
                  '22',
                  '22',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '22',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11'],
                 '28_9_106': ['11',
                  '11',
                  '00',
                  '12',
                  '12',
                  '12',
                  '00',
                  '00',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12'],
                 '28_9_108': ['12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11'],
                 '28_9_109': ['11',
                  '11',
                  '12',
                  '11',
                  '12',
                  '22',
                  '00',
                  '22',
                  '22',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11'],
                 '28_9_111': ['12',
                  '12',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12'],
                 '28_9_105': ['12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '12',
                  '11'],
                 '28_9_114': ['12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '12',
                  '11'],
                 '28_9_110': ['12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11'],
                 '1036_5': ['11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '12',
                  '12'],
                 '1036_99': ['12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11'],
                 '1036_6': ['11',
                  '12',
                  '12',
                  '12',
                  '11',
                  '00',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11'],
                 '1036_4': ['11',
                  '11',
                  '12',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '11'],
                 '1036_3': ['11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11'],
                 '22_1_2': ['11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12'],
                 '22_1_3': ['11',
                  '22',
                  '11',
                  '11',
                  '11',
                  '22',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11'],
                 '22_1_4': ['11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11'],
                 '22_1_5': ['12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '11'],
                 '22_1_99': ['12',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12'],
                 '1036_1': [('1', '0'), ('1', '0')],
                 '1036_2': [('3', '0'), ('1', '0')],
                 '22_1_10': [('3', '1'), ('0', '0')],
                 '22_1_20': [('1', '2'), ('0', '0')]},
                OrderedDict([('1036',
                              array([['1036', '1036_1', '2:', '1:', '2:', '2:', '1:', '2:', 'A2,1:',
                                      '2:', '2:', '1:', '1:', '2:', 'A1,2:', '1:', '1:', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                                     ['1036', '1036_1', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:',
                                      '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:',
                                      '?:', '?:', '?:', '?:', '?:', '?:', '?:'],
                                     ['1036', '1036_2', '1:', '1:', '1:', '1:', '1:', '1:', 'A1,2:',
                                      '1:', '1:', '1:', '1:', '1:', 'A2,1:', '2:', '2:', '2:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                                     ['1036', '1036_2', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:',
                                      '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:', '?:',
                                      '?:', '?:', '?:', '?:', '?:', '?:', '?:'],
                                     ['1036', '1036_6', '1:', '1:', '1:', '1:', '1:', '1:', 'A1,2:',
                                      '1:', '1:', '1:', '1:', '1:', 'A1,2:', '1:', '1:', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2:', '1:'],
                                     ['1036', '1036_6', '1:', '2:', '2:', '2:', '1:', '1:', 'A2,1:',
                                      '1:', '2:', '1:', '1:', '2:', 'A2,1:', '2:', '2:', '2:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                                     ['1036', '1036_99', '1:', '1|', '1|', '1|', '1:', '1|', 'A1,2|',
                                      '1|', '1|', '1:', '1:', '1|', 'A2,1|', '2|', '2|', '2|', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                                     ['1036', '1036_99', '2:', '1|', '2|', '2|', '1:', '2|', 'A2,1|',
                                      '2|', '2|', '1:', '1:', '2|', 'A1,2|', '1|', '1|', '1|', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                                     ['1036', '1036_5', '1:', '1|', '1|', '1|', '1:', '2/', 'A2,1|',
                                      '2|', '1/', '1:', '1:', '1|', 'A2,1|', '1/', '1|', '1|', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                                     ['1036', '1036_5', '1:', '1|', '1|', '1|', '1:', '1/', 'A1,2|',
                                      '1|', '1/', '1:', '1:', '1|', 'A1,2|', '1/', '1|', '1|', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2|', '1:'],
                                     ['1036', '1036_4', '1:', '1|', '1\\', '1|', '1:', '1|', 'A1,2|',
                                      '1|', '1|', '1:', '1:', '1|', 'A2,1\\', '2|', '2|', '2|', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                                     ['1036', '1036_4', '1:', '1|', '2\\', '2|', '1:', '1|', 'A2,1|',
                                      '1|', '2|', '1:', '1:', '2|', 'A1,2\\', '1|', '1|', '1|', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2|', '1:'],
                                     ['1036', '1036_3', '1:', '1|', '1|', '1|', '1:', '1|', 'A1,2|',
                                      '1|', '1|', '1:', '1:', '1\\', 'A2,1|', '2|', '2|', '2|', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1|', '1:'],
                                     ['1036', '1036_3', '1:', '2|', '2|', '2|', '1:', '1|', 'A2,1|',
                                      '1|', '2|', '1:', '1:', '1\\', 'A1,2|', '1|', '1|', '1|', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2|', '1:']],
                                    dtype='<U7')),
                             ('22_1',
                              array([['22_1', '22_1_10', '1:', '1:', '1:', '2:', '1:', '1:', 'A1,2:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2:',
                                      '2:', '2:', '2:', '2:', '1:', '1:', '1:', '2:', '1:', '1:', '1:'],
                                     ['22_1', '22_1_10', '1:', '2:', '1:', '1:', '1:', '2:', 'A1,2:',
                                      '1:', '1:', '2:', '1:', '2:', '1:', '2:', '1:', '1:', '2:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '2:', '1:'],
                                     ['22_1', '22_1_20', '2:', '2:', '2:', '1:', '1:', '2:', 'A2,1:',
                                      '2:', '2:', '1:', '2:', '1:', '2:', '?:', '2:', '2:', '1:', '1:',
                                      '2:', '1:', '1:', '1:', '2:', '2:', '2:', '1:', '2:', '1:', '2:'],
                                     ['22_1', '22_1_20', '1:', '2:', '1:', '1:', '2:', '1:', 'A2,1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
                                     ['22_1', '22_1_99', '2:', '2|', '2|', '1/', '2|', '1|', 'A2,1/',
                                      '2|', '1/', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|',
                                      '1|', '1|', '1|', '1\\', '1|', '1|', '1|', '1|', '2/', '1|',
                                      '2|'],
                                     ['22_1', '22_1_99', '1:', '1|', '1|', '2/', '1|', '1|', 'A1,2/',
                                      '1|', '1/', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '2|',
                                      '2|', '2|', '2|', '1\\', '1|', '1|', '1|', '1|', '1/', '2|',
                                      '1|'],
                                     ['22_1', '22_1_5', '2:', '2|', '2|', '1|', '1|', '1/', 'A2,1|',
                                      '1|', '2/', '1|', '2|', '1|', '2|', '1/', '1|', '1|', '1|',
                                      '1\\', '1|', '1|', '1\\', '1|', '1|', '1\\', '1|', '1|', '1|',
                                      '1|', '1|'],
                                     ['22_1', '22_1_5', '1:', '1|', '1|', '2|', '1|', '1/', 'A1,2|',
                                      '1|', '1/', '1|', '1|', '1|', '1|', '1/', '1|', '1|', '1|',
                                      '1\\', '1|', '1|', '2\\', '2|', '1|', '1\\', '1|', '1|', '1|',
                                      '2|', '1|'],
                                     ['22_1', '22_1_4', '1:', '2|', '1|', '1|', '2|', '1|', 'A2,1|',
                                      '1|', '1|', '1|', '1|', '1|', '1|', '1|', '2/', '2|', '1|',
                                      '1\\', '2|', '1|', '1/', '1|', '1|', '1|', '1|', '1|', '1|',
                                      '1\\', '1|'],
                                     ['22_1', '22_1_4', '1:', '1|', '1|', '2|', '1|', '1|', 'A1,2|',
                                      '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1/', '1|', '1|',
                                      '1\\', '1|', '1|', '1/', '1|', '1|', '1|', '1|', '1|', '1|',
                                      '1\\', '1|'],
                                     ['22_1', '22_1_3', '1:', '2|', '1|', '1/', '1|', '2|', 'A2,1/',
                                      '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|',
                                      '1|', '1|', '1|', '1|', '1|', '1\\', '1|', '1|', '1|', '1|',
                                      '1|'],
                                     ['22_1', '22_1_3', '1:', '2|', '1|', '1/', '1|', '2|', 'A1,2/',
                                      '1|', '1|', '2|', '1|', '2|', '1|', '2|', '1|', '1|', '2|', '1|',
                                      '1|', '1|', '1|', '1|', '1|', '1\\', '1|', '2|', '1|', '1|',
                                      '1|'],
                                     ['22_1', '22_1_2', '1:', '2|', '1|', '1|', '2|', '1|', 'A2,1|',
                                      '1|', '1|', '1/', '2|', '1/', '1|', '1|', '1|', '1|', '1\\',
                                      '1|', '1|', '1|', '1/', '1|', '2|', '2|', '2|', '1|', '2|',
                                      '1\\', '2|'],
                                     ['22_1', '22_1_2', '1:', '1|', '1|', '2|', '1|', '1|', 'A1,2|',
                                      '1|', '1|', '1/', '1|', '1/', '1|', '1|', '1|', '1|', '2\\',
                                      '1|', '1|', '1|', '1/', '1|', '1|', '1|', '1|', '1|', '1|',
                                      '1\\', '1|']], dtype='<U7')),
                             ('28_9',
                              array([['28_9', '28_9_100', '1:', '1:', '2:', '1:', 'A1,2:', '2:', '2:',
                                      '2:', '2:', '1:', 'A1,2:', '1:', '1:', '1:', '1:', '2:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:',
                                      '1:'],
                                     ['28_9', '28_9_100', '2:', '1:', '1:', '1:', 'A1,2:', '1:', '1:',
                                      'A1,2:', 'A1,2:', '1:', 'A1,2:', '1:', '1:', '1:', '1:', '1:',
                                      '2:', '2:', '2:', '1:', '2:', '2:', '1:', '2:', '1:', '2:', '1:',
                                      '1:', '2:'],
                                     ['28_9', '28_9_101', '1:', '1:', '2:', '1:', 'A2,1:', '2:', '1:',
                                      'A2,1:', 'A2,1:', '1:', 'A2,1:', '1:', '1:', '1:', '1:', '2:',
                                      '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:', '1:',
                                      '2:', '1:'],
                                     ['28_9', '28_9_101', '1:', '1:', '?:', '2:', 'A2,1:', '1:', '2:',
                                      '2:', '1:', '1:', 'A2,1:', '2:', '1:', '2:', '1:', '1:', '2:',
                                      '2:', '2:', '2:', '1:', '2:', '1:', '2:', '1:', '2:', '2:', '2:',
                                      '1:'],
                                     ['28_9', '28_9_186', '2:', '2:', '1:', '2:', 'A2,1:', '1:', '?:',
                                      '1:', '1:', '1:', 'A2,1:', '1:', '1:', '1:', '2:', '?:', '2:',
                                      '2:', '2:', '2:', '2:', '1:', '1:', '2:', '2:', '2:', '1:', '2:',
                                      '1:'],
                                     ['28_9', '28_9_186', '1:', '1:', '1:', '1:', 'A2,1:', '2:', '?:',
                                      '2:', '2:', '2:', 'A2,1:', '1:', '2:', '1:', '1:', '1:', '1:',
                                      '1:', '1:', '1:', '1:', '1:', '2:', '1:', '1:', '1:', '1:', '1:',
                                      '2:'],
                                     ['28_9', '28_9_114', '2:', '1|', '1|', '1|', 'A1,2|', '1|', '1|',
                                      'A1,2|', 'A1,2|', '1|', 'A1,2|', '1|', '1\\', '1|', '1|', '1|',
                                      '1/', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|',
                                      '1|', '1|'],
                                     ['28_9', '28_9_114', '1:', '1|', '2|', '1|', 'A2,1|', '2|', '1|',
                                      'A2,1|', 'A2,1|', '1|', 'A2,1|', '1|', '1\\', '2|', '1|', '1|',
                                      '2/', '2|', '2|', '2|', '1|', '2|', '1|', '2|', '1|', '2|', '2|',
                                      '2|', '1|'],
                                     ['28_9', '28_9_105', '2:', '1|', '1|', '1|', 'A1,2|', '1|', '1|',
                                      'A1,2|', 'A1,2|', '1|', 'A1,2|', '1|', '1|', '1|', '1|', '1|',
                                      '2|', '2|', '2|', '1|', '2|', '2|', '1|', '2|', '1|', '2|',
                                      '1\\', '1|', '1/'],
                                     ['28_9', '28_9_105', '1:', '1|', '2|', '1|', 'A2,1|', '2|', '1|',
                                      'A2,1|', 'A2,1|', '1|', 'A2,1|', '1|', '1|', '1|', '1|', '2|',
                                      '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|',
                                      '2\\', '2|', '1/'],
                                     ['28_9', '28_9_103', '1:', '1|', '2|', '1|', 'A1,2|', '2|', '2\\',
                                      '2|', '2|', '1\\', 'A1,2|', '1|', '1|', '1|', '1|', '2|', '1|',
                                      '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|',
                                      '1|'],
                                     ['28_9', '28_9_103', '1:', '1|', '2|', '1|', 'A2,1|', '2|', '2\\',
                                      '2|', '1|', '1\\', 'A2,1|', '1|', '1|', '1|', '1|', '2|', '1|',
                                      '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '2|',
                                      '1|'],
                                     ['28_9', '28_9_111', '1:', '1|', '2|', '1|', 'A1,2|', '2|', '2|',
                                      '2|', '2|', '1|', 'A1,2|', '1|', '1|', '1|', '1|', '2\\', '1|',
                                      '1|', '1|', '1|', '1|', '1|', '1\\', '1|', '1\\', '1\\', '1|',
                                      '1|', '1\\'],
                                     ['28_9', '28_9_111', '2:', '2|', '1|', '2|', 'A2,1|', '1|', '?|',
                                      '1|', '1|', '1|', 'A2,1|', '1|', '1|', '1|', '2|', '1\\', '1|',
                                      '1|', '1|', '1|', '1|', '1|', '1\\', '2|', '1\\', '2\\', '1|',
                                      '2|', '2\\'],
                                     ['28_9', '28_9_110', '1:', '1\\', '2|', '1|', 'A1,2\\', '2|',
                                      '2|', '2|', '2|', '1|', 'A1,2|', '1|', '1|', '1|', '1\\', '2|',
                                      '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1\\', '1|', '1|',
                                      '1|', '1|', '1|'],
                                     ['28_9', '28_9_110', '2:', '1\\', '1|', '1|', 'A2,1\\', '1|',
                                      '?|', '1|', '1|', '1|', 'A2,1|', '1|', '1|', '1|', '1\\', '1|',
                                      '1|', '1|', '1|', '1|', '1|', '1|', '2|', '2\\', '2|', '2|',
                                      '1|', '2|', '1|'],
                                     ['28_9', '28_9_108', '1:', '1\\', '2|', '1|', 'A1,2\\', '2|',
                                      '2|', '2|', '2|', '1|', 'A1,2|', '1|', '1\\', '1|', '1|', '2|',
                                      '1|', '1|', '1|', '1|', '1\\', '1|', '1\\', '1|', '1|', '1|',
                                      '1|', '1|', '1\\'],
                                     ['28_9', '28_9_108', '2:', '1\\', '1|', '1|', 'A2,1\\', '1|',
                                      '?|', '1|', '1|', '1|', 'A2,1|', '1|', '2\\', '1|', '1|', '1|',
                                      '1|', '1|', '1|', '1|', '2\\', '1|', '2\\', '1|', '1|', '1|',
                                      '1|', '1|', '1\\'],
                                     ['28_9', '28_9_109', '1:', '1|', '2|', '1|', 'A1,2|', '2|', '2|',
                                      '2|', '2|', '1|', 'A1,2|', '1|', '1|', '1|', '1|', '2\\', '1|',
                                      '1|', '1|', '1|', '1\\', '1|', '1|', '1\\', '1|', '1|', '1|',
                                      '1|', '1|'],
                                     ['28_9', '28_9_109', '1:', '1|', '1|', '1|', 'A2,1|', '2|', '?|',
                                      '2|', '2|', '2|', 'A2,1|', '1|', '2|', '1|', '1|', '?\\', '2|',
                                      '2|', '2|', '2|', '1\\', '1|', '2|', '2\\', '2|', '2|', '1|',
                                      '2|', '1|'],
                                     ['28_9', '28_9_106', '1:', '1|', '2|', '1|', 'A1,2|', '2|', '2|',
                                      '2|', '2|', '1|', 'A1,2|', '1|', '1|', '1|', '1|', '1/', '2\\',
                                      '2|', '2|', '1|', '2|', '2|', '1|', '2|', '1|', '2|', '1|', '1|',
                                      '2|'],
                                     ['28_9', '28_9_106', '1:', '1|', '?|', '2|', 'A2,1|', '1|', '2|',
                                      '2|', '1|', '1|', 'A2,1|', '2|', '1|', '2|', '1|', '1/', '1\\',
                                      '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '1|', '2|',
                                      '1|']], dtype='<U8'))]),
                OrderedDict([('1036',
                              array([1.977e-01, 3.922e-01, 3.110e-01, 2.629e-01, 1.030e-02, 2.320e-02,
                                     4.985e-01, 6.610e-02, 1.000e-05, 1.700e-03, 1.934e-01, 1.790e-02,
                                     1.534e-01, 1.470e-02, 1.450e-02, 2.840e-02, 1.115e-01, 1.383e-01,
                                     1.008e-01, 4.680e-02, 2.925e-01, 2.719e-01, 6.900e-03, 6.300e-03,
                                     2.689e-01, 8.300e-03])),
                             ('22_1',
                              array([1.977e-01, 3.922e-01, 5.000e-02, 3.110e-01, 2.629e-01, 2.320e-02,
                                     4.985e-01, 6.610e-02, 1.000e-05, 2.120e-02, 1.934e-01, 5.700e-03,
                                     1.790e-02, 1.400e-03, 2.090e-02, 1.600e-03, 1.534e-01, 2.320e-02,
                                     6.950e-02, 8.500e-03, 5.000e-04, 2.840e-02, 1.115e-01, 1.383e-01,
                                     1.008e-01, 4.680e-02, 2.925e-01, 2.719e-01, 2.689e-01])),
                             ('28_9',
                              array([1.977e-01, 4.000e-03, 3.922e-01, 5.000e-02, 3.110e-01, 2.629e-01,
                                     2.200e-03, 2.320e-02, 4.985e-01, 5.800e-03, 1.934e-01, 1.070e-02,
                                     3.000e-03, 1.180e-02, 4.790e-02, 5.000e-04, 8.310e-02, 1.115e-01,
                                     1.383e-01, 1.008e-01, 4.840e-02, 9.437e-05, 4.680e-02, 2.925e-01,
                                     2.290e-02, 2.719e-01, 8.000e-04, 2.689e-01, 8.300e-03]))]),
                OrderedDict([('1036',
                              array(['V3-14464', 'V8-14653', 'V18-14907', 'V19-14930', 'V20-14933',
                                     'V40-16103', 'V50-16378', 'V55-16487', 'V69-17147', 'V79-17358',
                                     'V85-17385', 'V89-17407', 'V122-17697', 'V149-17928', 'V150-17929',
                                     'V156-20184', 'V157-20191', 'V159-20212', 'V162-20227',
                                     'V166-20235', 'V168-20250', 'V175-20316', 'V177-20485',
                                     'V179-20522', 'V181-20547', 'V190-29368'], dtype='<U10')),
                             ('22_1',
                              array(['V3-14464', 'V8-14653', 'V10-14677', 'V18-14907', 'V19-14930',
                                     'V40-16103', 'V50-16378', 'V55-16487', 'V69-17147', 'V80-17365',
                                     'V85-17385', 'V86-17398', 'V89-17407', 'V94-17479', 'V107-17559',
                                     'V111-17589', 'V122-17697', 'V127-17722', 'V129-17746',
                                     'V140-17829', 'V152-19190', 'V156-20184', 'V157-20191',
                                     'V159-20212', 'V162-20227', 'V166-20235', 'V168-20250',
                                     'V175-20316', 'V181-20547'], dtype='<U10')),
                             ('28_9',
                              array(['V3-14464', 'V5-14470', 'V8-14653', 'V10-14677', 'V18-14907',
                                     'V19-14930', 'V34-16068', 'V40-16103', 'V50-16378', 'V84-17379',
                                     'V85-17385', 'V90-17408', 'V104-17519', 'V106-17556', 'V115-17614',
                                     'V152-19190', 'V155-20166', 'V157-20191', 'V159-20212',
                                     'V162-20227', 'V163-20227', 'V165-20231', 'V166-20235',
                                     'V168-20250', 'V171-20254', 'V175-20316', 'V180-20545',
                                     'V181-20547', 'V190-29368'], dtype='<U10'))]),
                None],
               'output': [(('1036',
                  '1036_1',
                  '2,2,3,2,2,1,1',
                  '21,221,222,211,2,1,1111111111111',
                  '0,0,0,0,0,0,0',
                  'NULL,NULL,NULL,NULL,NULL,NULL,NULL'),
                 ('1036',
                  '1036_2',
                  '1,1,1,1,1,2,3',
                  '11,111,111,111,1,2,2221111111111',
                  '0,0,0,0,0,0,0',
                  'NULL,NULL,NULL,NULL,NULL,NULL,NULL'),
                 ('1036',
                  '1036_6',
                  '1,1,1,1,1,1,2',
                  '11,111,111,111,1,1,1111111111121',
                  '3,2,2,2,2,2,3',
                  '12,221,121,211,2,2,2221111111111'),
                 ('1036',
                  '1036_99',
                  '1,1,1,1,1,2,3',
                  '11,111,111,111,1,2,2221111111111',
                  '2,2,3,2,2,1,1',
                  '21,221,222,211,2,1,1111111111111'),
                 ('1036',
                  '1036_5',
                  '1,1,3,1,1,2,1',
                  '11,111,222,111,1,2,1111111111111',
                  '1,1,1,1,1,1,2',
                  '11,111,111,111,1,1,1111111111121'),
                 ('1036',
                  '1036_4',
                  '1,1,1,1,1,2,3',
                  '11,111,111,111,1,2,2221111111111',
                  '1,2,2,2,2,1,2',
                  '11,221,121,211,2,1,1111111111121'),
                 ('1036',
                  '1036_3',
                  '1,1,1,1,1,2,3',
                  '11,111,111,111,1,2,2221111111111',
                  '3,2,2,2,1,1,2',
                  '12,221,121,211,1,1,1111111111121'),
                 ('22_1',
                  '22_1_10',
                  '1,2,1,1,1,1,1,1,1,1,3,2,2,2,1,1',
                  '111,21,1,11,1,11,11,1,11,1,222,2,21,112,1,11',
                  '2,1,2,1,1,2,2,2,1,2,1,1,1,1,1,2',
                  '121,11,2,11,1,21,21,2,11,2,111,1,11,111,1,21'),
                 ('22_1',
                  '22_1_20',
                  '3,1,2,3,2,3,3,0,2,1,2,1,3,3,2,3',
                  '222,11,2,22,2,12,12,NULL,22,1,121,1,12,221,2,12',
                  '2,3,1,2,1,1,1,1,1,1,1,1,1,1,1,1',
                  '121,12,1,21,1,11,11,1,11,1,111,1,11,111,1,11'),
                 ('22_1',
                  '22_1_99',
                  '3,3,1,3,1,1,1,1,1,1,1,1,1,1,2,3',
                  '222,12,1,22,1,11,11,1,11,1,111,1,11,111,2,12',
                  '1,2,1,1,1,1,1,1,1,1,3,2,1,1,1,2',
                  '111,21,1,11,1,11,11,1,11,1,222,2,11,111,1,21'),
                 ('22_1',
                  '22_1_5',
                  '3,1,1,2,2,3,3,1,1,1,1,1,1,1,1,1',
                  '222,11,1,21,2,12,12,1,11,1,111,1,11,111,1,11',
                  '1,2,1,1,1,1,1,1,1,1,1,2,2,1,1,2',
                  '111,21,1,11,1,11,11,1,11,1,111,2,21,111,1,21'),
                 ('22_1',
                  '22_1_4',
                  '2,3,1,2,1,1,1,1,2,1,2,1,1,1,1,1',
                  '121,12,1,21,1,11,11,1,22,1,121,1,11,111,1,11',
                  '1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1',
                  '111,21,1,11,1,11,11,1,11,1,111,1,11,111,1,11'),
                 ('22_1',
                  '22_1_3',
                  '2,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1',
                  '121,11,2,21,1,11,11,1,11,1,111,1,11,111,1,11',
                  '2,1,2,1,1,2,2,2,1,2,1,1,1,2,1,1',
                  '121,11,2,11,1,21,21,2,11,2,111,1,11,112,1,11'),
                 ('22_1',
                  '22_1_2',
                  '2,3,1,2,1,3,1,1,1,1,1,1,3,3,2,3',
                  '121,12,1,21,1,12,11,1,11,1,111,1,12,221,2,12',
                  '1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1',
                  '111,21,1,11,1,11,11,1,11,2,111,1,11,111,1,11'),
                 ('28_9',
                  '28_9_100',
                  '1,2,2,4,1,1,1,2,1,1,1,1,1,1,1,1',
                  '1,121,12,222,111,11,1,2,1111,11,1,1,1,1,11,1',
                  '2,1,1,1,1,1,1,1,2,4,1,2,1,2,1,2',
                  '2,111,11,111,111,11,1,1,2221,22,1,2,1,2,11,2'),
                 ('28_9',
                  '28_9_101',
                  '1,2,4,2,2,1,1,2,1,1,1,1,1,1,2,1',
                  '1,121,22,122,121,11,1,2,1111,11,1,1,1,1,12,1',
                  '1,0,3,3,3,2,1,1,3,2,1,2,1,2,3,1',
                  '1,NULL,21,221,122,12,1,1,2222,12,1,2,1,2,22,1'),
                 ('28_9',
                  '28_9_186',
                  '2,3,3,0,2,1,2,0,3,3,1,2,2,2,2,1',
                  '2,212,21,NULL,121,11,2,NULL,2222,21,1,2,2,2,12,1',
                  '1,1,4,0,4,3,1,1,1,1,2,1,1,1,1,2',
                  '1,111,22,NULL,221,21,1,1,1111,11,2,1,1,1,11,2'),
                 ('28_9',
                  '28_9_114',
                  '2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1',
                  '2,111,11,111,111,11,1,1,1111,11,1,1,1,1,11,1',
                  '1,2,4,2,2,2,1,1,3,2,1,2,1,2,3,1',
                  '1,121,22,122,121,12,1,1,2222,12,1,2,1,2,22,1'),
                 ('28_9',
                  '28_9_105',
                  '2,1,1,1,1,1,1,1,2,4,1,2,1,2,1,1',
                  '2,111,11,111,111,11,1,1,2221,22,1,2,1,2,11,1',
                  '1,2,4,2,2,1,1,2,1,1,1,1,1,1,3,1',
                  '1,121,22,122,121,11,1,2,1111,11,1,1,1,1,22,1'),
                 ('28_9',
                  '28_9_103',
                  '1,2,2,4,1,1,1,2,1,1,1,1,1,1,1,1',
                  '1,121,12,222,111,11,1,2,1111,11,1,1,1,1,11,1',
                  '1,2,4,3,2,1,1,2,1,1,1,1,1,1,2,1',
                  '1,121,22,221,121,11,1,2,1111,11,1,1,1,1,12,1'),
                 ('28_9',
                  '28_9_111',
                  '1,2,2,4,1,1,1,2,1,1,1,1,1,1,1,1',
                  '1,121,12,222,111,11,1,2,1111,11,1,1,1,1,11,1',
                  '2,3,3,0,2,1,2,1,1,1,1,2,1,2,2,2',
                  '2,212,21,NULL,121,11,2,1,1111,11,1,2,1,2,12,2'),
                 ('28_9',
                  '28_9_110',
                  '1,2,2,4,1,1,1,2,1,1,1,1,1,1,1,1',
                  '1,121,12,222,111,11,1,2,1111,11,1,1,1,1,11,1',
                  '2,1,3,0,2,1,1,1,1,1,2,2,2,2,2,1',
                  '2,111,21,NULL,121,11,1,1,1111,11,2,2,2,2,12,1'),
                 ('28_9',
                  '28_9_108',
                  '1,2,2,4,1,1,1,2,1,1,1,1,1,1,1,1',
                  '1,121,12,222,111,11,1,2,1111,11,1,1,1,1,11,1',
                  '2,1,3,0,2,3,1,1,1,3,2,1,1,1,1,1',
                  '2,111,21,NULL,121,21,1,1,1111,21,2,1,1,1,11,1'),
                 ('28_9',
                  '28_9_109',
                  '1,2,2,4,1,1,1,2,1,1,1,1,1,1,1,1',
                  '1,121,12,222,111,11,1,2,1111,11,1,1,1,1,11,1',
                  '1,1,4,0,4,3,1,0,3,1,2,2,2,2,2,1',
                  '1,111,22,NULL,221,21,1,NULL,2222,11,2,2,2,2,12,1'),
                 ('28_9',
                  '28_9_106',
                  '1,2,2,4,1,1,1,1,2,4,1,2,1,2,1,2',
                  '1,121,12,222,111,11,1,1,2221,22,1,2,1,2,11,2',
                  '1,0,3,3,3,2,1,1,1,1,1,1,1,1,2,1',
                  '1,NULL,21,221,122,12,1,1,1111,11,1,1,1,1,12,1')),
                {'28_9_103': (['1',
                   '2',
                   '2',
                   '4',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['1',
                   '2',
                   '4',
                   '3',
                   '2',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1']),
                 '28_9_106': (['1',
                   '2',
                   '2',
                   '4',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '4',
                   '1',
                   '2',
                   '1',
                   '2',
                   '1',
                   '2'],
                  ['1',
                   '0',
                   '3',
                   '3',
                   '3',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1']),
                 '28_9_108': (['1',
                   '2',
                   '2',
                   '4',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['2',
                   '1',
                   '3',
                   '0',
                   '2',
                   '3',
                   '1',
                   '1',
                   '1',
                   '3',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1']),
                 '28_9_109': (['1',
                   '2',
                   '2',
                   '4',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['1',
                   '1',
                   '4',
                   '0',
                   '4',
                   '3',
                   '1',
                   '0',
                   '3',
                   '1',
                   '2',
                   '2',
                   '2',
                   '2',
                   '2',
                   '1']),
                 '28_9_111': (['1',
                   '2',
                   '2',
                   '4',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['2',
                   '3',
                   '3',
                   '0',
                   '2',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '2',
                   '2',
                   '2']),
                 '28_9_105': (['2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '4',
                   '1',
                   '2',
                   '1',
                   '2',
                   '1',
                   '1'],
                  ['1',
                   '2',
                   '4',
                   '2',
                   '2',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '3',
                   '1']),
                 '28_9_114': (['2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['1',
                   '2',
                   '4',
                   '2',
                   '2',
                   '2',
                   '1',
                   '1',
                   '3',
                   '2',
                   '1',
                   '2',
                   '1',
                   '2',
                   '3',
                   '1']),
                 '28_9_110': (['1',
                   '2',
                   '2',
                   '4',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['2',
                   '1',
                   '3',
                   '0',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '2',
                   '2',
                   '2',
                   '2',
                   '1']),
                 '1036_5': (['1', '1', '3', '1', '1', '2', '1'],
                  ['1', '1', '1', '1', '1', '1', '2']),
                 '1036_99': (['1', '1', '1', '1', '1', '2', '3'],
                  ['2', '2', '3', '2', '2', '1', '1']),
                 '1036_6': (['1', '1', '1', '1', '1', '1', '2'],
                  ['3', '2', '2', '2', '2', '2', '3']),
                 '1036_4': (['1', '1', '1', '1', '1', '2', '3'],
                  ['1', '2', '2', '2', '2', '1', '2']),
                 '1036_3': (['1', '1', '1', '1', '1', '2', '3'],
                  ['3', '2', '2', '2', '1', '1', '2']),
                 '22_1_2': (['2',
                   '3',
                   '1',
                   '2',
                   '1',
                   '3',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '3',
                   '3',
                   '2',
                   '3'],
                  ['1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1']),
                 '22_1_3': (['2',
                   '1',
                   '2',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['2',
                   '1',
                   '2',
                   '1',
                   '1',
                   '2',
                   '2',
                   '2',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1']),
                 '22_1_4': (['2',
                   '3',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1']),
                 '22_1_5': (['3',
                   '1',
                   '1',
                   '2',
                   '2',
                   '3',
                   '3',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '2',
                   '1',
                   '1',
                   '2']),
                 '22_1_99': (['3',
                   '3',
                   '1',
                   '3',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '3'],
                  ['1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '3',
                   '2',
                   '1',
                   '1',
                   '1',
                   '2']),
                 '1036_1': (['2', '2', '3', '2', '2', '1', '1'],
                  ['0', '0', '0', '0', '0', '0', '0']),
                 '1036_2': (['1', '1', '1', '1', '1', '2', '3'],
                  ['0', '0', '0', '0', '0', '0', '0']),
                 '22_1_10': (['1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '3',
                   '2',
                   '2',
                   '2',
                   '1',
                   '1'],
                  ['2',
                   '1',
                   '2',
                   '1',
                   '1',
                   '2',
                   '2',
                   '2',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2']),
                 '22_1_20': (['3',
                   '1',
                   '2',
                   '3',
                   '2',
                   '3',
                   '3',
                   '0',
                   '2',
                   '1',
                   '2',
                   '1',
                   '3',
                   '3',
                   '2',
                   '3'],
                  ['2',
                   '3',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1']),
                 '28_9_100': (['1',
                   '2',
                   '2',
                   '4',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1'],
                  ['2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '4',
                   '1',
                   '2',
                   '1',
                   '2',
                   '1',
                   '2']),
                 '28_9_101': (['1',
                   '2',
                   '4',
                   '2',
                   '2',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1'],
                  ['1',
                   '0',
                   '3',
                   '3',
                   '3',
                   '2',
                   '1',
                   '1',
                   '3',
                   '2',
                   '1',
                   '2',
                   '1',
                   '2',
                   '3',
                   '1']),
                 '28_9_186': (['2',
                   '3',
                   '3',
                   '0',
                   '2',
                   '1',
                   '2',
                   '0',
                   '3',
                   '3',
                   '1',
                   '2',
                   '2',
                   '2',
                   '2',
                   '1'],
                  ['1',
                   '1',
                   '4',
                   '0',
                   '4',
                   '3',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2',
                   '1',
                   '1',
                   '1',
                   '1',
                   '2'])},
                16,
                OrderedDict([('1036',
                              ((0.5286265540286827,
                                0.13026233295708659,
                                0.3411111130142307),
                               (0.8613320900547093, 0.13866790994529055),
                               (0.5010800904732587,
                                0.4980826023946548,
                                0.000837307132086367),
                               (0.99999, 9.999999999954488e-06),
                               (0.9821, 0.017900000000000027),
                               (0.8466, 0.15339999999999998),
                               (0.7310965704069533,
                                0.2688987385890161,
                                4.6910040307397826e-06))),
                             ('22_1',
                              ((0.6047240370708582,
                                0.3902151486330876,
                                0.005060814296054205),
                               (0.5530830184458694,
                                0.24964995462505854,
                                0.19726702692907214),
                               (0.9768, 0.0232),
                               (0.48440858277158266,
                                0.48151082454961897,
                                0.03408059267879841),
                               (0.99999, 9.99999999995449e-06),
                               (0.7927504201426182,
                                0.01717031968433133,
                                0.19007926017305032),
                               (0.9766016726686623,
                                0.005598541219160628,
                                0.017799786112177054),
                               (0.9986, 0.0013999999999999568),
                               (0.9999657926217794, 3.420737822050703e-05),
                               (0.8466, 0.15339999999999998),
                               (0.9304868324924078,
                                0.06949901650534375,
                                1.4151002248487355e-05),
                               (0.9995, 0.0004999999999999449),
                               (0.8660089037947565,
                                0.02531355791248566,
                                0.10867753829275789),
                               (0.9371286059455748,
                                0.04601093029611084,
                                0.016860463758314376),
                               (0.7075, 0.2925),
                               (0.5743034831820597,
                                0.21446658024612286,
                                0.21122993657181752))),
                             ('28_9',
                              ((0.8023, 0.1977),
                               (0.6077219248814325,
                                0.39214961983958185,
                                0.00012845527898571837),
                               (0.5078619,
                                0.18113810000000002,
                                0.22923809999999994,
                                0.0817619),
                               (0.976835932494737,
                                0.023062064679197723,
                                5.1154417271776483e-05,
                                5.08484087935804e-05),
                               (0.8040110636455552,
                                0.19277924585798464,
                                0.002085047943677796,
                                0.0011246425527824543),
                               (0.9852702785678613,
                                0.011765016481583481,
                                0.0029647049505552524),
                               (0.9521, 0.047900000000000054),
                               (0.9995, 0.0004999999999999449),
                               (0.9979740648928657,
                                0.0018217208483351528,
                                0.00020421425879913634),
                               (0.951510197508,
                                8.980249200000978e-05,
                                0.048395432492,
                                4.567508000000497e-06),
                               (0.9532, 0.04679999999999995),
                               (0.7075, 0.2925),
                               (0.9771, 0.02290000000000003),
                               (0.7281, 0.27190000000000003),
                               (0.7309426337276147,
                                0.2688421203793674,
                                0.0002152458930179144),
                               (0.9917, 0.008299999999999974)))])]}),
             ('format',
                 28_9_103 28_9_106 28_9_108 28_9_109 28_9_111 28_9_105 28_9_114 28_9_110  \
              0    (1, 1)   (1, 1)   (1, 2)   (1, 1)   (1, 2)   (2, 1)   (2, 1)   (1, 2)   
              1    (2, 2)   (2, 0)   (2, 1)   (2, 1)   (2, 3)   (1, 2)   (1, 2)   (2, 1)   
              2    (2, 4)   (2, 3)   (2, 3)   (2, 4)   (2, 3)   (1, 4)   (1, 4)   (2, 3)   
              3    (4, 3)   (4, 3)   (4, 0)   (4, 0)   (4, 0)   (1, 2)   (1, 2)   (4, 0)   
              4    (1, 2)   (1, 3)   (1, 2)   (1, 4)   (1, 2)   (1, 2)   (1, 2)   (1, 2)   
              5    (1, 1)   (1, 2)   (1, 3)   (1, 3)   (1, 1)   (1, 1)   (1, 2)   (1, 1)   
              6    (1, 1)   (1, 1)   (1, 1)   (1, 1)   (1, 2)   (1, 1)   (1, 1)   (1, 1)   
              7    (2, 2)   (1, 1)   (2, 1)   (2, 0)   (2, 1)   (1, 2)   (1, 1)   (2, 1)   
              8    (1, 1)   (2, 1)   (1, 1)   (1, 3)   (1, 1)   (2, 1)   (1, 3)   (1, 1)   
              9    (1, 1)   (4, 1)   (1, 3)   (1, 1)   (1, 1)   (4, 1)   (1, 2)   (1, 1)   
              10   (1, 1)   (1, 1)   (1, 2)   (1, 2)   (1, 1)   (1, 1)   (1, 1)   (1, 2)   
              11   (1, 1)   (2, 1)   (1, 1)   (1, 2)   (1, 2)   (2, 1)   (1, 2)   (1, 2)   
              12   (1, 1)   (1, 1)   (1, 1)   (1, 2)   (1, 1)   (1, 1)   (1, 1)   (1, 2)   
              13   (1, 1)   (2, 1)   (1, 1)   (1, 2)   (1, 2)   (2, 1)   (1, 2)   (1, 2)   
              14   (1, 2)   (1, 2)   (1, 1)   (1, 2)   (1, 2)   (1, 3)   (1, 3)   (1, 2)   
              15   (1, 1)   (2, 1)   (1, 1)   (1, 1)   (1, 2)   (1, 1)   (1, 1)   (1, 1)   
              
                  1036_5 1036_99  ...  22_1_4  22_1_5 22_1_99  1036_1  1036_2 22_1_10  \
              0   (1, 1)  (1, 2)  ...  (2, 1)  (3, 1)  (3, 1)  (2, 0)  (1, 0)  (1, 2)   
              1   (1, 1)  (1, 2)  ...  (3, 2)  (1, 2)  (3, 2)  (2, 0)  (1, 0)  (2, 1)   
              2   (3, 1)  (1, 3)  ...  (1, 1)  (1, 1)  (1, 1)  (3, 0)  (1, 0)  (1, 2)   
              3   (1, 1)  (1, 2)  ...  (2, 1)  (2, 1)  (3, 1)  (2, 0)  (1, 0)  (1, 1)   
              4   (1, 1)  (1, 2)  ...  (1, 1)  (2, 1)  (1, 1)  (2, 0)  (1, 0)  (1, 1)   
              5   (2, 1)  (2, 1)  ...  (1, 1)  (3, 1)  (1, 1)  (1, 0)  (2, 0)  (1, 2)   
              6   (1, 2)  (3, 1)  ...  (1, 1)  (3, 1)  (1, 1)  (1, 0)  (3, 0)  (1, 2)   
              7   (0, 0)  (0, 0)  ...  (1, 1)  (1, 1)  (1, 1)  (0, 0)  (0, 0)  (1, 2)   
              8   (0, 0)  (0, 0)  ...  (2, 1)  (1, 1)  (1, 1)  (0, 0)  (0, 0)  (1, 1)   
              9   (0, 0)  (0, 0)  ...  (1, 1)  (1, 1)  (1, 1)  (0, 0)  (0, 0)  (1, 2)   
              10  (0, 0)  (0, 0)  ...  (2, 1)  (1, 1)  (1, 3)  (0, 0)  (0, 0)  (3, 1)   
              11  (0, 0)  (0, 0)  ...  (1, 1)  (1, 2)  (1, 2)  (0, 0)  (0, 0)  (2, 1)   
              12  (0, 0)  (0, 0)  ...  (1, 1)  (1, 2)  (1, 1)  (0, 0)  (0, 0)  (2, 1)   
              13  (0, 0)  (0, 0)  ...  (1, 1)  (1, 1)  (1, 1)  (0, 0)  (0, 0)  (2, 1)   
              14  (0, 0)  (0, 0)  ...  (1, 1)  (1, 1)  (2, 1)  (0, 0)  (0, 0)  (1, 1)   
              15  (0, 0)  (0, 0)  ...  (1, 1)  (1, 2)  (3, 2)  (0, 0)  (0, 0)  (1, 2)   
              
                 22_1_20 28_9_100 28_9_101 28_9_186  
              0   (3, 2)   (1, 2)   (1, 1)   (2, 1)  
              1   (1, 3)   (2, 1)   (2, 0)   (3, 1)  
              2   (2, 1)   (2, 1)   (4, 3)   (3, 4)  
              3   (3, 2)   (4, 1)   (2, 3)   (0, 0)  
              4   (2, 1)   (1, 1)   (2, 3)   (2, 4)  
              5   (3, 1)   (1, 1)   (1, 2)   (1, 3)  
              6   (3, 1)   (1, 1)   (1, 1)   (2, 1)  
              7   (0, 1)   (2, 1)   (2, 1)   (0, 1)  
              8   (2, 1)   (1, 2)   (1, 3)   (3, 1)  
              9   (1, 1)   (1, 4)   (1, 2)   (3, 1)  
              10  (2, 1)   (1, 1)   (1, 1)   (1, 2)  
              11  (1, 1)   (1, 2)   (1, 2)   (2, 1)  
              12  (3, 1)   (1, 1)   (1, 1)   (2, 1)  
              13  (3, 1)   (1, 2)   (1, 2)   (2, 1)  
              14  (2, 1)   (1, 1)   (2, 3)   (2, 1)  
              15  (3, 1)   (1, 2)   (1, 1)   (1, 2)  
              
              [16 rows x 25 columns])])
{% endraw %} {% raw %}
a1 = {k:env.dtest[k] for k in ['MC1R','PAPPA2']}
{% endraw %} {% raw %}
import pickle
with open('../data/dtestpy3_fixedcoder_seqtest_20220126.pickle', 'wb') as handle:
    pickle.dump(a1, handle, protocol=pickle.HIGHEST_PROTOCOL)

#with open('dtestpy3_fixedcoder.pickle', 'rb') as handle:
#    b = pickle.load(handle)
{% endraw %} {% raw %}
a = {k:env.dtest[k] for k in ['MC1R','PAPPA2']}
{% endraw %} {% raw %}
import pickle
with open('dtestpy3.pickle', 'wb') as handle:
    pickle.dump(a, handle, protocol=pickle.HIGHEST_PROTOCOL)

#with open('dtestpy3.pickle', 'rb') as handle:
#    b = pickle.load(handle)
{% endraw %} {% raw %}
a['MC1R']
OrderedDict([('dregions',
              [['16',
                '89984286',
                '89987385',
                'MC1R',
                '133.689089888',
                '159.050776809',
                '111.195245154']]),
             ('dvariants',
              [[['16', 89984370, 'MC1R', 0.00015],
                ['16', 89984604, 'MC1R', 0.00015],
                ['16', 89984739, 'MC1R', 0.00015],
                ['16', 89985940, 'MC1R', 0.085784],
                ['16', 89986608, 'MC1R', 0.107936],
                ['16', 89986760, 'MC1R', 0.00015],
                ['16', 89987201, 'MC1R', 0.00015]]]),
             ('dfamvaridx',
              [{'1': [0, 1, 2, 3, 4, 5, 6], '2': [0, 1, 2, 3, 4, 5, 6]}]),
             ('dgeno',
              [{'II:2': ['12', '12', '11', '11', '11', '12', '12'],
                'I:2': ['12', '12', '11', '11', '11', '12', '12'],
                'I:1': ['12', '12', '11', '11', '11', '11', '12'],
                'II:3': ['12', '12', '11', '11', '11', '12', '12'],
                'II:4': ['20', '12', '12', '12', '12', '12', '22'],
                'II:1': ['22', '22', '11', '11', '11', '12', '22'],
                'II:B': ['11', '11', '11', '11', '11', '11', '12'],
                'I:B': ['12', '12', '12', '12', '12', '12', '11'],
                'I:A': ['11', '11', '11', '11', '11', '11', '22'],
                'II:C': ['11', '11', '11', '11', '11', '11', '12'],
                'II:D': ['12', '12', '12', '12', '12', '12', '12'],
                'II:A': ['12', '12', '12', '12', '12', '12', '12']}]),
             ('gss',
              [{0: {'1': ('12', '12', '12', '12', '22', '22'),
                 '2': ('12', '11', '22', '12', '12', '12')},
                1: {'1': ('12', '12', '12', '12', '22', '22'),
                 '2': ('12', '11', '22', '12', '12', '12')},
                2: {'1': ('12', '12', '12', '12', '22', '22'),
                 '2': ('12', '11', '22', '12', '12', '12')},
                3: {'1': ('12', '12', '12', '12', '22', '22'),
                 '2': ('12', '11', '22', '12', '12', '12')},
                4: {'1': ('12', '12', '12', '12', '22', '22'),
                 '2': ('12', '11', '22', '12', '12', '12')},
                5: {'1': ('12', '12', '12', '12', '22', '22'),
                 '2': ('12', '11', '22', '12', '12', '12')},
                6: {'1': ('12', '12', '12', '12', '22', '22'),
                 '2': ('12', '11', '22', '12', '12', '12')}}]),
             ('hapimp',
              {'1': ['1',
                ['V0-89984370',
                 'V1-89984604',
                 'V2-89984739',
                 'V3-89985940',
                 'V4-89986608',
                 'V5-89986760',
                 'V6-89987201'],
                [89984370,
                 89984604,
                 89984739,
                 89985940,
                 89986608,
                 89986760,
                 89987201],
                [0.00015,
                 0.00015,
                 0.00015,
                 0.085784,
                 0.107936,
                 0.00015,
                 0.00015],
                (('1', 'I:1', '1:', '1:', '1:', '1:', '1:', '1:', '1:'),
                 ('1', 'I:1', '2:', '2:', '1:', '1:', '1:', '1:', '2:'),
                 ('1', 'I:2', '2:', '2:', '1:', '1:', '1:', '2:', '2:'),
                 ('1', 'I:2', '1:', '1:', '1:', '1:', '1:', '1:', '1:'),
                 ('1', 'II:3', '2:', '2|', '1:', '1:', '1:', '2|', '2|'),
                 ('1', 'II:3', '1:', '1|', '1:', '1:', '1:', '1|', '1|'),
                 ('1', 'II:2', '2:', '2|', '1:', '1:', '1:', '2|', '2|'),
                 ('1', 'II:2', '1:', '1|', '1:', '1:', '1:', '1|', '1|'),
                 ('1', 'II:1', '2:', '2|', '1:', '1:', '1:', '2|', '2|'),
                 ('1', 'II:1', '2:', '2|', '1:', '1:', '1:', '1|', '2|'),
                 ('1', 'II:4', '2:', '2|', '1:', '1:', '1:', '2\\', '2|'),
                 ('1', 'II:4', '1:', '1|', '1:', '1:', '1:', '1\\', '2|'))],
               '2': ['2',
                ['V0-89984370',
                 'V1-89984604',
                 'V2-89984739',
                 'V3-89985940',
                 'V4-89986608',
                 'V5-89986760',
                 'V6-89987201'],
                [89984370,
                 89984604,
                 89984739,
                 89985940,
                 89986608,
                 89986760,
                 89987201],
                [0.00015,
                 0.00015,
                 0.00015,
                 0.085784,
                 0.107936,
                 0.00015,
                 0.00015],
                (('2', 'I:A', '1:', '1:', '1:', '1:', '1:', '1:', '2:'),
                 ('2', 'I:A', '1:', '1:', '1:', '1:', '1:', '1:', '2:'),
                 ('2', 'I:B', '2:', '2:', '2:', '2:', '2:', '2:', '1:'),
                 ('2', 'I:B', '1:', '1:', '1:', '1:', '1:', '1:', '1:'),
                 ('2', 'II:D', '2:', '2|', '2|', '2|', '2|', '2|', '1:'),
                 ('2', 'II:D', '1:', '1|', '1|', '1|', '1|', '1|', '2:'),
                 ('2', 'II:C', '1:', '1|', '1|', '1|', '1|', '1|', '1:'),
                 ('2', 'II:C', '1:', '1|', '1|', '1|', '1|', '1|', '2:'),
                 ('2', 'II:B', '1:', '1|', '1|', '1|', '1|', '1|', '1:'),
                 ('2', 'II:B', '1:', '1|', '1|', '1|', '1|', '1|', '2:'),
                 ('2', 'II:A', '2:', '2|', '2|', '2|', '2|', '2|', '1:'),
                 ('2', 'II:A', '1:', '1|', '1|', '1|', '1|', '1|', '2:')),
                {'V0-89984370': 0.00015,
                 'V1-89984604': 0.00015,
                 'V2-89984739': 0.00015,
                 'V3-89985940': 0.085784,
                 'V4-89986608': 0.107936,
                 'V5-89986760': 0.00015,
                 'V6-89987201': 0.00015}]}),
             ('ld',
              [[[None],
                [1.0, None],
                [0.2380952380952381, 0.2380952380952381, None],
                [0.2380952380952381, 0.2380952380952381, 1.0, None],
                [0.2380952380952381, 0.2380952380952381, 1.0, 1.0, None],
                [0.5555555555555556,
                 0.5555555555555556,
                 0.42857142857142866,
                 0.42857142857142866,
                 0.42857142857142866,
                 None],
                [0.06666666666666665,
                 0.06666666666666665,
                 0.14285714285714282,
                 0.14285714285714282,
                 0.14285714285714282,
                 0.0,
                 None]],
               [[0, 1], [2, 3, 4], [3, 4]],
               [['V0-89984370', 'V1-89984604'],
                ['V2-89984739', 'V3-89985940', 'V4-89986608']]]),
             ('coder',
              {'input': [{'II:2': ['12', '12', '11', '11', '11', '12', '12'],
                 'I:2': ['12', '12', '11', '11', '11', '12', '12'],
                 'I:1': ['12', '12', '11', '11', '11', '11', '12'],
                 'II:3': ['12', '12', '11', '11', '11', '12', '12'],
                 'II:4': ['20', '12', '12', '12', '12', '12', '22'],
                 'II:1': ['22', '22', '11', '11', '11', '12', '22'],
                 'II:B': ['11', '11', '11', '11', '11', '11', '12'],
                 'I:B': ['12', '12', '12', '12', '12', '12', '11'],
                 'I:A': ['11', '11', '11', '11', '11', '11', '22'],
                 'II:C': ['11', '11', '11', '11', '11', '11', '12'],
                 'II:D': ['12', '12', '12', '12', '12', '12', '12'],
                 'II:A': ['12', '12', '12', '12', '12', '12', '12']},
                OrderedDict([('1',
                              [['1',
                                'I:1',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:'],
                               ['1',
                                'I:1',
                                '2:',
                                '2:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '2:'],
                               ['1',
                                'I:2',
                                '2:',
                                '2:',
                                '1:',
                                '1:',
                                '1:',
                                '2:',
                                '2:'],
                               ['1',
                                'I:2',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:'],
                               ['1',
                                'II:3',
                                '2:',
                                '2|',
                                '1:',
                                '1:',
                                '1:',
                                '2|',
                                '2|'],
                               ['1',
                                'II:3',
                                '1:',
                                '1|',
                                '1:',
                                '1:',
                                '1:',
                                '1|',
                                '1|'],
                               ['1',
                                'II:2',
                                '2:',
                                '2|',
                                '1:',
                                '1:',
                                '1:',
                                '2|',
                                '2|'],
                               ['1',
                                'II:2',
                                '1:',
                                '1|',
                                '1:',
                                '1:',
                                '1:',
                                '1|',
                                '1|'],
                               ['1',
                                'II:1',
                                '2:',
                                '2|',
                                '1:',
                                '1:',
                                '1:',
                                '2|',
                                '2|'],
                               ['1',
                                'II:1',
                                '2:',
                                '2|',
                                '1:',
                                '1:',
                                '1:',
                                '1|',
                                '2|'],
                               ['1',
                                'II:4',
                                '2:',
                                '2|',
                                '1:',
                                '1:',
                                '1:',
                                '2\\',
                                '2|'],
                               ['1',
                                'II:4',
                                '1:',
                                '1|',
                                '1:',
                                '1:',
                                '1:',
                                '1\\',
                                '2|']]),
                             ('2',
                              [['2',
                                'I:A',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '2:'],
                               ['2',
                                'I:A',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '2:'],
                               ['2',
                                'I:B',
                                '2:',
                                '2:',
                                '2:',
                                '2:',
                                '2:',
                                '2:',
                                '1:'],
                               ['2',
                                'I:B',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:'],
                               ['2',
                                'II:D',
                                '2:',
                                '2|',
                                '2|',
                                '2|',
                                '2|',
                                '2|',
                                '1:'],
                               ['2',
                                'II:D',
                                '1:',
                                '1|',
                                '1|',
                                '1|',
                                '1|',
                                '1|',
                                '2:'],
                               ['2',
                                'II:C',
                                '1:',
                                '1|',
                                '1|',
                                '1|',
                                '1|',
                                '1|',
                                '1:'],
                               ['2',
                                'II:C',
                                '1:',
                                '1|',
                                '1|',
                                '1|',
                                '1|',
                                '1|',
                                '2:'],
                               ['2',
                                'II:B',
                                '1:',
                                '1|',
                                '1|',
                                '1|',
                                '1|',
                                '1|',
                                '1:'],
                               ['2',
                                'II:B',
                                '1:',
                                '1|',
                                '1|',
                                '1|',
                                '1|',
                                '1|',
                                '2:'],
                               ['2',
                                'II:A',
                                '2:',
                                '2|',
                                '2|',
                                '2|',
                                '2|',
                                '2|',
                                '1:'],
                               ['2',
                                'II:A',
                                '1:',
                                '1|',
                                '1|',
                                '1|',
                                '1|',
                                '1|',
                                '2:']])]),
                {'V0-89984370': 0.00015,
                 'V1-89984604': 0.00015,
                 'V2-89984739': 0.00015,
                 'V3-89985940': 0.085784,
                 'V4-89986608': 0.107936,
                 'V5-89986760': 0.00015,
                 'V6-89987201': 0.00015},
                {'1': ['V0-89984370',
                  'V1-89984604',
                  'V2-89984739',
                  'V3-89985940',
                  'V4-89986608',
                  'V5-89986760',
                  'V6-89987201'],
                 '2': ['V0-89984370',
                  'V1-89984604',
                  'V2-89984739',
                  'V3-89985940',
                  'V4-89986608',
                  'V5-89986760',
                  'V6-89987201']},
                [['V0-89984370', 'V1-89984604'],
                 ['V2-89984739', 'V3-89985940', 'V4-89986608']]],
               'output': [(('1', 'I:1', '1,1', '1111,11', '2,2', '2222,12'),
                 ('1', 'I:2', '2,3', '2222,22', '1,1', '1111,11'),
                 ('1', 'II:3', '2,3', '2222,22', '1,1', '1111,11'),
                 ('1', 'II:2', '2,3', '2222,22', '1,1', '1111,11'),
                 ('1', 'II:1', '2,3', '2222,22', '2,2', '2222,12'),
                 ('1', 'II:4', '2,3', '2222,22', '1,2', '1111,12'),
                 ('2', 'I:A', '2', '111112', '2', '111112'),
                 ('2', 'I:B', '3', '222221', '1', '111111'),
                 ('2', 'II:D', '3', '222221', '2', '111112'),
                 ('2', 'II:C', '1', '111111', '2', '111112'),
                 ('2', 'II:B', '1', '111111', '2', '111112'),
                 ('2', 'II:A', '3', '222221', '2', '111112')),
                {'II:2': (['2', '3'], ['2222', '22']),
                 'I:2': (['2', '3'], ['2222', '22']),
                 'I:1': (['1', '1'], ['1111', '11']),
                 'II:3': (['2', '3'], ['2222', '22']),
                 'II:4': (['2', '3'], ['2222', '22']),
                 'II:1': (['2', '3'], ['2222', '22']),
                 'II:B': (['1'], ['111111']),
                 'I:B': (['3'], ['222221']),
                 'I:A': (['2'], ['111112']),
                 'II:C': (['1'], ['111111']),
                 'II:D': (['3'], ['222221']),
                 'II:A': (['3'], ['222221'])},
                2,
                OrderedDict([('1',
                              ((0.999999999999997, 3.0400071909574507e-15),
                               (0.9995498650574084,
                                0.000449932412250011,
                                2.0253034157679256e-07))),
                             ('2',
                              ((0.999550067496625,
                                0.0004499325033749946,
                                1.3677980457054751e-18),))])]}),
             ('format',
              {'II:2': [('2', '2222'), ('3', '22')],
               'I:2': [('2', '2222'), ('3', '22')],
               'I:1': [('1', '1111'), ('1', '11')],
               'II:3': [('2', '2222'), ('3', '22')],
               'II:4': [('2', '2222'), ('3', '22')],
               'II:1': [('2', '2222'), ('3', '22')],
               'II:B': [('1', '111111'), ('0', '0')],
               'I:B': [('3', '222221'), ('0', '0')],
               'I:A': [('2', '111112'), ('0', '0')],
               'II:C': [('1', '111111'), ('0', '0')],
               'II:D': [('3', '222221'), ('0', '0')],
               'II:A': [('3', '222221'), ('0', '0')]})])
{% endraw %} {% raw %}
a['PAPPA2']
OrderedDict([('dregions',
              [['1',
                '176432306',
                '176811970',
                'PAPPA2',
                '186.278964324',
                '238.991541401',
                '136.402021932']]),
             ('dvariants',
              [[['1', 176659933, 'PAPPA2', 0.00015],
                ['1', 176660247, 'PAPPA2', 0.00015],
                ['1', 176660371, 'PAPPA2', 0.00015],
                ['1', 176664842, 'PAPPA2', 0.241943],
                ['1', 176668823, 'PAPPA2', 0.00015],
                ['1', 176671914, 'PAPPA2', 0.00015],
                ['1', 176679384, 'PAPPA2', 0.00015],
                ['1', 176734756, 'PAPPA2', 0.352899],
                ['1', 176811754, 'PAPPA2', 0.00015],
                ['1', 176811873, 'PAPPA2', 0.00015]]]),
             ('dfamvaridx',
              [{'1': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
                '2': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]}]),
             ('dgeno',
              [{'II:2': ['12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '12'],
                'I:2': ['11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '12',
                 '12',
                 '11'],
                'I:1': ['12',
                 '12',
                 '22',
                 '12',
                 '22',
                 '12',
                 '12',
                 '22',
                 '12',
                 '12'],
                'II:3': ['12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '12'],
                'II:4': ['11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '12',
                 '12',
                 '22',
                 '22',
                 '11'],
                'II:1': ['12',
                 '11',
                 '12',
                 '11',
                 '12',
                 '11',
                 '11',
                 '12',
                 '11',
                 '12'],
                'II:B': ['12',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11'],
                'I:B': ['12',
                 '11',
                 '12',
                 '12',
                 '22',
                 '22',
                 '12',
                 '12',
                 '12',
                 '12'],
                'I:A': ['11',
                 '12',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11',
                 '11'],
                'II:C': ['12',
                 '11',
                 '11',
                 '12',
                 '12',
                 '12',
                 '12',
                 '11',
                 '11',
                 '11'],
                'II:D': ['11',
                 '11',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '12'],
                'II:A': ['11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '11',
                 '12',
                 '12',
                 '12']}]),
             ('gss',
              [{0: {'1': ('12', '11', '12', '12', '11', '12'),
                 '2': ('11', '12', '11', '11', '12', '12')},
                1: {'1': ('12', '11', '12', '12', '11', '12'),
                 '2': ('11', '12', '11', '11', '12', '12')},
                2: {'1': ('12', '11', '12', '12', '11', '12'),
                 '2': ('11', '12', '11', '11', '12', '12')},
                3: {'1': ('12', '11', '12', '12', '11', '12'),
                 '2': ('11', '12', '11', '11', '12', '12')},
                4: {'1': ('12', '11', '12', '12', '11', '12'),
                 '2': ('11', '12', '11', '11', '12', '12')},
                5: {'1': ('12', '11', '12', '12', '11', '12'),
                 '2': ('11', '12', '11', '11', '12', '12')},
                6: {'1': ('12', '11', '12', '12', '11', '12'),
                 '2': ('11', '12', '11', '11', '12', '12')},
                7: {'1': ('12', '11', '12', '12', '11', '12'),
                 '2': ('11', '12', '11', '11', '12', '12')},
                8: {'1': ('12', '11', '12', '12', '11', '12'),
                 '2': ('11', '12', '11', '11', '12', '12')},
                9: {'1': ('12', '11', '12', '12', '11', '12'),
                 '2': ('11', '12', '11', '11', '12', '12')}}]),
             ('hapimp',
              {'1': ['1',
                ['V0-176659933',
                 'V1-176660247',
                 'V2-176660371',
                 'V3-176664842',
                 'V4-176668823',
                 'V5-176671914',
                 'V6-176679384',
                 'V7-176734756',
                 'V8-176811754',
                 'V9-176811873'],
                [176659933,
                 176660247,
                 176660371,
                 176664842,
                 176668823,
                 176671914,
                 176679384,
                 176734756,
                 176811754,
                 176811873],
                [0.00015,
                 0.00015,
                 0.00015,
                 0.241943,
                 0.00015,
                 0.00015,
                 0.00015,
                 0.352899,
                 0.00015,
                 0.00015],
                (('1',
                  'I:1',
                  '1:',
                  '2:',
                  '2:',
                  '2:',
                  '2:',
                  '2:',
                  '2:',
                  '2:',
                  '2:',
                  '1:'),
                 ('1',
                  'I:1',
                  '2:',
                  '1:',
                  '2:',
                  '1:',
                  '2:',
                  '1:',
                  '1:',
                  '2:',
                  '1:',
                  '2:'),
                 ('1',
                  'I:2',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '2:',
                  '2:',
                  '1:'),
                 ('1',
                  'I:2',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:'),
                 ('1',
                  'II:4',
                  '1:',
                  '1|',
                  '1:',
                  '1|',
                  '1:',
                  '1|',
                  '1|',
                  '2|',
                  '2|',
                  '1|'),
                 ('1',
                  'II:4',
                  '1:',
                  '2|',
                  '2:',
                  '2|',
                  '2:',
                  '2|',
                  '2|',
                  '2|',
                  '2|',
                  '1|'),
                 ('1',
                  'II:3',
                  '1:',
                  '1|',
                  '1:',
                  '1|',
                  '1:',
                  '1|',
                  '1|',
                  '1|',
                  '1|',
                  '1|'),
                 ('1',
                  'II:3',
                  '2:',
                  '1|',
                  '2:',
                  '1|',
                  '2:',
                  '1|',
                  '1|',
                  '2|',
                  '1|',
                  '2|'),
                 ('1',
                  'II:2',
                  '1:',
                  '1|',
                  '1:',
                  '1|',
                  '1:',
                  '1|',
                  '1|',
                  '1|',
                  '1|',
                  '1|'),
                 ('1',
                  'II:2',
                  '2:',
                  '1|',
                  '2:',
                  '1|',
                  '2:',
                  '1|',
                  '1|',
                  '2|',
                  '1|',
                  '2|'),
                 ('1',
                  'II:1',
                  '1:',
                  '1|',
                  '1:',
                  '1|',
                  '1:',
                  '1|',
                  '1|',
                  '1|',
                  '1|',
                  '1|'),
                 ('1',
                  'II:1',
                  '2:',
                  '1|',
                  '2:',
                  '1|',
                  '2:',
                  '1|',
                  '1|',
                  '2|',
                  '1|',
                  '2|'))],
               '2': ['2',
                ['V0-176659933',
                 'V1-176660247',
                 'V2-176660371',
                 'V3-176664842',
                 'V4-176668823',
                 'V5-176671914',
                 'V6-176679384',
                 'V7-176734756',
                 'V8-176811754',
                 'V9-176811873'],
                [176659933,
                 176660247,
                 176660371,
                 176664842,
                 176668823,
                 176671914,
                 176679384,
                 176734756,
                 176811754,
                 176811873],
                [0.00015,
                 0.00015,
                 0.00015,
                 0.241943,
                 0.00015,
                 0.00015,
                 0.00015,
                 0.352899,
                 0.00015,
                 0.00015],
                (('2',
                  'I:A',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:'),
                 ('2',
                  'I:A',
                  '1:',
                  '2:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:',
                  '1:'),
                 ('2',
                  'I:B',
                  '1:',
                  '1:',
                  '2:',
                  '1:',
                  '2:',
                  '2:',
                  '1:',
                  '2:',
                  '2:',
                  '2:'),
                 ('2',
                  'I:B',
                  '2:',
                  '1:',
                  '1:',
                  '2:',
                  '2:',
                  '2:',
                  '2:',
                  '1:',
                  '1:',
                  '1:'),
                 ('2',
                  'II:D',
                  '1:',
                  '1|',
                  '2|',
                  '1|',
                  '2:',
                  '2:',
                  '1|',
                  '2|',
                  '2|',
                  '2|'),
                 ('2',
                  'II:D',
                  '1:',
                  '1|',
                  '1|',
                  '1|',
                  '1:',
                  '1:',
                  '1|',
                  '1|',
                  '1|',
                  '1|'),
                 ('2',
                  'II:C',
                  '2:',
                  '1|',
                  '1|',
                  '2|',
                  '2:',
                  '2:',
                  '2|',
                  '1|',
                  '1|',
                  '1|'),
                 ('2',
                  'II:C',
                  '1:',
                  '1|',
                  '1|',
                  '1|',
                  '1:',
                  '1:',
                  '1|',
                  '1|',
                  '1|',
                  '1|'),
                 ('2',
                  'II:B',
                  '2:',
                  '1|',
                  '1|',
                  '2|',
                  '2:',
                  '2:',
                  '2|',
                  '1|',
                  '1|',
                  '1|'),
                 ('2',
                  'II:B',
                  '1:',
                  '1|',
                  '1|',
                  '1|',
                  '1:',
                  '1:',
                  '1|',
                  '1|',
                  '1|',
                  '1|'),
                 ('2',
                  'II:A',
                  '1:',
                  '1|',
                  '2|',
                  '1|',
                  '2:',
                  '2:',
                  '1|',
                  '2|',
                  '2|',
                  '2|'),
                 ('2',
                  'II:A',
                  '1:',
                  '2|',
                  '1|',
                  '1|',
                  '1:',
                  '1:',
                  '1|',
                  '1|',
                  '1|',
                  '1|')),
                {'V0-176659933': 0.00015,
                 'V1-176660247': 0.00015,
                 'V2-176660371': 0.00015,
                 'V3-176664842': 0.241943,
                 'V4-176668823': 0.00015,
                 'V5-176671914': 0.00015,
                 'V6-176679384': 0.00015,
                 'V7-176734756': 0.352899,
                 'V8-176811754': 0.00015,
                 'V9-176811873': 0.00015}]}),
             ('ld',
              [[[None],
                [0.1111111111111111, None],
                [0.022222222222222223, 0.022222222222222223, None],
                [0.1111111111111111,
                 0.1111111111111111,
                 0.022222222222222223,
                 None],
                [0.3333333333333334,
                 0.0,
                 0.6000000000000001,
                 0.3333333333333334,
                 None],
                [0.022222222222222223,
                 0.022222222222222223,
                 0.2177777777777778,
                 0.5555555555555556,
                 0.6000000000000001,
                 None],
                [0.1111111111111111,
                 0.1111111111111111,
                 0.022222222222222223,
                 1.0,
                 0.3333333333333334,
                 0.5555555555555556,
                 None],
                [0.0,
                 0.0,
                 0.6000000000000001,
                 0.0,
                 0.25,
                 0.06666666666666665,
                 0.0,
                 None],
                [0.19999999999999998,
                 0.022222222222222223,
                 0.2177777777777778,
                 0.022222222222222223,
                 0.06666666666666665,
                 0.2177777777777778,
                 0.022222222222222223,
                 0.6000000000000001,
                 None],
                [0.1111111111111111,
                 0.1111111111111111,
                 0.5555555555555556,
                 0.1111111111111111,
                 0.3333333333333334,
                 0.022222222222222223,
                 0.1111111111111111,
                 0.3333333333333334,
                 0.022222222222222223,
                 None]],
               [[3, 6]],
               [['V3-176664842', 'V6-176679384']]]),
             ('coder',
              {'input': [{'II:2': ['12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '12'],
                 'I:2': ['11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '12',
                  '12',
                  '11'],
                 'I:1': ['12',
                  '12',
                  '22',
                  '12',
                  '22',
                  '12',
                  '12',
                  '22',
                  '12',
                  '12'],
                 'II:3': ['12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '12'],
                 'II:4': ['11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '12',
                  '12',
                  '22',
                  '22',
                  '11'],
                 'II:1': ['12',
                  '11',
                  '12',
                  '11',
                  '12',
                  '11',
                  '11',
                  '12',
                  '11',
                  '12'],
                 'II:B': ['12',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11'],
                 'I:B': ['12',
                  '11',
                  '12',
                  '12',
                  '22',
                  '22',
                  '12',
                  '12',
                  '12',
                  '12'],
                 'I:A': ['11',
                  '12',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11',
                  '11'],
                 'II:C': ['12',
                  '11',
                  '11',
                  '12',
                  '12',
                  '12',
                  '12',
                  '11',
                  '11',
                  '11'],
                 'II:D': ['11',
                  '11',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '12'],
                 'II:A': ['11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '11',
                  '12',
                  '12',
                  '12']},
                OrderedDict([('1',
                              [['1',
                                'I:1',
                                '1:',
                                '2:',
                                '2:',
                                '2:',
                                '2:',
                                '2:',
                                '2:',
                                '2:',
                                '2:',
                                '1:'],
                               ['1',
                                'I:1',
                                '2:',
                                '1:',
                                '2:',
                                '1:',
                                '2:',
                                '1:',
                                '1:',
                                '2:',
                                '1:',
                                '2:'],
                               ['1',
                                'I:2',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '2:',
                                '2:',
                                '1:'],
                               ['1',
                                'I:2',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:'],
                               ['1',
                                'II:4',
                                '1:',
                                '1|',
                                '1:',
                                '1|',
                                '1:',
                                '1|',
                                '1|',
                                '2|',
                                '2|',
                                '1|'],
                               ['1',
                                'II:4',
                                '1:',
                                '2|',
                                '2:',
                                '2|',
                                '2:',
                                '2|',
                                '2|',
                                '2|',
                                '2|',
                                '1|'],
                               ['1',
                                'II:3',
                                '1:',
                                '1|',
                                '1:',
                                '1|',
                                '1:',
                                '1|',
                                '1|',
                                '1|',
                                '1|',
                                '1|'],
                               ['1',
                                'II:3',
                                '2:',
                                '1|',
                                '2:',
                                '1|',
                                '2:',
                                '1|',
                                '1|',
                                '2|',
                                '1|',
                                '2|'],
                               ['1',
                                'II:2',
                                '1:',
                                '1|',
                                '1:',
                                '1|',
                                '1:',
                                '1|',
                                '1|',
                                '1|',
                                '1|',
                                '1|'],
                               ['1',
                                'II:2',
                                '2:',
                                '1|',
                                '2:',
                                '1|',
                                '2:',
                                '1|',
                                '1|',
                                '2|',
                                '1|',
                                '2|'],
                               ['1',
                                'II:1',
                                '1:',
                                '1|',
                                '1:',
                                '1|',
                                '1:',
                                '1|',
                                '1|',
                                '1|',
                                '1|',
                                '1|'],
                               ['1',
                                'II:1',
                                '2:',
                                '1|',
                                '2:',
                                '1|',
                                '2:',
                                '1|',
                                '1|',
                                '2|',
                                '1|',
                                '2|']]),
                             ('2',
                              [['2',
                                'I:A',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:'],
                               ['2',
                                'I:A',
                                '1:',
                                '2:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:',
                                '1:'],
                               ['2',
                                'I:B',
                                '1:',
                                '1:',
                                '2:',
                                '1:',
                                '2:',
                                '2:',
                                '1:',
                                '2:',
                                '2:',
                                '2:'],
                               ['2',
                                'I:B',
                                '2:',
                                '1:',
                                '1:',
                                '2:',
                                '2:',
                                '2:',
                                '2:',
                                '1:',
                                '1:',
                                '1:'],
                               ['2',
                                'II:D',
                                '1:',
                                '1|',
                                '2|',
                                '1|',
                                '2:',
                                '2:',
                                '1|',
                                '2|',
                                '2|',
                                '2|'],
                               ['2',
                                'II:D',
                                '1:',
                                '1|',
                                '1|',
                                '1|',
                                '1:',
                                '1:',
                                '1|',
                                '1|',
                                '1|',
                                '1|'],
                               ['2',
                                'II:C',
                                '2:',
                                '1|',
                                '1|',
                                '2|',
                                '2:',
                                '2:',
                                '2|',
                                '1|',
                                '1|',
                                '1|'],
                               ['2',
                                'II:C',
                                '1:',
                                '1|',
                                '1|',
                                '1|',
                                '1:',
                                '1:',
                                '1|',
                                '1|',
                                '1|',
                                '1|'],
                               ['2',
                                'II:B',
                                '2:',
                                '1|',
                                '1|',
                                '2|',
                                '2:',
                                '2:',
                                '2|',
                                '1|',
                                '1|',
                                '1|'],
                               ['2',
                                'II:B',
                                '1:',
                                '1|',
                                '1|',
                                '1|',
                                '1:',
                                '1:',
                                '1|',
                                '1|',
                                '1|',
                                '1|'],
                               ['2',
                                'II:A',
                                '1:',
                                '1|',
                                '2|',
                                '1|',
                                '2:',
                                '2:',
                                '1|',
                                '2|',
                                '2|',
                                '2|'],
                               ['2',
                                'II:A',
                                '1:',
                                '2|',
                                '1|',
                                '1|',
                                '1:',
                                '1:',
                                '1|',
                                '1|',
                                '1|',
                                '1|']])]),
                {'V0-176659933': 0.00015,
                 'V1-176660247': 0.00015,
                 'V2-176660371': 0.00015,
                 'V3-176664842': 0.241943,
                 'V4-176668823': 0.00015,
                 'V5-176671914': 0.00015,
                 'V6-176679384': 0.00015,
                 'V7-176734756': 0.352899,
                 'V8-176811754': 0.00015,
                 'V9-176811873': 0.00015},
                {'1': ['V0-176659933',
                  'V1-176660247',
                  'V2-176660371',
                  'V3-176664842',
                  'V4-176668823',
                  'V5-176671914',
                  'V6-176679384',
                  'V7-176734756',
                  'V8-176811754',
                  'V9-176811873'],
                 '2': ['V0-176659933',
                  'V1-176660247',
                  'V2-176660371',
                  'V3-176664842',
                  'V4-176668823',
                  'V5-176671914',
                  'V6-176679384',
                  'V7-176734756',
                  'V8-176811754',
                  'V9-176811873']},
                [['V3-176664842', 'V6-176679384']]],
               'output': [(('1', 'I:1', '4', '1222222221', '3', '2122212212'),
                 ('1', 'I:2', '2', '1111111221', '1', '1111111111'),
                 ('1', 'II:4', '2', '1111111221', '4', '1222222221'),
                 ('1', 'II:3', '1', '1111111111', '3', '2122212212'),
                 ('1', 'II:2', '1', '1111111111', '3', '2122212212'),
                 ('1', 'II:1', '1', '1111111111', '3', '2122212212'),
                 ('2', 'I:A', '1', '1111111111', '2', '1212112111'),
                 ('2', 'I:B', '4', '1121221222', '3', '2112222111'),
                 ('2', 'II:D', '4', '1121221222', '1', '1111111111'),
                 ('2', 'II:C', '3', '2112222111', '1', '1111111111'),
                 ('2', 'II:B', '3', '2112222111', '1', '1111111111'),
                 ('2', 'II:A', '4', '1121221222', '2', '1212112111')),
                {'II:2': (['1'], ['1111111111']),
                 'I:2': (['2'], ['1111111221']),
                 'I:1': (['4'], ['1222222221']),
                 'II:3': (['1'], ['1111111111']),
                 'II:4': (['2'], ['1111111221']),
                 'II:1': (['1'], ['1111111111']),
                 'II:B': (['3'], ['2112222111']),
                 'I:B': (['4'], ['1121221222']),
                 'I:A': (['1'], ['1111111111']),
                 'II:C': (['3'], ['2112222111']),
                 'II:D': (['4'], ['1121221222']),
                 'II:A': (['4'], ['1121221222'])},
                1,
                OrderedDict([('1',
                              ((0.9998363838109469,
                                0.00016361618905309718,
                                1.3225147758256331e-20,
                                7.937469761930493e-24),)),
                             ('2',
                              ((0.9999999928166995,
                                7.183300126057594e-09,
                                3.233697565987606e-16,
                                1.6580038589959425e-19),))])]}),
             ('format',
              {'II:2': [('1', '1111111111')],
               'I:2': [('2', '1111111221')],
               'I:1': [('4', '1222222221')],
               'II:3': [('1', '1111111111')],
               'II:4': [('2', '1111111221')],
               'II:1': [('1', '1111111111')],
               'II:B': [('3', '2112222111')],
               'I:B': [('4', '1121221222')],
               'I:A': [('1', '1111111111')],
               'II:C': [('3', '2112222111')],
               'II:D': [('4', '1121221222')],
               'II:A': [('4', '1121221222')]})])
{% endraw %}

One region test

{% raw %}
region = regions[2]
{% endraw %} {% raw %}
region[0],region[1],region[2],region[3]='19',2234061,2234150, 'MIR1227'
{% endraw %} {% raw %}
region[0],region[1],region[2],region[3]='19',281043, 291404, 'PLPP2'
{% endraw %} {% raw %}
region
['19',
 281043,
 291404,
 'PLPP2',
 '1.5299877409602128e-06',
 '1.94345806118021e-06',
 '1.136044574393209e-06']
{% endraw %} {% raw %}
extractor.getRegion(region)
maker.getRegion(region)
writer.getRegion(region)
{% endraw %} {% raw %}
maker.recomb=True
{% endraw %} {% raw %}
np.array(list(env.dtest['PLPP2']['coder']['input'][2].values()))
/tmp/2206534.1.plot.q/ipykernel_11087/836524231.py:1: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  np.array(list(env.dtest['PLPP2']['coder']['input'][2].values()))
array([array([2.110e-01, 1.600e-03, 5.900e-03, 4.090e-01, 2.050e-02, 1.667e-01,
              8.800e-03, 1.160e-02, 2.000e-04, 2.200e-03, 8.500e-03, 6.690e-01,
              2.879e-01, 2.920e-02, 3.965e-01, 3.831e-01, 3.835e-01, 7.639e-01,
              6.382e-01, 3.000e-04, 7.802e-01, 6.283e-01, 6.351e-01, 5.990e-01,
              6.964e-01, 6.952e-01, 5.411e-01, 5.218e-01, 3.200e-03, 3.876e-01,
              6.406e-01, 1.550e-02, 4.881e-01, 4.506e-01])                     ,
       array([4.540e-02, 4.315e-01, 2.000e-04, 1.549e-05, 2.800e-02, 2.000e-04,
              1.549e-05, 2.000e-04, 2.207e-01, 1.745e-01, 2.000e-04, 2.000e-04,
              2.000e-04, 6.592e-01, 2.233e-01, 1.700e-03, 4.849e-01, 4.817e-01,
              4.818e-01, 8.516e-01, 2.000e-04, 6.285e-01, 1.000e-04, 7.651e-01,
              6.267e-01, 4.661e-05, 6.262e-01, 5.768e-01, 7.025e-01, 7.027e-01,
              6.634e-01, 6.044e-01, 2.762e-01, 2.000e-04, 6.839e-01, 5.495e-01,
              3.786e-01, 6.000e-04])                                           ,
       array([3.465e-01, 4.315e-01, 2.000e-04, 2.800e-02, 2.207e-01, 2.117e-01,
              2.116e-01, 2.000e-04, 6.592e-01, 4.849e-01, 4.817e-01, 4.818e-01,
              8.516e-01, 9.292e-05, 6.285e-01, 7.651e-01, 6.267e-01, 6.262e-01,
              5.768e-01, 7.025e-01, 7.027e-01, 6.634e-01, 6.044e-01, 2.762e-01,
              1.260e-02, 6.839e-01, 5.495e-01, 3.786e-01])                     ],
      dtype=object)
{% endraw %} {% raw %}
env.dtest['PLPP2']['coder']['output']
[(('1036', '1036_1', '9', '2121222111221111112222222222112122', '0', 'NULL'),
  ('1036', '1036_2', '3', '2112111121111122211111111111111111', '0', 'NULL'),
  ('1036',
   '1036_6',
   '2',
   '1111221111121111111111111111211112',
   '5',
   '2112111121111122221111111111111111'),
  ('1036',
   '1036_99',
   '3',
   '2112111121111122211111111111111111',
   '9',
   '2121222111221111112222222222112122'),
  ('1036',
   '1036_5',
   '8',
   '2112111121111111112112221221111111',
   '1',
   '1111111111111122221111111111111111'),
  ('1036',
   '1036_4',
   '3',
   '2112111121111122211111111111111111',
   '4',
   '1111221111121111121111111111211112'),
  ('1036',
   '1036_3',
   '6',
   '2112111121111122211111111111111112',
   '7',
   '2112111121111122221111111111111112'),
  ('22_1',
   '22_1_10',
   '11',
   '11111111112111112221111122222222211111',
   '14',
   '22212212121221221111212211111111112221'),
  ('22_1',
   '22_1_20',
   '9',
   '12122121212111112221111111111111121122',
   '4',
   '12111111111112111112121121221111112111'),
  ('22_1',
   '22_1_4',
   '8',
   '12121111211112111112121121221111112111',
   '5',
   '11111112121221112111112211111111112211'),
  ('22_1',
   '22_1_3',
   '6',
   '12111121111112111112121121221111112111',
   '12',
   '11111111112111221111111121222222212221'),
  ('22_1',
   '22_1_2',
   '1',
   '12111111111111112111111111111111121122',
   '13',
   '11212212121221221111211122211111112221'),
  ('22_1',
   '22_1_99',
   '7',
   '12112111111112111112121121221111112111',
   '10',
   '11112111112111112221111111112222211221'),
  ('22_1',
   '22_1_5',
   '2',
   '12111111112111112221111111111111111111',
   '3',
   '22111111112111112221111111111111111111'),
  ('28_9',
   '28_9_100',
   '1',
   '1211111212221111111111111111',
   '4',
   '1211111212221111111111112112'),
  ('28_9',
   '28_9_101',
   '4',
   '1211111212221111111111112112',
   '5',
   '2122222121112122222222221221'),
  ('28_9',
   '28_9_186',
   '2',
   '1211111212221211111111111111',
   '3',
   '1211111212221111111111111112'),
  ('28_9',
   '28_9_114',
   '4',
   '1211111212221111111111112112',
   '4',
   '1211111212221111111111112112'),
  ('28_9',
   '28_9_106',
   '4',
   '1211111212221111111111112112',
   '5',
   '2122222121112122222222221221'),
  ('28_9',
   '28_9_105',
   '1',
   '1211111212221111111111111111',
   '5',
   '2122222121112122222222221221'),
  ('28_9',
   '28_9_103',
   '1',
   '1211111212221111111111111111',
   '4',
   '1211111212221111111111112112'),
  ('28_9',
   '28_9_111',
   '1',
   '1211111212221111111111111111',
   '2',
   '1211111212221211111111111111'),
  ('28_9',
   '28_9_110',
   '4',
   '1211111212221111111111112112',
   '2',
   '1211111212221211111111111111'),
  ('28_9',
   '28_9_109',
   '4',
   '1211111212221111111111112112',
   '3',
   '1211111212221111111111111112'),
  ('28_9',
   '28_9_108',
   '1',
   '1211111212221111111111111111',
   '2',
   '1211111212221211111111111111')),
 {'1036_3': (['6'], ['7']),
  '1036_2': (['3'], ['0']),
  '1036_1': (['9'], ['0']),
  '1036_5': (['8'], ['1']),
  '1036_99': (['3'], ['9']),
  '1036_6': (['2'], ['5']),
  '1036_4': (['3'], ['4']),
  '22_1_20': (['9'], ['4']),
  '22_1_10': (['11'], ['14']),
  '22_1_99': (['7'], ['10']),
  '22_1_5': (['2'], ['3']),
  '22_1_4': (['8'], ['5']),
  '22_1_2': (['1'], ['13']),
  '22_1_3': (['6'], ['12']),
  '28_9_100': (['1'], ['4']),
  '28_9_103': (['1'], ['4']),
  '28_9_110': (['4'], ['2']),
  '28_9_114': (['4'], ['4']),
  '28_9_105': (['1'], ['5']),
  '28_9_111': (['1'], ['2']),
  '28_9_109': (['4'], ['3']),
  '28_9_108': (['1'], ['2']),
  '28_9_106': (['4'], ['5']),
  '28_9_101': (['4'], ['5']),
  '28_9_186': (['2'], ['3'])},
 1,
 OrderedDict([('1036',
               ((0.9988582547655259,
                 2.7101541759017632e-05,
                 1.1429348691813569e-05,
                 8.768686043927815e-05,
                 3.6979582658519204e-05,
                 9.373979833511457e-06,
                 3.0329450211009742e-05,
                 0.00093884437454053,
                 9.63404332827945e-11),)),
              ('22_1',
               ((4.2989963980636393e-10,
                 1.015571815650667e-06,
                 4.829976998799529e-08,
                 0.971979975317797,
                 1.1259709621373038e-17,
                 1.5056203038257732e-05,
                 0.02799942315730277,
                 4.263959977599745e-06,
                 1.4546365054026668e-25,
                 1.8369754991003278e-07,
                 1.5331468141280412e-09,
                 3.182970243126734e-08,
                 3.3108365538361685e-34,
                 2.969793793085411e-35),)),
              ('28_9',
               ((0.27617814911472166,
                 2.566485839438195e-05,
                 0.16826689291090058,
                 0.002147217794892999,
                 0.5533820753210903),))])]
{% endraw %} {% raw %}
extractor.apply(data)
      Chr   Start        AF    AF_nfe    AF_afr    AF_amr
2862   19  281113  0.001700  0.000015  0.005500  0.000400
2863   19  281129       NaN       NaN       NaN       NaN
2864   19  281168  0.000300  0.000031  0.000600  0.001200
2865   19  281248  0.001300  0.000700  0.000048  0.000073
2866   19  281267  0.000014  0.000015  0.000024  0.000000
...   ...     ...       ...       ...       ...       ...
3254   19  291232  0.036500  0.000600  0.117600  0.013400
3255   19  291343  0.000044  0.000016  0.000000  0.000000
3256   19  291352  0.000037  0.000065  0.000025  0.000000
3257   19  291365  0.000200  0.000000  0.000800  0.000000
3258   19  291404  0.000048  0.000052  0.000000  0.000200

[397 rows x 6 columns]
0 (397, 6) 19 281043 291405 PLPP2 281113
2 (397, 6) 19 281043 291405 PLPP2 281168
3 (397, 6) 19 281043 291405 PLPP2 281248
4 (397, 6) 19 281043 291405 PLPP2 281267
5 (397, 6) 19 281043 291405 PLPP2 281321
6 (397, 6) 19 281043 291405 PLPP2 281325
7 (397, 6) 19 281043 291405 PLPP2 281360
8 (397, 6) 19 281043 291405 PLPP2 281376
9 (397, 6) 19 281043 291405 PLPP2 281383
11 (397, 6) 19 281043 291405 PLPP2 281405
12 (397, 6) 19 281043 291405 PLPP2 281430
13 (397, 6) 19 281043 291405 PLPP2 281468
14 (397, 6) 19 281043 291405 PLPP2 281508
15 (397, 6) 19 281043 291405 PLPP2 281534
16 (397, 6) 19 281043 291405 PLPP2 281609
17 (397, 6) 19 281043 291405 PLPP2 281622
18 (397, 6) 19 281043 291405 PLPP2 281665
19 (397, 6) 19 281043 291405 PLPP2 281690
20 (397, 6) 19 281043 291405 PLPP2 281720
21 (397, 6) 19 281043 291405 PLPP2 281737
22 (397, 6) 19 281043 291405 PLPP2 281824
23 (397, 6) 19 281043 291405 PLPP2 281838
24 (397, 6) 19 281043 291405 PLPP2 281889
26 (397, 6) 19 281043 291405 PLPP2 281983
27 (397, 6) 19 281043 291405 PLPP2 281986
28 (397, 6) 19 281043 291405 PLPP2 282038
29 (397, 6) 19 281043 291405 PLPP2 282053
30 (397, 6) 19 281043 291405 PLPP2 282093
32 (397, 6) 19 281043 291405 PLPP2 282119
33 (397, 6) 19 281043 291405 PLPP2 282135
34 (397, 6) 19 281043 291405 PLPP2 282151
37 (397, 6) 19 281043 291405 PLPP2 282181
38 (397, 6) 19 281043 291405 PLPP2 282223
39 (397, 6) 19 281043 291405 PLPP2 282224
40 (397, 6) 19 281043 291405 PLPP2 282245
41 (397, 6) 19 281043 291405 PLPP2 282261
42 (397, 6) 19 281043 291405 PLPP2 282266
43 (397, 6) 19 281043 291405 PLPP2 282274
44 (397, 6) 19 281043 291405 PLPP2 282348
45 (397, 6) 19 281043 291405 PLPP2 282391
46 (397, 6) 19 281043 291405 PLPP2 282391
47 (397, 6) 19 281043 291405 PLPP2 282400
49 (397, 6) 19 281043 291405 PLPP2 282404
52 (397, 6) 19 281043 291405 PLPP2 282434
53 (397, 6) 19 281043 291405 PLPP2 282439
54 (397, 6) 19 281043 291405 PLPP2 282439
56 (397, 6) 19 281043 291405 PLPP2 282449
58 (397, 6) 19 281043 291405 PLPP2 282486
59 (397, 6) 19 281043 291405 PLPP2 282486
61 (397, 6) 19 281043 291405 PLPP2 282505
63 (397, 6) 19 281043 291405 PLPP2 282529
65 (397, 6) 19 281043 291405 PLPP2 282534
67 (397, 6) 19 281043 291405 PLPP2 282544
68 (397, 6) 19 281043 291405 PLPP2 282567
69 (397, 6) 19 281043 291405 PLPP2 282582
70 (397, 6) 19 281043 291405 PLPP2 282582
71 (397, 6) 19 281043 291405 PLPP2 282588
72 (397, 6) 19 281043 291405 PLPP2 282614
73 (397, 6) 19 281043 291405 PLPP2 282615
74 (397, 6) 19 281043 291405 PLPP2 282669
75 (397, 6) 19 281043 291405 PLPP2 282714
76 (397, 6) 19 281043 291405 PLPP2 282735
77 (397, 6) 19 281043 291405 PLPP2 282753
78 (397, 6) 19 281043 291405 PLPP2 282795
79 (397, 6) 19 281043 291405 PLPP2 282839
80 (397, 6) 19 281043 291405 PLPP2 282842
81 (397, 6) 19 281043 291405 PLPP2 282844
82 (397, 6) 19 281043 291405 PLPP2 282867
83 (397, 6) 19 281043 291405 PLPP2 282869
84 (397, 6) 19 281043 291405 PLPP2 282875
85 (397, 6) 19 281043 291405 PLPP2 282895
86 (397, 6) 19 281043 291405 PLPP2 283037
87 (397, 6) 19 281043 291405 PLPP2 283085
88 (397, 6) 19 281043 291405 PLPP2 283120
89 (397, 6) 19 281043 291405 PLPP2 283208
90 (397, 6) 19 281043 291405 PLPP2 283302
92 (397, 6) 19 281043 291405 PLPP2 283334
93 (397, 6) 19 281043 291405 PLPP2 283343
94 (397, 6) 19 281043 291405 PLPP2 283409
95 (397, 6) 19 281043 291405 PLPP2 283480
96 (397, 6) 19 281043 291405 PLPP2 283487
97 (397, 6) 19 281043 291405 PLPP2 283518
99 (397, 6) 19 281043 291405 PLPP2 283617
100 (397, 6) 19 281043 291405 PLPP2 283624
101 (397, 6) 19 281043 291405 PLPP2 283684
102 (397, 6) 19 281043 291405 PLPP2 283771
104 (397, 6) 19 281043 291405 PLPP2 283784
105 (397, 6) 19 281043 291405 PLPP2 283788
107 (397, 6) 19 281043 291405 PLPP2 283855
108 (397, 6) 19 281043 291405 PLPP2 283908
109 (397, 6) 19 281043 291405 PLPP2 283917
110 (397, 6) 19 281043 291405 PLPP2 283968
111 (397, 6) 19 281043 291405 PLPP2 284003
112 (397, 6) 19 281043 291405 PLPP2 284045
113 (397, 6) 19 281043 291405 PLPP2 284066
114 (397, 6) 19 281043 291405 PLPP2 284076
115 (397, 6) 19 281043 291405 PLPP2 284089
116 (397, 6) 19 281043 291405 PLPP2 284110
117 (397, 6) 19 281043 291405 PLPP2 284113
118 (397, 6) 19 281043 291405 PLPP2 284122
119 (397, 6) 19 281043 291405 PLPP2 284148
120 (397, 6) 19 281043 291405 PLPP2 284152
121 (397, 6) 19 281043 291405 PLPP2 284171
122 (397, 6) 19 281043 291405 PLPP2 284182
123 (397, 6) 19 281043 291405 PLPP2 284199
124 (397, 6) 19 281043 291405 PLPP2 284308
125 (397, 6) 19 281043 291405 PLPP2 284318
126 (397, 6) 19 281043 291405 PLPP2 284341
127 (397, 6) 19 281043 291405 PLPP2 284350
128 (397, 6) 19 281043 291405 PLPP2 284350
129 (397, 6) 19 281043 291405 PLPP2 284350
130 (397, 6) 19 281043 291405 PLPP2 284350
131 (397, 6) 19 281043 291405 PLPP2 284377
132 (397, 6) 19 281043 291405 PLPP2 284455
133 (397, 6) 19 281043 291405 PLPP2 284476
134 (397, 6) 19 281043 291405 PLPP2 284486
135 (397, 6) 19 281043 291405 PLPP2 284491
136 (397, 6) 19 281043 291405 PLPP2 284510
137 (397, 6) 19 281043 291405 PLPP2 284522
138 (397, 6) 19 281043 291405 PLPP2 284675
141 (397, 6) 19 281043 291405 PLPP2 284848
142 (397, 6) 19 281043 291405 PLPP2 284892
144 (397, 6) 19 281043 291405 PLPP2 284976
145 (397, 6) 19 281043 291405 PLPP2 285009
147 (397, 6) 19 281043 291405 PLPP2 285150
148 (397, 6) 19 281043 291405 PLPP2 285162
149 (397, 6) 19 281043 291405 PLPP2 285175
150 (397, 6) 19 281043 291405 PLPP2 285189
151 (397, 6) 19 281043 291405 PLPP2 285203
152 (397, 6) 19 281043 291405 PLPP2 285231
153 (397, 6) 19 281043 291405 PLPP2 285325
154 (397, 6) 19 281043 291405 PLPP2 285330
155 (397, 6) 19 281043 291405 PLPP2 285355
156 (397, 6) 19 281043 291405 PLPP2 285370
157 (397, 6) 19 281043 291405 PLPP2 285407
158 (397, 6) 19 281043 291405 PLPP2 285427
159 (397, 6) 19 281043 291405 PLPP2 285435
160 (397, 6) 19 281043 291405 PLPP2 285435
161 (397, 6) 19 281043 291405 PLPP2 285441
162 (397, 6) 19 281043 291405 PLPP2 285444
163 (397, 6) 19 281043 291405 PLPP2 285455
164 (397, 6) 19 281043 291405 PLPP2 285489
165 (397, 6) 19 281043 291405 PLPP2 285523
166 (397, 6) 19 281043 291405 PLPP2 285531
167 (397, 6) 19 281043 291405 PLPP2 285539
168 (397, 6) 19 281043 291405 PLPP2 285561
169 (397, 6) 19 281043 291405 PLPP2 285562
170 (397, 6) 19 281043 291405 PLPP2 285584
171 (397, 6) 19 281043 291405 PLPP2 285598
172 (397, 6) 19 281043 291405 PLPP2 285598
173 (397, 6) 19 281043 291405 PLPP2 285598
174 (397, 6) 19 281043 291405 PLPP2 285598
175 (397, 6) 19 281043 291405 PLPP2 285611
176 (397, 6) 19 281043 291405 PLPP2 285613
177 (397, 6) 19 281043 291405 PLPP2 285646
178 (397, 6) 19 281043 291405 PLPP2 285655
179 (397, 6) 19 281043 291405 PLPP2 285655
180 (397, 6) 19 281043 291405 PLPP2 285655
181 (397, 6) 19 281043 291405 PLPP2 285700
182 (397, 6) 19 281043 291405 PLPP2 285756
183 (397, 6) 19 281043 291405 PLPP2 285784
184 (397, 6) 19 281043 291405 PLPP2 285821
185 (397, 6) 19 281043 291405 PLPP2 285828
186 (397, 6) 19 281043 291405 PLPP2 285830
187 (397, 6) 19 281043 291405 PLPP2 285842
188 (397, 6) 19 281043 291405 PLPP2 285878
190 (397, 6) 19 281043 291405 PLPP2 285948
191 (397, 6) 19 281043 291405 PLPP2 286016
192 (397, 6) 19 281043 291405 PLPP2 286059
193 (397, 6) 19 281043 291405 PLPP2 286081
194 (397, 6) 19 281043 291405 PLPP2 286089
195 (397, 6) 19 281043 291405 PLPP2 286112
196 (397, 6) 19 281043 291405 PLPP2 286113
197 (397, 6) 19 281043 291405 PLPP2 286151
198 (397, 6) 19 281043 291405 PLPP2 286151
199 (397, 6) 19 281043 291405 PLPP2 286164
200 (397, 6) 19 281043 291405 PLPP2 286164
201 (397, 6) 19 281043 291405 PLPP2 286164
202 (397, 6) 19 281043 291405 PLPP2 286243
203 (397, 6) 19 281043 291405 PLPP2 286306
204 (397, 6) 19 281043 291405 PLPP2 286309
205 (397, 6) 19 281043 291405 PLPP2 286315
206 (397, 6) 19 281043 291405 PLPP2 286342
207 (397, 6) 19 281043 291405 PLPP2 286349
208 (397, 6) 19 281043 291405 PLPP2 286360
209 (397, 6) 19 281043 291405 PLPP2 286431
210 (397, 6) 19 281043 291405 PLPP2 286431
211 (397, 6) 19 281043 291405 PLPP2 286471
212 (397, 6) 19 281043 291405 PLPP2 286507
213 (397, 6) 19 281043 291405 PLPP2 286574
214 (397, 6) 19 281043 291405 PLPP2 286649
215 (397, 6) 19 281043 291405 PLPP2 286725
216 (397, 6) 19 281043 291405 PLPP2 286791
217 (397, 6) 19 281043 291405 PLPP2 286799
218 (397, 6) 19 281043 291405 PLPP2 286799
219 (397, 6) 19 281043 291405 PLPP2 286799
220 (397, 6) 19 281043 291405 PLPP2 286842
221 (397, 6) 19 281043 291405 PLPP2 286869
222 (397, 6) 19 281043 291405 PLPP2 286907
223 (397, 6) 19 281043 291405 PLPP2 286921
224 (397, 6) 19 281043 291405 PLPP2 286947
225 (397, 6) 19 281043 291405 PLPP2 287072
226 (397, 6) 19 281043 291405 PLPP2 287072
227 (397, 6) 19 281043 291405 PLPP2 287129
228 (397, 6) 19 281043 291405 PLPP2 287225
229 (397, 6) 19 281043 291405 PLPP2 287270
230 (397, 6) 19 281043 291405 PLPP2 287272
231 (397, 6) 19 281043 291405 PLPP2 287322
233 (397, 6) 19 281043 291405 PLPP2 287361
234 (397, 6) 19 281043 291405 PLPP2 287432
235 (397, 6) 19 281043 291405 PLPP2 287482
237 (397, 6) 19 281043 291405 PLPP2 287562
238 (397, 6) 19 281043 291405 PLPP2 287698
239 (397, 6) 19 281043 291405 PLPP2 287698
240 (397, 6) 19 281043 291405 PLPP2 287703
242 (397, 6) 19 281043 291405 PLPP2 287720
243 (397, 6) 19 281043 291405 PLPP2 287749
244 (397, 6) 19 281043 291405 PLPP2 287786
245 (397, 6) 19 281043 291405 PLPP2 287805
246 (397, 6) 19 281043 291405 PLPP2 287814
247 (397, 6) 19 281043 291405 PLPP2 287818
248 (397, 6) 19 281043 291405 PLPP2 287825
249 (397, 6) 19 281043 291405 PLPP2 287906
250 (397, 6) 19 281043 291405 PLPP2 287927
251 (397, 6) 19 281043 291405 PLPP2 287946
252 (397, 6) 19 281043 291405 PLPP2 287970
253 (397, 6) 19 281043 291405 PLPP2 288036
254 (397, 6) 19 281043 291405 PLPP2 288062
257 (397, 6) 19 281043 291405 PLPP2 288086
258 (397, 6) 19 281043 291405 PLPP2 288109
259 (397, 6) 19 281043 291405 PLPP2 288123
261 (397, 6) 19 281043 291405 PLPP2 288164
262 (397, 6) 19 281043 291405 PLPP2 288180
263 (397, 6) 19 281043 291405 PLPP2 288246
264 (397, 6) 19 281043 291405 PLPP2 288320
265 (397, 6) 19 281043 291405 PLPP2 288329
267 (397, 6) 19 281043 291405 PLPP2 288367
268 (397, 6) 19 281043 291405 PLPP2 288374
269 (397, 6) 19 281043 291405 PLPP2 288440
270 (397, 6) 19 281043 291405 PLPP2 288465
271 (397, 6) 19 281043 291405 PLPP2 288466
272 (397, 6) 19 281043 291405 PLPP2 288467
273 (397, 6) 19 281043 291405 PLPP2 288491
275 (397, 6) 19 281043 291405 PLPP2 288578
276 (397, 6) 19 281043 291405 PLPP2 288620
277 (397, 6) 19 281043 291405 PLPP2 288633
279 (397, 6) 19 281043 291405 PLPP2 288677
280 (397, 6) 19 281043 291405 PLPP2 288690
281 (397, 6) 19 281043 291405 PLPP2 288730
282 (397, 6) 19 281043 291405 PLPP2 288738
284 (397, 6) 19 281043 291405 PLPP2 288771
285 (397, 6) 19 281043 291405 PLPP2 288786
286 (397, 6) 19 281043 291405 PLPP2 288799
287 (397, 6) 19 281043 291405 PLPP2 288800
288 (397, 6) 19 281043 291405 PLPP2 288808
289 (397, 6) 19 281043 291405 PLPP2 288833
290 (397, 6) 19 281043 291405 PLPP2 288837
291 (397, 6) 19 281043 291405 PLPP2 288881
292 (397, 6) 19 281043 291405 PLPP2 288885
293 (397, 6) 19 281043 291405 PLPP2 288929
294 (397, 6) 19 281043 291405 PLPP2 288965
295 (397, 6) 19 281043 291405 PLPP2 288970
296 (397, 6) 19 281043 291405 PLPP2 288980
297 (397, 6) 19 281043 291405 PLPP2 289014
298 (397, 6) 19 281043 291405 PLPP2 289040
299 (397, 6) 19 281043 291405 PLPP2 289047
300 (397, 6) 19 281043 291405 PLPP2 289116
302 (397, 6) 19 281043 291405 PLPP2 289190
303 (397, 6) 19 281043 291405 PLPP2 289244
304 (397, 6) 19 281043 291405 PLPP2 289255
305 (397, 6) 19 281043 291405 PLPP2 289282
306 (397, 6) 19 281043 291405 PLPP2 289294
307 (397, 6) 19 281043 291405 PLPP2 289311
308 (397, 6) 19 281043 291405 PLPP2 289342
309 (397, 6) 19 281043 291405 PLPP2 289364
310 (397, 6) 19 281043 291405 PLPP2 289374
311 (397, 6) 19 281043 291405 PLPP2 289396
312 (397, 6) 19 281043 291405 PLPP2 289397
313 (397, 6) 19 281043 291405 PLPP2 289399
314 (397, 6) 19 281043 291405 PLPP2 289457
315 (397, 6) 19 281043 291405 PLPP2 289464
316 (397, 6) 19 281043 291405 PLPP2 289464
317 (397, 6) 19 281043 291405 PLPP2 289464
318 (397, 6) 19 281043 291405 PLPP2 289491
319 (397, 6) 19 281043 291405 PLPP2 289498
320 (397, 6) 19 281043 291405 PLPP2 289516
321 (397, 6) 19 281043 291405 PLPP2 289527
322 (397, 6) 19 281043 291405 PLPP2 289532
323 (397, 6) 19 281043 291405 PLPP2 289547
324 (397, 6) 19 281043 291405 PLPP2 289580
325 (397, 6) 19 281043 291405 PLPP2 289595
326 (397, 6) 19 281043 291405 PLPP2 289656
327 (397, 6) 19 281043 291405 PLPP2 289657
328 (397, 6) 19 281043 291405 PLPP2 289661
329 (397, 6) 19 281043 291405 PLPP2 289681
330 (397, 6) 19 281043 291405 PLPP2 289692
331 (397, 6) 19 281043 291405 PLPP2 289708
332 (397, 6) 19 281043 291405 PLPP2 289708
333 (397, 6) 19 281043 291405 PLPP2 289725
334 (397, 6) 19 281043 291405 PLPP2 289754
335 (397, 6) 19 281043 291405 PLPP2 289763
336 (397, 6) 19 281043 291405 PLPP2 289805
337 (397, 6) 19 281043 291405 PLPP2 289857
338 (397, 6) 19 281043 291405 PLPP2 289877
339 (397, 6) 19 281043 291405 PLPP2 289895
340 (397, 6) 19 281043 291405 PLPP2 289902
341 (397, 6) 19 281043 291405 PLPP2 289918
342 (397, 6) 19 281043 291405 PLPP2 289919
343 (397, 6) 19 281043 291405 PLPP2 289922
344 (397, 6) 19 281043 291405 PLPP2 289923
345 (397, 6) 19 281043 291405 PLPP2 289946
347 (397, 6) 19 281043 291405 PLPP2 289987
348 (397, 6) 19 281043 291405 PLPP2 290013
349 (397, 6) 19 281043 291405 PLPP2 290013
350 (397, 6) 19 281043 291405 PLPP2 290024
351 (397, 6) 19 281043 291405 PLPP2 290050
352 (397, 6) 19 281043 291405 PLPP2 290083
353 (397, 6) 19 281043 291405 PLPP2 290090
354 (397, 6) 19 281043 291405 PLPP2 290095
355 (397, 6) 19 281043 291405 PLPP2 290108
356 (397, 6) 19 281043 291405 PLPP2 290112
357 (397, 6) 19 281043 291405 PLPP2 290157
358 (397, 6) 19 281043 291405 PLPP2 290203
359 (397, 6) 19 281043 291405 PLPP2 290239
360 (397, 6) 19 281043 291405 PLPP2 290305
361 (397, 6) 19 281043 291405 PLPP2 290307
362 (397, 6) 19 281043 291405 PLPP2 290355
363 (397, 6) 19 281043 291405 PLPP2 290380
364 (397, 6) 19 281043 291405 PLPP2 290440
365 (397, 6) 19 281043 291405 PLPP2 290466
366 (397, 6) 19 281043 291405 PLPP2 290470
367 (397, 6) 19 281043 291405 PLPP2 290472
368 (397, 6) 19 281043 291405 PLPP2 290539
369 (397, 6) 19 281043 291405 PLPP2 290614
370 (397, 6) 19 281043 291405 PLPP2 290620
371 (397, 6) 19 281043 291405 PLPP2 290642
372 (397, 6) 19 281043 291405 PLPP2 290676
373 (397, 6) 19 281043 291405 PLPP2 290719
374 (397, 6) 19 281043 291405 PLPP2 290760
375 (397, 6) 19 281043 291405 PLPP2 290766
376 (397, 6) 19 281043 291405 PLPP2 290805
378 (397, 6) 19 281043 291405 PLPP2 290841
379 (397, 6) 19 281043 291405 PLPP2 290841
380 (397, 6) 19 281043 291405 PLPP2 290865
381 (397, 6) 19 281043 291405 PLPP2 290886
382 (397, 6) 19 281043 291405 PLPP2 290898
383 (397, 6) 19 281043 291405 PLPP2 290947
384 (397, 6) 19 281043 291405 PLPP2 290961
385 (397, 6) 19 281043 291405 PLPP2 290979
386 (397, 6) 19 281043 291405 PLPP2 290990
387 (397, 6) 19 281043 291405 PLPP2 291126
388 (397, 6) 19 281043 291405 PLPP2 291181
389 (397, 6) 19 281043 291405 PLPP2 291184
390 (397, 6) 19 281043 291405 PLPP2 291192
391 (397, 6) 19 281043 291405 PLPP2 291197
392 (397, 6) 19 281043 291405 PLPP2 291232
393 (397, 6) 19 281043 291405 PLPP2 291343
394 (397, 6) 19 281043 291405 PLPP2 291352
395 (397, 6) 19 281043 291405 PLPP2 291365
396 (397, 6) 19 281043 291405 PLPP2 291404
0
{% endraw %} {% raw %}
maker.apply(data)
Family 28_9 (12 bits) -  Singlepoint:  53%                    
0
                                                                      
{% endraw %} {% raw %}
data
{'1036_3': [('6', '7')],
 '1036_2': [('3', '0')],
 '1036_1': [('9', '0')],
 '1036_5': [('8', '1')],
 '1036_99': [('3', '9')],
 '1036_6': [('2', '5')],
 '1036_4': [('3', '4')],
 '22_1_20': [('9', '4')],
 '22_1_10': [('11', '14')],
 '22_1_99': [('7', '10')],
 '22_1_5': [('2', '3')],
 '22_1_4': [('8', '5')],
 '22_1_2': [('1', '13')],
 '22_1_3': [('6', '12')],
 '28_9_100': [('1', '4')],
 '28_9_103': [('1', '4')],
 '28_9_110': [('4', '2')],
 '28_9_114': [('4', '4')],
 '28_9_105': [('1', '5')],
 '28_9_111': [('1', '2')],
 '28_9_109': [('4', '3')],
 '28_9_108': [('1', '2')],
 '28_9_106': [('4', '5')],
 '28_9_101': [('4', '5')],
 '28_9_186': [('2', '3')]}
{% endraw %} {% raw %}
data.maf
OrderedDict([('1036', ((1.0,),)), ('22_1', ((1.0,),)), ('28_9', ((1.0,),))])
{% endraw %} {% raw %}
haplotypes = OrderedDict()
mafs = {}   ##Per fam per variant
varnames = {}
{% endraw %}

maker._MarkerMaker__Haplotype(data, haplotypes, mafs, varnames)

{% raw %}
import pandas as pd
new_trim_ped = pd.read_csv('../data/new_trim_ped.csv')
tmp = new_trim_ped.fid.value_counts()
tmp.index
{% endraw %} {% raw %}
tmp[tmp<=24]
25_7:0       24
10R_R57:0    24
27_131:0     24
285:0        23
10R_R95:0    23
             ..
4_3832:0      4
4_3758:1      4
990:0         4
3761:5        3
216:2         3
Name: fid, Length: 578, dtype: int64
{% endraw %} {% raw %}
items = list(tmp[tmp<=24].index)
items.remove('10R_R114:0')
items.remove('10R_R57:0')
{% endraw %} {% raw %}
new_trim_ped[new_trim_ped.fid.isin(items[10:15])]
fid iid fathid mothid sex ad vcf depth trim tag
1559 257:0 257_1 0 0 1 -9 False 1 False 257:0
1560 257:0 257_27 257_21 257_5 1 1 True 3 False 257:0
1561 257:0 257_41 257_21 257_5 2 1 True 3 False 257:0
1562 257:0 257_28 257_21 257_5 1 1 True 3 False 257:0
1563 257:0 257_22 257_21 257_5 1 2 True 3 False 257:0
... ... ... ... ... ... ... ... ... ... ...
4519 694:0 694_9 694_1 694_2 1 2 False 2 False 694:0
4520 694:0 694_1 0 0 1 -9 False 1 False 694:0
4521 694:0 694_2 0 0 2 -9 False 1 False 694:0
4522 694:0 694_25 0 0 1 -9 False 1 False 694:0
4523 694:0 694_11 694_1 694_2 1 2 True 2 False 694:0

101 rows × 10 columns

{% endraw %}

4.2 Debug of failing to phase haplotypes(10R_R114:0)

remove the children without vcf

{% raw %}
data.tfam.families['10R_R114:0'].remove('10R_R114_10')
data.tfam.families['10R_R114:0'].remove('10R_R114_11')
#data.tfam.families['10R_R114:0'].remove('10R_R114_6')
#data.tfam.families['10R_R114:0'].remove('10R_R114_8')
{% endraw %} {% raw %}
data.tfam.families_sorted['10R_R114:0'].remove('10R_R114_10')
data.tfam.families_sorted['10R_R114:0'].remove('10R_R114_11')
#data.tfam.families_sorted['10R_R114:0'].remove('10R_R114_6')
#data.tfam.families_sorted['10R_R114:0'].remove('10R_R114_8')
{% endraw %} {% raw %}
for item in ['10R_R114:0','10R_R57:0']:
    varnames[item], positions, vcf_mafs = data.getFamVariants(item, style = "map")
    if len(varnames[item]) == 0:
        print('here')
        for person in data.families[item]:
            data[person] = maker.missings
    print(pd.DataFrame(data.getFamSamples(item)))
            0            1           2           3  4   5   6   7   8   9   \
0   10R_R114:0   10R_R114_2           0           0  1  00  00  00  00  00   
1   10R_R114:0   10R_R114_3           0           0  2  00  00  00  00  00   
2   10R_R114:0  10R_R114_42  10R_R114_2  10R_R114_3  2  11  11  11  11  11   
3   10R_R114:0  10R_R114_16  10R_R114_2  10R_R114_3  1  12  11  12  11  12   
4   10R_R114:0   10R_R114_1  10R_R114_2  10R_R114_3  2  12  11  11  12  12   
5   10R_R114:0   10R_R114_4  10R_R114_2  10R_R114_3  2  11  11  12  12  11   
6   10R_R114:0   10R_R114_9  10R_R114_2  10R_R114_3  2  11  12  12  11  12   
7   10R_R114:0  10R_R114_12  10R_R114_2  10R_R114_3  2  12  11  12  11  12   
8   10R_R114:0  10R_R114_14  10R_R114_2  10R_R114_3  2  11  11  12  11  11   
9   10R_R114:0  10R_R114_18  10R_R114_2  10R_R114_3  2  11  11  12  11  12   
10  10R_R114:0  10R_R114_15  10R_R114_2  10R_R114_3  1  11  11  12  11  12   
11  10R_R114:0   10R_R114_5  10R_R114_2  10R_R114_3  2  11  11  12  11  12   
12  10R_R114:0  10R_R114_20  10R_R114_2  10R_R114_3  2  11  11  12  11  12   
13  10R_R114:0   10R_R114_6  10R_R114_2  10R_R114_3  2  00  00  00  00  00   
14  10R_R114:0   10R_R114_8  10R_R114_2  10R_R114_3  2  00  00  00  00  00   

    ...  36  37  38  39  40  41  42  43  44  45  
0   ...  00  00  00  00  00  00  00  00  00  00  
1   ...  00  00  00  00  00  00  00  00  00  00  
2   ...  11  11  11  11  11  11  12  11  12  00  
3   ...  12  12  11  12  11  12  11  12  12  00  
4   ...  11  11  12  11  11  12  11  12  12  11  
5   ...  11  11  11  11  12  12  11  12  12  00  
6   ...  11  11  11  11  11  11  11  11  11  11  
7   ...  00  00  00  11  11  00  11  11  12  00  
8   ...  11  11  11  11  11  11  12  11  11  00  
9   ...  12  12  11  11  11  12  11  12  11  11  
10  ...  12  12  11  11  11  12  12  12  11  12  
11  ...  11  11  11  11  11  11  11  11  12  00  
12  ...  12  12  11  11  11  12  11  12  11  00  
13  ...  00  00  00  00  00  00  00  00  00  00  
14  ...  00  00  00  00  00  00  00  00  00  00  

[15 rows x 46 columns]
           0           1           2           3  4   5   6   7   8   9   ...  \
0   10R_R57:0   10R_R57_3           0           0  2  00  00  00  00  00  ...   
1   10R_R57:0  10R_R57_41           0           0  2  00  00  00  00  00  ...   
2   10R_R57:0   10R_R57_4           0           0  1  00  00  00  00  00  ...   
3   10R_R57:0  10R_R57_10   10R_R57_4   10R_R57_3  1  11  11  11  12  12  ...   
4   10R_R57:0  10R_R57_14   10R_R57_4   10R_R57_3  1  00  00  00  00  00  ...   
5   10R_R57:0  10R_R57_43  10R_R57_14  10R_R57_41  2  11  11  11  11  11  ...   
6   10R_R57:0  10R_R57_15   10R_R57_4   10R_R57_3  2  11  11  11  11  11  ...   
7   10R_R57:0  10R_R57_19   10R_R57_4   10R_R57_3  1  11  11  11  11  11  ...   
8   10R_R57:0  10R_R57_13   10R_R57_4   10R_R57_3  2  00  00  00  00  00  ...   
9   10R_R57:0   10R_R57_6   10R_R57_4   10R_R57_3  2  00  00  00  00  00  ...   
10  10R_R57:0   10R_R57_7   10R_R57_4   10R_R57_3  2  00  00  00  00  00  ...   
11  10R_R57:0  10R_R57_16   10R_R57_4   10R_R57_3  1  12  11  11  12  12  ...   
12  10R_R57:0   10R_R57_1   10R_R57_4   10R_R57_3  2  11  11  11  11  11  ...   
13  10R_R57:0  10R_R57_12   10R_R57_4   10R_R57_3  2  11  11  11  12  12  ...   
14  10R_R57:0  10R_R57_38           0           0  1  00  00  00  00  00  ...   
15  10R_R57:0  10R_R57_40  10R_R57_38   10R_R57_6  2  11  11  11  12  11  ...   
16  10R_R57:0  10R_R57_36           0           0  1  00  00  00  00  00  ...   
17  10R_R57:0  10R_R57_37  10R_R57_36  10R_R57_13  1  11  12  11  11  11  ...   
18  10R_R57:0  10R_R57_24           0           0  2  00  00  00  00  00  ...   
19  10R_R57:0  10R_R57_25  10R_R57_10  10R_R57_24  1  11  12  11  11  11  ...   
20  10R_R57:0  10R_R57_28  10R_R57_10  10R_R57_24  2  11  11  11  12  11  ...   
21  10R_R57:0  10R_R57_29  10R_R57_10  10R_R57_24  2  11  12  12  11  11  ...   
22  10R_R57:0  10R_R57_30           0           0  1  00  00  00  00  00  ...   
23  10R_R57:0  10R_R57_32  10R_R57_30   10R_R57_7  2  11  11  11  12  11  ...   

    40  41  42  43  44  45  46  47  48  49  
0   00  00  00  00  00  00  00  00  00  00  
1   00  00  00  00  00  00  00  00  00  00  
2   00  00  00  00  00  00  00  00  00  00  
3   11  11  11  11  11  11  12  12  12  11  
4   00  00  00  00  00  00  00  00  00  00  
5   11  12  12  11  11  11  12  12  11  11  
6   11  11  11  11  11  11  12  12  12  12  
7   11  12  11  11  11  11  11  12  11  11  
8   00  00  00  00  00  00  00  00  00  00  
9   00  00  00  00  00  00  00  00  00  00  
10  00  00  00  00  00  00  00  00  00  00  
11  11  11  11  11  11  12  12  22  12  11  
12  11  11  11  11  11  12  11  11  11  11  
13  11  11  11  12  12  12  12  12  12  11  
14  00  00  00  00  00  00  00  00  00  00  
15  12  12  12  11  11  12  12  12  12  11  
16  00  00  00  00  00  00  00  00  00  00  
17  12  12  12  11  12  11  12  12  12  11  
18  00  00  00  00  00  00  00  00  00  00  
19  11  11  11  11  11  12  11  12  12  11  
20  11  11  11  11  11  12  11  11  11  12  
21  12  12  12  11  11  11  12  12  12  11  
22  00  00  00  00  00  00  00  00  00  00  
23  11  11  11  12  11  11  11  11  11  11  

[24 rows x 50 columns]
{% endraw %}

4.3 write out the input of haplotyper

4.3.1 10R_R114:0 family

{% raw %}
item = '10R_R114:0'
#for item in data.families:
print('running family',item)
varnames[item], positions, vcf_mafs = data.getFamVariants(item, style = "map")
a1 = [data.chrom, varnames[item], sorted(positions), data.getFamSamples(item), maker.rsq]
import pickle
with open('../data/test_haplotyper_10R_R114:0_removed2.pickle', 'wb') as handle:
    pickle.dump(a1, handle, protocol=pickle.HIGHEST_PROTOCOL)
running family 10R_R114:0
{% endraw %}

4.3.2 all families

{% raw %}
varnames,positions,vcf_mafs,geno = {},{},{},{}
for item in data.families:
    varnames[item], positions[item], vcf_mafs[item] = data.getFamVariants(item, style = "map")
    geno[item] = data.getFamSamples(item)
a1 = [varnames, positions, vcf_mafs,geno]
import pickle
with open('../data/test_haplotyper_all_families.pickle', 'wb') as handle:
    pickle.dump(a1, handle, protocol=pickle.HIGHEST_PROTOCOL)
{% endraw %} {% raw %}
len(varnames.keys())
587
{% endraw %} {% raw %}
item = '10R_R114:0'
#for item in data.families:
print('running family',item)
varnames[item], positions, vcf_mafs = data.getFamVariants(item, style = "map")
if len(varnames[item]) == 0:
    print('here')
    for person in data.families[item]:
        data[person] = maker.missings
else:
    print(varnames[item])
    tmp_log_output=env.tmp_log + str(os.getpid())
    maker.haplotyper.Execute(data.chrom, varnames[item], sorted(positions), data.getFamSamples(item), maker.rsq, tmp_log_output)
{% endraw %} {% raw %}
item
'530:0'
{% endraw %} {% raw %}
data.getFamSamples(item)
[['10J_109:0', '10J_109_5', '0', '0', '2', '00', '00'],
 ['10J_109:0', '10J_109_6', '0', '0', '1', '00', '00'],
 ['10J_109:0', '10J_109_1', '10J_109_6', '10J_109_5', '1', '22', '12'],
 ['10J_109:0', '10J_109_4', '10J_109_6', '10J_109_5', '1', '11', '11'],
 ['10J_109:0', '10J_109_3', '10J_109_6', '10J_109_5', '1', '00', '00'],
 ['10J_109:0', '10J_109_2', '10J_109_6', '10J_109_5', '1', '00', '00'],
 ['10J_109:0', '10J_109_7', '10J_109_6', '10J_109_5', '1', '11', '11']]
{% endraw %} {% raw %}
if all(vcf_mafs):
    for idx, v in enumerate(varnames[item]):
        if v not in mafs:
            mafs[v] = vcf_mafs[idx]
{% endraw %} {% raw %}
if len(varnames):
    if not any ([len(varnames[x]) - 1 for x in varnames]):
        # all families have only one variant
        self.__AssignSNVHaplotypes(data, haplotypes, mafs, varnames)
    else:
        # calculate LD clusters using founder haplotypes
        #clusters = self.__ClusterByLD(data, haplotypes, varnames)
        clusters=[]
        #print('clusters:',clusters)
        # recoding the genotype of the region
        env.dtest[self.name]['coder']['input'] = [data.copy(), haplotypes, mafs, varnames, clusters]
        self.__CodeHaplotypes(data, haplotypes, mafs, varnames, clusters)
        env.dtest[self.name]['coder']['output'] = [self.coder.GetHaplotypes(),data.copy(),data.superMarkerCount,deepcopy(data.maf)]
#except Exception as e:
#    return -1
self.__FormatHaplotypes(data)
{% endraw %} {% raw %}
self.markers = ["V{}-{}".format(idx, item[1]) for idx, item in enumerate(data.variants)]
for item in data.families:
    varnames[item], positions, vcf_mafs = data.getFamVariants(item, style = "map")
    if len(varnames[item]) == 0:
        for person in data.families[item]:
            data[person] = self.missings
        continue
    if env.debug:
        with env.lock:
            sys.stderr.write('\n'.join(['\t'.join(x) for x in data.getFamSamples(item)]) + '\n\n')
    # haplotyping
    with env.lock:
        if not env.prephased:
            #with stdoutRedirect(to = env.tmp_log + str(os.getpid()) + '.log'):
            #    haplotypes[item] = self.haplotyper.Execute(data.chrom, varnames[item],
            #                                           sorted(positions), data.getFamSamples(item))[0]
            tmp_log_output=env.tmp_log + str(os.getpid())
            #with stdoutRedirect(to = tmp_log_output + '.log'):
            haplotypes[item] = self.haplotyper.Execute(data.chrom, varnames[item], sorted(positions),
                                                           data.getFamSamples(item), self.rsq, tmp_log_output)[0]

        else:
            haplotypes[item] = self.__PedToHaplotype(data.getFamSamples(item))
    if len(haplotypes[item]) == 0:
        # C++ haplotyping implementation failed
        with env.chperror_counter.get_lock():
            env.chperror_counter.value += 1
    # either use privided MAF or computer MAF
    if all(vcf_mafs):
        for idx, v in enumerate(varnames[item]):
            if v not in mafs:
                mafs[v] = vcf_mafs[idx]
    else:
        # count founder alleles
        for hap in haplotypes[item]:
            if not data.tfam.is_founder(hap[1]):
                continue
            for idxv, v in enumerate(varnames[item]):
                if v not in mafs:
                    # [#alt, #haplotypes]
                    mafs[v] = [0, 0]
                gt = hap[2 + idxv][1] if hap[2 + idxv][0].isupper() else hap[2 + idxv][0]
                if not gt == "?":
                    mafs[v][0] += self.gtconv[gt]
                    mafs[v][1] += 1.0
#
{% endraw %} {% raw %}
maker._MarkerMaker__Haplotype(data, haplotypes, mafs, varnames)
{% endraw %}

Test3

{% raw %}
    if env.triallelic_counter.value:
        env.log('{:,d} tri-allelic loci were ignored'.format(env.triallelic_counter.value))
    if env.commonvar_counter.value:
        env.log('{:,d} variants ignored due to having MAF > {} and other specified constraints'.\
                format(env.commonvar_counter.value, args.maf_cutoff))
    if env.null_counter.value:
        env.log('{:,d} units ignored due to absence in VCF file'.format(env.null_counter.value))
    if env.trivial_counter.value:
        env.log('{:,d} units ignored due to absence of variation in samples'.format(env.trivial_counter.value))
MESSAGE: 1 units ignored due to absence in VCF file
{% endraw %} {% raw %}
fatal_errors = 0
try:
    # Error msg from C++ extension
    os.system("cat {}/*.* > {}".format(env.tmp_dir, env.tmp_log))
    fatal_errors = wordCount(env.tmp_log)['fatal']
except KeyError:
    pass
if env.chperror_counter.value:
    env.error("{:,d} regional markers failed to be generated due to haplotyping failures!".\
              format(env.chperror_counter.value))
if fatal_errors:
    env.error("{:,d} or more regional markers failed to be generated due to runtime errors!".\
              format(fatal_errors))
env.log('Archiving regional marker data to directory [{}]'.format(env.cache_dir))
cache.write(arcroot = 'CACHE', source_dir = env.tmp_cache)
env.jobs = args.jobs
cat: './seqlinkage-example/tmprst/SEQLinkage_tmp_wk92qcpq/*.*': No such file or directory
MESSAGE: Archiving regional marker data to directory [./seqlinkage-example/cache]
{% endraw %} {% raw %}
env.tmp_cache
'./seqlinkage-example/tmprst/SEQLinkage_tmp_wk92qcpq/CACHE'
{% endraw %} {% raw %}
os.listdir(env.tmp_cache)
['tsq20211129.chr1.freq', 'tsq20211129.chr1.tped', 'tsq20211129.tfam']
{% endraw %} {% raw %}
env.jobs
16
{% endraw %} {% raw %}
env.tmp_cache
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
/tmp/2206534.1.plot.q/ipykernel_985/4167063990.py in <module>
----> 1 env.tmp_cache

NameError: name 'env' is not defined
{% endraw %} {% raw %}
tpeds = [os.path.join(env.tmp_cache, item) for item in os.listdir(env.tmp_cache) if item.startswith(env.output) and item.endswith('.tped')]
for fmt in args.format:
    cache.setID(fmt)
    if not args.vanilla and cache.check():
        env.log('Loading {} data from archive ...'.format(fmt.upper()))
        cache.load(target_dir = env.tmp_dir, names = [fmt.upper()])
    else:
        env.log('{:,d} units will be converted to {} format'.format(env.success_counter.value, fmt.upper()))
        env.format_counter.value = 0
        format(tpeds, os.path.join(env.tmp_cache, "{}.tfam".format(env.output)),
               args.prevalence, args.wild_pen, args.muta_pen, fmt,
               args.inherit_mode, args.theta_max, args.theta_inc)
        env.log('{:,d} units successfully converted to {} format\n'.\
                format(env.format_counter.value, fmt.upper()), flush = True)
        if env.skipped_counter.value:
            # FIXME: perhaps we need to rephrase this message?
            env.log('{} region - family pairs skipped'.\
                    format(env.skipped_counter.value))
        env.log('Archiving {} format to directory [{}]'.format(fmt.upper(), env.cache_dir))
        cache.write(arcroot = fmt.upper(),
                    source_dir = os.path.join(env.tmp_dir, fmt.upper()), mode = 'a')
mkpath(env.outdir)
MESSAGE: 2 units will be converted to MERLIN format
16
16
MESSAGE: 1 units successfully converted to MERLIN format
MESSAGE: Archiving MERLIN format to directory [./seqlinkage-example/cache]
MESSAGE: 2 units will be converted to LINKAGE format
MESSAGE: 1 units successfully converted to LINKAGE format
MESSAGE: Archiving LINKAGE format to directory [./seqlinkage-example/cache]
{% endraw %}

2. Testing run_linkage

{% raw %}
args.run_linkage = True
{% endraw %} {% raw %}
cache.setID('analysis')
{% endraw %} {% raw %}
env.output
'LINKAGE'
{% endraw %} {% raw %}
?cache.load
Signature: cache.load(target_dir=None, names=None)
Docstring: <no docstring>
File:      /mnt/mfs/statgen/yin/Github/linkage/SEQpy3/SEQLinkage/Utils.py
Type:      method
{% endraw %} {% raw %}
cache.cache_name
'/mnt/mfs/statgen/yin/Github/linkage/SEQpy3/cache/LINKAGE.cache'
{% endraw %} {% raw %}
not args.vanilla and cache.check()
False
{% endraw %} {% raw %}
fmt = args.format[0]
{% endraw %} {% raw %}
args.blueprint
'data/genemap.hg38.txt'
{% endraw %} {% raw %}
args.theta_inc
0.05
{% endraw %} {% raw %}
args.theta_max
0.5
{% endraw %} {% raw %}
args.output_limit
10
{% endraw %} {% raw %}
if args.run_linkage:
    cache.setID('analysis')
    if not args.vanilla and cache.check():
        env.log('Loading linkage analysis result from archive ...'.format(fmt.upper()))
        cache.load(target_dir = env.output, names = ['heatmap'])
    else:
        env.log('Running linkage analysis ...'.format(fmt.upper()))
        run_linkage(args.blueprint, args.theta_inc, args.theta_max, args.output_limit)
        env.log('Linkage analysis succesfully performed for {:,d} units\n'.\
                format(env.run_counter.value, fmt.upper()), flush = True)
        if env.makeped_counter.value:
            env.log('{} "makeped" runtime errors occurred'.format(env.makeped_counter.value))
        if env.pedcheck_counter.value:
            env.log('{} "pedcheck" runtime errors occurred'.format(env.pedcheck_counter.value))
        if env.unknown_counter.value:
            env.log('{} "unknown" runtime errors occurred'.format(env.unknown_counter.value))
        if env.mlink_counter.value:
            env.log('{} "mlink" runtime errors occurred'.format(env.mlink_counter.value))
        cache.write(arcroot = 'heatmap', source_dir = os.path.join(env.output, 'heatmap'), mode = 'a')
    html(args.theta_inc, args.theta_max, args.output_limit)
else:
    env.log('Saving data to [{}]'.format(os.path.abspath(env.output)))
    cache.load(target_dir = env.output, names = [fmt.upper() for fmt in args.format])
MESSAGE: Running linkage analysis ...
MESSAGE: Linkage analysis succesfully performed for 1 units
MESSAGE: 2 "pedcheck" runtime errors occurred
MESSAGE: Report for [tsq20211129] is generated in HTML format
{% endraw %} {% raw %}
    env.log('Saving data to [{}]'.format(os.path.abspath(env.output)))
    cache.load(target_dir = env.output, names = [fmt.upper() for fmt in args.format])
MESSAGE: Saving data to [/mnt/mfs/statgen/yin/Github/linkage/SEQpy2/testseqlink]
{% endraw %}

Testing main

{% raw %}
if args.no_save:
    cache = NoCache()
else:
    cache = Cache(env.cache_dir, env.output, vars(args))
cache.setID('vcf')
# STEP 1: write encoded data to TPED format
if not args.vanilla and cache.check():
    env.log('Loading regional marker data from archive ...')
    cache.load(target_dir = env.tmp_dir, names = ['CACHE'])
    env.success_counter.value = sum(map(fileLinesCount, glob.glob('{}/*.tped'.format(env.tmp_cache))))
    env.batch = 10
else:
    # load VCF file header
    checkVCFBundle(args.vcf)
    cache.clear()
    try:
        vs = cstatgen.VCFstream(args.vcf)
    except Exception as e:
        env.error("{}".format(e), exit = True)
    samples_vcf = vs.GetSampleNames()
    if len(samples_vcf) == 0:
        env.error("Fail to extract samples from [{}]".format(args.vcf), exit = True)
    env.log('{:,d} samples found in [{}]'.format(len(samples_vcf), args.vcf))
    samples_not_vcf = checkSamples(samples_vcf, getColumn(args.tfam, 2))[1]
    # load sample info
    data = RData(samples_vcf, TFAMParser(args.tfam))
    if len(data.families) == 0:
        env.error('No valid family to process. ' \
                  'Families have to be at least trio with at least one member in VCF file.', exit = True)
    if len(data.samples) == 0:
        env.error('No valid sample to process. ' \
                  'Samples have to be in families, and present in both TFAM and VCF files.', exit = True)
    rewriteFamfile(os.path.join(env.tmp_cache, '{}.tfam'.format(env.output)),
                   data.tfam.samples, list(data.samples.keys()) + samples_not_vcf)
    if args.single_markers:
        regions = [(x[0], x[1], x[1], "{}:{}".format(x[0], x[1]), '.', '.', '.')
                   for x in vs.GetGenomeCoordinates()]
        args.blueprint = None
    else:
        # load blueprint
        try:
            env.log('Loading marker map from [{}] ...'.format(args.blueprint))
            with open(args.blueprint, 'r') as f:
                regions = [x.strip().split() for x in f.readlines()]
        except IOError:
            env.error("Cannot load regional marker blueprint [{}]. ".format(args.blueprint), exit = True)
    env.log('{:,d} families with a total of {:,d} samples will be scanned for {:,d} pre-defined units'.\
            format(len(data.families), len(data.samples), len(regions)))
    env.jobs = max(min(args.jobs, len(regions)), 1)
    regions.extend([None] * env.jobs)
    queue = Queue()
    try:
        faulthandler.enable(file=open(env.tmp_log + '.SEGV', 'w'))
        for i in regions:
            queue.put(i)
        jobs = [EncoderWorker(
            queue, len(regions), deepcopy(data),
            RegionExtractor(args.vcf, chr_prefix = args.chr_prefix, allele_freq_info = args.freq),
            MarkerMaker(args.bin, maf_cutoff = args.maf_cutoff),
            LinkageWriter(len(samples_not_vcf))
            ) for i in range(env.jobs)]
        for j in jobs:
            j.start()
        for j in jobs:
            j.join()
        faulthandler.disable()
    except KeyboardInterrupt:
        # FIXME: need to properly close all jobs
        raise ValueError("Use 'killall {}' to properly terminate all processes!".format(env.prog))
    else:
        env.log('{:,d} units (from {:,d} variants) processed; '\
            '{:,d} Mendelian inconsistencies and {:,d} recombination events handled\n'.\
            format(env.success_counter.value,
                   env.variants_counter.value,
                   env.mendelerror_counter.value,
                   env.recomb_counter.value), flush = True)
        if env.triallelic_counter.value:
            env.log('{:,d} tri-allelic loci were ignored'.format(env.triallelic_counter.value))
        if env.commonvar_counter.value:
            env.log('{:,d} variants ignored due to having MAF > {}'.\
                    format(env.commonvar_counter.value, args.maf_cutoff))
        if env.null_counter.value:
            env.log('{:,d} units ignored due to absence in VCF file'.format(env.null_counter.value))
        if env.trivial_counter.value:
            env.log('{:,d} units ignored due to absence of variation in samples'.format(env.trivial_counter.value))
        fatal_errors = 0
        try:
            # Error msg from C++ extension
            os.system("cat {}/*.* > {}".format(env.tmp_dir, env.tmp_log))
            fatal_errors = wordCount(env.tmp_log)['fatal']
        except KeyError:
            pass
        if env.chperror_counter.value:
            env.error("{:,d} regional markers failed to be generated due to haplotyping failures!".\
                      format(env.chperror_counter.value))
        if fatal_errors:
            env.error("{:,d} or more regional markers failed to be generated due to runtime errors!".\
                      format(fatal_errors))
        env.log('Archiving regional marker data to directory [{}]'.format(env.cache_dir))
        cache.write(arcroot = 'CACHE', source_dir = env.tmp_cache)
env.jobs = args.jobs
# STEP 2: write to PLINK or mega2 format
tpeds = [os.path.join(env.tmp_cache, item) for item in os.listdir(env.tmp_cache) if item.startswith(env.output) and item.endswith('.tped')]
for fmt in args.format:
    print(fmt.lower())
    cache.setID(fmt.lower())
    if not args.vanilla and cache.check():
        env.log('Loading {} data from archive ...'.format(fmt.upper()))
        cache.load(target_dir = env.tmp_dir, names = [fmt.upper()])
    else:
        env.log('{:,d} units will be converted to {} format'.format(env.success_counter.value, fmt.upper()))
        env.format_counter.value = 0
        format(tpeds, os.path.join(env.tmp_cache, "{}.tfam".format(env.output)),
               args.prevalence, args.wild_pen, args.muta_pen, fmt,
               args.inherit_mode, args.theta_max, args.theta_inc)
        env.log('{:,d} units successfully converted to {} format\n'.\
                format(env.format_counter.value, fmt.upper()), flush = True)
        if env.skipped_counter.value:
            # FIXME: perhaps we need to rephrase this message?
            env.log('{} region - family pairs skipped'.\
                    format(env.skipped_counter.value))
        env.log('Archiving {} format to directory [{}]'.format(fmt.upper(), env.cache_dir))
        cache.write(arcroot = fmt.upper(),
                    source_dir = os.path.join(env.tmp_dir, fmt.upper()), mode = 'a')
mkpath(env.outdir)
if args.run_linkage:
    cache.setID('analysis')
    if not args.vanilla and cache.check():
        env.log('Loading linkage analysis result from archive ...'.format(fmt.upper()))
        cache.load(target_dir = env.output, names = ['heatmap'])
    else:
        env.log('Running linkage analysis ...'.format(fmt.upper()))
        run_linkage(args.blueprint, args.theta_inc, args.theta_max, args.output_limit)
        env.log('Linkage analysis succesfully performed for {:,d} units\n'.\
                format(env.run_counter.value, fmt.upper()), flush = True)
        if env.makeped_counter.value:
            env.log('{} "makeped" runtime errors occurred'.format(env.makeped_counter.value))
        if env.pedcheck_counter.value:
            env.log('{} "pedcheck" runtime errors occurred'.format(env.pedcheck_counter.value))
        if env.unknown_counter.value:
            env.log('{} "unknown" runtime errors occurred'.format(env.unknown_counter.value))
        if env.mlink_counter.value:
            env.log('{} "mlink" runtime errors occurred'.format(env.mlink_counter.value))
        cache.write(arcroot = 'heatmap', source_dir = os.path.join(env.output, 'heatmap'), mode = 'a')
    html(args.theta_inc, args.theta_max, args.output_limit)
else:
    env.log('Saving data to [{}]'.format(os.path.abspath(env.output)))
    cache.load(target_dir = env.output)
MESSAGE: 3,479 samples found in [/mnt/mfs/statgen/yin/Github/linkage/SEQpy3/data/first1000snp_full_samples.vcf.gz]
MESSAGE: 7 samples found in FAM file but not in VCF file:
28_9_101, 28_9_100, 28_9_186, 1036_2, 22_1_20, 1036_1, 22_1_10
MESSAGE: 3,461 samples in VCF file will be ignored due to absence in FAM file
MESSAGE: Loading marker map from [data/genemap.hg38.txt] ...
MESSAGE: 3 families with a total of 18 samples will be scanned for 28,325 pre-defined units
MESSAGE: 0 units processed {5.65%} ...                                       
in Haplotype
MESSAGE: 0 units processed {19.76%} ...                                      
Estimating allele frequencies... [using maximum likelihood]0
   V8-13273 V12-13302 V17-13417 V22-13687 

V8-13273: 0 0.707106 0.292894 
total familyCount:1
V12-13302: 0 0.75 0.25 
total familyCount:1
V17-13417: 0 0.75 0.25 
total familyCount:1
V22-13687: 0 0.75 0.25 
total familyCount:1
in Haplotype
MESSAGE: 0 units processed {14.12%} ...                                      
in Haplotype
MESSAGE: 0 units processed {11.29%} ...                                      


running familyrunning family running family1036  
10361036
running familyrunning familyrunning family
 22_1 
22_1 running family
 running family22_1Estimating allele frequencies... [using maximum likelihood]0
   V8-13273 V12-13302 V17-13417 V22-13687 

V8-13273: 0 0.707106 0.292894 
total familyCount:1
V12-13302: 0 0.75 0.25 
total familyCount:1
V17-13417: 0 0.75 0.25 
total familyCount:1
V22-13687: 0 0.75 0.25 
total familyCount:1
Estimating allele frequencies... [using maximum likelihood]0
   V4-17385 V8-17407 

V4-17385: 0 1 
total familyCount:1
V8-17407: 0 0.5 0.5 
total familyCount:1
Estimating allele frequencies... [using maximum likelihood]0
   V8-13273 V15-13380 V17-13417 

V8-13273: 0 0.744757 0.255243 
total familyCount:1
V15-13380: 0 0.744757 0.255243 
total familyCount:1
V17-13417: 0 0.744757 0.255243 
total familyCount:1
Estimating allele frequencies... [using maximum likelihood]0
   V4-17385 V5-17398 V8-17407 

V4-17385: 0 0.739454 0.260546 
total familyCount:1
V5-17398: 0 0.744757 0.255243 
total familyCount:1
V8-17407: 0 0.744757 0.255243 
total familyCount:1

28_9running family
 28_9 28_9

MESSAGE: 3 units processed {36.70%} ...                                      
Estimating allele frequencies... [using maximum likelihood]0
   V8-13273 V15-13380 V17-13417 

V8-13273: 0 0.744757 0.255243 
total familyCount:1
V15-13380: 0 0.744757 0.255243 
total familyCount:1
V17-13417: 0 0.744757 0.255243 
total familyCount:1
Estimating allele frequencies... [using maximum likelihood]0
   V3-17379 V4-17385 V9-17408 

V3-17379: 0 0.824706 0.175294 
total familyCount:1
V4-17385: 0 0.5 0.5 
total familyCount:1
V9-17408: 0 0.824706 0.175294 
total familyCount:1
MESSAGE: 3 units processed {73.39%} ...                                      
in Haplotype
running family 1036
running family 22_1
MESSAGE: 3 units processed {79.04%} ...
running family 
MESSAGE: 3 units processed {81.86%} ...
28_9
MESSAGE: 3 units processed {81.86%} ...

MESSAGE: 4 units processed {93.15%} ...                                      
Estimating allele frequencies... [using maximum likelihood]0
   V3-14464 V8-14653 V18-14907 V19-14930 V20-14933 V40-16103 V50-16378 
   V55-16487 V69-17147 V79-17358 V85-17385 V89-17407 V124-17697 V151-17928 
   V152-17929 V159-20184 V160-20191 V162-20212 V165-20227 V169-20235 
   V171-20250 V178-20316 V180-20485 V182-20522 V184-20547 V194-29368 

V3-14464: 0 0.75 0.25 
total familyCount:1
V8-14653: 0 0.75 0.25 
total familyCount:1
V18-14907: 0 0.5 0.5 
total familyCount:1
V19-14930: 0 0.5 0.5 
total familyCount:1
V20-14933: 0 1 
total familyCount:1
V40-16103: 0 0.707106 0.292894 
total familyCount:1
V50-16378: 0 0.5 0.5 
total familyCount:1
V55-16487: 0 0.75 0.25 
total familyCount:1
V69-17147: 0 0.5 0.5 
total familyCount:1
V79-17358: 0 1 
total familyCount:1
V85-17385: 0 1 
total familyCount:1
V89-17407: 0 0.5 0.5 
total familyCount:1
V124-17697: 0 0.5 0.5 
total familyCount:1
V151-17928: 0 0.5 0.5 
total familyCount:1
V152-17929: 0 0.5 0.5 
total familyCount:1
V159-20184: 0 0.5 0.5 
total familyCount:1
V160-20191: 0 1 
total familyCount:1
V162-20212: 0 1 
total familyCount:1
V165-20227: 0 1 
total familyCount:1
V169-20235: 0 1 
total familyCount:1
V171-20250: 0 1 
total familyCount:1
V178-20316: 0 1 
total familyCount:1
V180-20485: 0 1 
total familyCount:1
V182-20522: 0 1 
total familyCount:1
V184-20547: 0 0.75 0.25 
total familyCount:1
V194-29368: 0 1 
total familyCount:1
Estimating allele frequencies... [using maximum likelihood]0
   V3-14464 V8-14653 V10-14677 V18-14907 V19-14930 V40-16103 V50-16378 
   V55-16487 V69-17147 V80-17365 V85-17385 V86-17398 V89-17407 V95-17479 
   V108-17559 V112-17589 V124-17697 V129-17722 V131-17746 V142-17829 
   V155-19190 V159-20184 V160-20191 V162-20212 V165-20227 V169-20235 
   V171-20250 V178-20316 V184-20547 

V3-14464: 0 0.739454 0.260546 
total familyCount:1
V8-14653: 0 0.707103 0.292897 
total familyCount:1
V10-14677: 0 0.739454 0.260546 
total familyCount:1
V18-14907: 0 0.707103 0.292897 
total familyCount:1
V19-14930: 0 0.728713 0.271287 
total familyCount:1
V40-16103: 0 0.5 0.5 
total familyCount:1
V50-16378: 0 0.5 0.5 
total familyCount:1
V55-16487: 0 0.744757 0.255243 
total familyCount:1
V69-17147: 0 0.744757 0.255243 
total familyCount:1
V80-17365: 0 0.744757 0.255243 
total familyCount:1
V85-17385: 0 0.739454 0.260546 
total familyCount:1
V86-17398: 0 0.744757 0.255243 
total familyCount:1
V89-17407: 0 0.744757 0.255243 
total familyCount:1
V95-17479: 0 0.744757 0.255243 
total familyCount:1
V108-17559: 0 0.744757 0.255243 
total familyCount:1
V112-17589: 0 0.744757 0.255243 
total familyCount:1
V124-17697: 0 0.739454 0.260546 
total familyCount:1
V129-17722: 0 0.744757 0.255243 
total familyCount:1
V131-17746: 0 0.739454 0.260546 
total familyCount:1
V142-17829: 0 0.744757 0.255243 
total familyCount:1
V155-19190: 0 0.739454 0.260546 
total familyCount:1
V159-20184: 0 0.744757 0.255243 
total familyCount:1
V160-20191: 0 0.744757 0.255243 
total familyCount:1
V162-20212: 0 0.744757 0.255243 
total familyCount:1
V165-20227: 0 0.744757 0.255243 
total familyCount:1
V169-20235: 0 0.744757 0.255243 
total familyCount:1
V171-20250: 0 0.739454 0.260546 
total familyCount:1
V178-20316: 0 0.739454 0.260546 
total familyCount:1
V184-20547: 0 0.739454 0.260546 
total familyCount:1
Estimating allele frequencies... [using maximum likelihood]0
   V3-14464 V5-14470 V8-14653 V10-14677 V18-14907 V19-14930 V34-16068 
   V40-16103 V50-16378 V84-17379 V85-17385 V90-17408 V105-17519 V107-17556 
   V116-17614 V155-19190 V158-20166 V160-20191 V162-20212 V165-20227 
   V166-20227 V168-20231 V169-20235 V171-20250 V174-20254 V178-20316 
   V183-20545 V184-20547 V194-29368 

V3-14464: 0 0.646634 0.353366 
total familyCount:1
V5-14470: 0 0.824706 0.175294 
total familyCount:1
V8-14653: 0 0.452863 0.547137 
total familyCount:1
V10-14677: 0 0.656432 0.343568 
total familyCount:1
V18-14907: 0 0.5 0.5 
total familyCount:1
V19-14930: 0 0.628665 0.371335 
total familyCount:1
V34-16068: 0 0.5 0.5 
total familyCount:1
V40-16103: 0 0.628667 0.371333 
total familyCount:1
V50-16378: 0 0.617751 0.382249 
total familyCount:1
V84-17379: 0 0.824706 0.175294 
total familyCount:1
V85-17385: 0 0.5 0.5 
total familyCount:1
V90-17408: 0 0.824706 0.175294 
total familyCount:1
V105-17519: 0 0.824706 0.175294 
total familyCount:1
V107-17556: 0 0.820231 0.179769 
total familyCount:1
V116-17614: 0 0.824706 0.175294 
total familyCount:1
V155-19190: 0 0.6 0.4 
total familyCount:1
V158-20166: 0 0.628665 0.371335 
total familyCount:1
V160-20191: 0 0.628665 0.371335 
total familyCount:1
V162-20212: 0 0.628665 0.371335 
total familyCount:1
V165-20227: 0 0.656432 0.343568 
total familyCount:1
V166-20227: 0 0.646634 0.353366 
total familyCount:1
V168-20231: 0 0.811255 0.188745 
total familyCount:1
V169-20235: 0 0.824706 0.175294 
total familyCount:1
V171-20250: 0 0.628665 0.371335 
total familyCount:1
V174-20254: 0 0.824706 0.175294 
total familyCount:1
V178-20316: 0 0.628665 0.371335 
total familyCount:1
V183-20545: 0 0.820231 0.179769 
total familyCount:1
V184-20547: 0 0.617751 0.382249 
total familyCount:1
V194-29368: 0 0.656432 0.343568 
total familyCount:1
                                                                      
MESSAGE: 4 units processed {99.94%} ...                                      
Estimating allele frequencies... [using maximum likelihood]0
   V8-13273 V12-13302 V17-13417 V22-13687 

V8-13273: 0 0.707106 0.292894 
total familyCount:1
V12-13302: 0 0.75 0.25 
total familyCount:1
V17-13417: 0 0.75 0.25 
total familyCount:1
V22-13687: 0 0.75 0.25 
total familyCount:1
Estimating allele frequencies... [using maximum likelihood]0
   V8-13273 V15-13380 V17-13417 

V8-13273: 0 0.744757 0.255243 
total familyCount:1
V15-13380: 0 0.744757 0.255243 
total familyCount:1
V17-13417: 0 0.744757 0.255243 
total familyCount:1
MESSAGE: 4 units (from 256 variants) processed; 24 Mendelian inconsistencies and 116 recombination events handled
MESSAGE: 28,321 units ignored due to absence in VCF file
MESSAGE: Archiving regional marker data to directory [/mnt/mfs/statgen/yin/Github/linkage/SEQpy3/cache]
merlin
16
MESSAGE: 4 units will be converted to MERLIN format
MESSAGE: 4 units successfully converted to MERLIN format
MESSAGE: Archiving MERLIN format to directory [/mnt/mfs/statgen/yin/Github/linkage/SEQpy3/cache]
MESSAGE: Saving data to [/mnt/mfs/statgen/yin/Github/linkage/SEQpy3/LINKAGE]
{% endraw %} {% raw %}
1
{% endraw %} {% raw %}
args.run_linkage = True
{% endraw %} {% raw %}
region = ['1', '69090', '70008', 'OR4F5', '4.866641545668504e-06', '6.181823219621424e-06', '3.6135725636621673e-06']
{% endraw %} {% raw %}
extractor.getRegion(region)
maker.getRegion(region)
writer.getRegion(region)
{% endraw %} {% raw %}
haplotypes = OrderedDict()
mafs = {}   ##Per fam per variant
uniq_vars = []
exclude_vars = []
varnames = {}
recombPos = {}
{% endraw %} {% raw %}
extractor.apply(data)
{% endraw %} {% raw %}
maker._MarkerMaker__Haplotype(data, haplotypes, mafs, varnames,recombPos,uniq_vars,exclude_vars)
{% endraw %} {% raw %}
haplotypes['668']
{% endraw %} {% raw %}
maker._MarkerMaker__ClusterByLD(data, haplotypes, varnames)
{% endraw %} {% raw %}
maker._MarkerMaker__CodeHaplotypes(data, haplotypes, mafs, varnames, [])
{% endraw %} {% raw %}
clusters = []
if clusters is not None:
    clusters_idx = [[[varnames[item].index(x) for x in y] for y in clusters] for item in haplotypes]
else:
    clusters_idx = [[[]] for item in haplotypes]
maker.coder.Execute(haplotypes.values(), [[mafs[v] for v in varnames[item]] for item in haplotypes], clusters_idx)
{% endraw %} {% raw %}
maker.coder.Print()
{% endraw %} {% raw %}
maker.ld
{% endraw %} {% raw %}
[[mafs[item][v] for v in varnames[item]] for item in haplotypes]
{% endraw %} {% raw %}
varnames['668']
{% endraw %} {% raw %}
mafs
{% endraw %}

Test clusterbyld

{% raw %}
data.freq
{% endraw %} {% raw %}
data.variants
{% endraw %} {% raw %}
maker.apply(data)
{% endraw %} {% raw %}
haplotypes = OrderedDict()
mafs = {}
varnames = {}
maker._MarkerMaker__Haplotype(data, haplotypes, mafs, varnames)
{% endraw %} {% raw %}
type(data)
{% endraw %} {% raw %}
markers = ["V{}-{}".format(idx, item[1]) for idx, item in enumerate(data.variants)]
{% endraw %} {% raw %}
item = list(data.families.keys())[2]
{% endraw %} {% raw %}
item ='1036'
{% endraw %} {% raw %}
varnames = {}
{% endraw %} {% raw %}
varnames[item], positions, vcf_mafs = data.getFamVariants(item, style = "map")
{% endraw %} {% raw %}
varnames
{% endraw %} {% raw %}
item
{% endraw %} {% raw %}
varnames
{% endraw %} {% raw %}
tmp
{% endraw %} {% raw %}
maker.haplotyper.Execute(data.chrom, varnames[item], sorted(positions), data.getFamSamples(item))[0]
{% endraw %} {% raw %}
recombPos={}
{% endraw %} {% raw %}
varnames[item], positions, vcf_mafs = data.getFamVariants(item, style = "map")
recombPos[item]={}
var_for_haplotype=[]
positions_for_haplotype=[]
output_sample=[]
{% endraw %} {% raw %}
data.gnomAD_estimate.keys()
{% endraw %} {% raw %}
data.freq
{% endraw %} {% raw %}
positions
{% endraw %} {% raw %}
var_for_haplotype=varnames[item]
positions_for_haplotype=positions
{% endraw %} {% raw %}
item
{% endraw %} {% raw %}
famid =item
{% endraw %} {% raw %}
sorted_names = []
S_no_parents = filter(lambda x: True if data.tfam.is_founder(x) else False, data.tfam.families[famid])
graph = data.tfam.graph[famid].copy()
{% endraw %} {% raw %}
list(S_no_parents)
{% endraw %} {% raw %}
data.tfam.families[famid]
{% endraw %} {% raw %}
graph
{% endraw %} {% raw %}
while(S_no_parents):
    n = S_no_parents.pop()
    sorted_names.append(n)
    if n not in graph:
        continue
    offsprings = graph.pop(n)
    for m in offsprings:
        father, mother = data.tfam.get_parents(m)
        if father not in graph and mother not in graph:
            S_no_parents.append(m)
if graph:
    raise ValueError("There is a loop in the pedigree: {}\n".format(' '.join(graph.keys())))
else:
    return sorted_names
{% endraw %} {% raw %}
data.tfam
{% endraw %} {% raw %}
for person in data.tfam.sort_family(item):
    output_sample.append([])
    last_ele=len(output_sample)-1
    output_sample[last_ele] = data.tfam.samples[person][:-1]
    if person in data.samples:
        for marker in var_for_haplotype:
            idx=int(marker.split('-')[0][1:])
            output_sample[last_ele].append(data.genotype_all[person][idx])
    else:
        output_sample[last_ele].extend(["00"] * len(var_for_haplotype))
{% endraw %} {% raw %}
len(data.tfam.sort_family(item))
{% endraw %} {% raw %}
set(output_sample[0][5:])
{% endraw %} {% raw %}
env.tmp_log
{% endraw %} {% raw %}
haplotypes = {}
{% endraw %} {% raw %}
tmp_log_output=env.tmp_log + str(os.getpid())
haplotypes[item] = maker.haplotyper.Execute(data.chrom, var_for_haplotype, positions_for_haplotype, output_sample, maker.rsq, tmp_log_output)[0]
{% endraw %} {% raw %}
1
{% endraw %} {% raw %}
var_for_haplotype
{% endraw %} {% raw %}
positions_for_haplotype
{% endraw %} {% raw %}
haplotypes
{% endraw %} {% raw %}
1+1
{% endraw %} {% raw %}
haplotypes
{% endraw %} {% raw %}
str(os.getpid())
{% endraw %} {% raw %}
var_for_haplotype
{% endraw %} {% raw %}
positions_for_haplotype
{% endraw %} {% raw %}
output_sample
{% endraw %} {% raw %}
maker.rsq
{% endraw %} {% raw %}
haplotypes['1']
{% endraw %} {% raw %}
for hap_idx,haploid in enumerate(haplotypes[item]):
    for vidx,var in enumerate(haploid[2:]):
        if not var.endswith(':') and not var.endswith('|') and vidx!=0:
            postvar_name=varnames[item][vidx]
            prevar_name=varnames[item][vidx-1]
            recomb_pair = (prevar_name,postvar_name)
            print('run this')
            try:
                recombPos[item][recomb_pair].append(hap_idx)
            except:
                recombPos[item][recomb_pair]=[hap_idx]
{% endraw %} {% raw %}
haploid
{% endraw %} {% raw %}
var
{% endraw %} {% raw %}
haplotypes['1']
{% endraw %} {% raw %}
mafs
{% endraw %} {% raw %}
varnames
{% endraw %} {% raw %}
recombPos
{% endraw %} {% raw %}
uniq_vars
{% endraw %} {% raw %}
exclude_vars
{% endraw %} {% raw %}
maker.rsq
{% endraw %} {% raw %}
person
{% endraw %} {% raw %}
mafs
{% endraw %} {% raw %}
mafs = {}
# either use privided MAF or computer MAF
if all(vcf_mafs):
    print('run this')
    for idx, v in enumerate(varnames[item]):
        if v not in mafs:
            mafs[v] = vcf_mafs[idx]
else:
    # count founder alleles
    for hap in haplotypes[item]:
        if not data.tfam.is_founder(hap[1]):
            continue
        for idxv, v in enumerate(varnames[item]):
            if v not in mafs:
                # [#alt, #haplotypes]
                mafs[v] = [0, 0]
            gt = hap[2 + idxv][1] if hap[2 + idxv][0].isupper() else hap[2 + idxv][0]
            if not gt == "?":
                mafs[v][0] += self.gtconv[gt]
                mafs[v][1] += 1.0
{% endraw %} {% raw %}
mafs
{% endraw %} {% raw %}
vcf_mafs
{% endraw %} {% raw %}
type(mafs['V0-176659933'])
{% endraw %} {% raw %}
maker.maf_cutoff
{% endraw %} {% raw %}
exclude_vars = []
for v in mafs.keys():
    if mafs[v] > maker.maf_cutoff:
        exclude_vars.append(v)
for i in haplotypes.keys():
    haplotypes[i] = listit(haplotypes[i])
    for j in range(len(haplotypes[i])):
        haplotypes[i][j] = haplotypes[i][j][:2] + \
          [x for idx, x in enumerate(haplotypes[i][j][2:]) if varnames[i][idx] not in exclude_vars]
    varnames[i] = [x for x in varnames[i] if x not in exclude_vars]
    # handle trivial data
    if len(varnames[i]) == 0:
        for person in data.families[i]:
            data[person] = self.missings
        del varnames[i]
        del haplotypes[i]
{% endraw %} {% raw %}
tmp_exclude_vars=exclude_vars
{% endraw %} {% raw %}
tmp_exclude_vars
{% endraw %} {% raw %}
recombPos
{% endraw %} {% raw %}
uniq_vars = []
i = '1'
for tmp_var in varnames[i]:
    if tmp_var not in uniq_vars:
             uniq_vars.append(tmp_var)
varnames[i] = [x for x in varnames[i] if x not in tmp_exclude_vars]
{% endraw %} {% raw %}
data
{% endraw %} {% raw %}
data.genotype_all
{% endraw %} {% raw %}
varnames
{% endraw %} {% raw %}
if len(varnames):
    if not any ([len(varnames[x]) - 1 for x in varnames]):
        # all families have only one variant
        maker._MarkerMaker__AssignSNVHaplotypes(data, haplotypes, mafs, varnames)
    else:
        print('run this')
        # calculate LD clusters using founder haplotypes
        clusters = maker._MarkerMaker__ClusterByLD(data, haplotypes, varnames)
        # recoding the genotype of the region
        maker._MarkerMaker__CodeHaplotypes(data, haplotypes, mafs, varnames, clusters)
{% endraw %} {% raw %}
clusters
{% endraw %}

def __ClusterByLD(self, data, haplotypes, varnames):

{% raw %}
haplotypes
OrderedDict([('1',
              [['1', 'I:1', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
               ['1', 'I:1', '2:', '2:', '1:', '1:', '1:', '1:', '2:'],
               ['1', 'I:2', '2:', '2:', '1:', '1:', '1:', '2:', '2:'],
               ['1', 'I:2', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
               ['1', 'II:3', '2:', '2|', '1:', '1:', '1:', '2|', '2|'],
               ['1', 'II:3', '1:', '1|', '1:', '1:', '1:', '1|', '1|'],
               ['1', 'II:2', '2:', '2|', '1:', '1:', '1:', '2|', '2|'],
               ['1', 'II:2', '1:', '1|', '1:', '1:', '1:', '1|', '1|'],
               ['1', 'II:1', '2:', '2|', '1:', '1:', '1:', '2|', '2|'],
               ['1', 'II:1', '2:', '2|', '1:', '1:', '1:', '1|', '2|'],
               ['1', 'II:4', '2:', '2|', '1:', '1:', '1:', '2\\', '2|'],
               ['1', 'II:4', '1:', '1|', '1:', '1:', '1:', '1\\', '2|']]),
             ('2',
              [['2', 'I:A', '1:', '1:', '1:', '1:', '1:', '1:', '2:'],
               ['2', 'I:A', '1:', '1:', '1:', '1:', '1:', '1:', '2:'],
               ['2', 'I:B', '2:', '2:', '2:', '2:', '2:', '2:', '1:'],
               ['2', 'I:B', '1:', '1:', '1:', '1:', '1:', '1:', '1:'],
               ['2', 'II:D', '2:', '2|', '2|', '2|', '2|', '2|', '1:'],
               ['2', 'II:D', '1:', '1|', '1|', '1|', '1|', '1|', '2:'],
               ['2', 'II:C', '1:', '1|', '1|', '1|', '1|', '1|', '1:'],
               ['2', 'II:C', '1:', '1|', '1|', '1|', '1|', '1|', '2:'],
               ['2', 'II:B', '1:', '1|', '1|', '1|', '1|', '1|', '1:'],
               ['2', 'II:B', '1:', '1|', '1|', '1|', '1|', '1|', '2:'],
               ['2', 'II:A', '2:', '2|', '2|', '2|', '2|', '2|', '1:'],
               ['2', 'II:A', '1:', '1|', '1|', '1|', '1|', '1|', '2:']])])
{% endraw %} {% raw %}
maker.r2
{% endraw %} {% raw %}
markers
{% endraw %} {% raw %}
gtt = []
founder_haplotypes = []
markers = sorted(set(itertools.chain(*varnames.values())), key = lambda x: int(x.split("-")[0][1:]))
for item in haplotypes:
    for ihap, hap in enumerate(haplotypes[item]):
        if not data.tfam.is_founder(hap[1]):
            continue
        gt = [hap[2 + varnames[item].index(v)] if v in varnames[item] else '?' for v in markers]
        founder_haplotypes.append(("{}-{}".format(hap[1], ihap % 2), "".join([x[1] if x[0].isupper() else x[0] for x in gt])))
        gtt.append(["{}-{}".format(hap[1], ihap % 2), [x[1] if x[0].isupper() else x[0] for x in gt]])
{% endraw %} {% raw %}
founder_haplotypes
[('I:1-0', '1111111'),
 ('I:1-1', '2211112'),
 ('I:2-0', '2211122'),
 ('I:2-1', '1111111'),
 ('I:A-0', '1111112'),
 ('I:A-1', '1111112'),
 ('I:B-0', '2222221'),
 ('I:B-1', '1111111')]
{% endraw %} {% raw %}
egglib.stats.matrix_LD(Align.create(founder_haplotypes,egglib.Alphabet(cat='string',expl=['1','2'],miss='?')),('rsq'))
([0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0],
 [[None],
  [1.0, None],
  [0.2380952380952381, 0.2380952380952381, None],
  [0.2380952380952381, 0.2380952380952381, 1.0, None],
  [0.2380952380952381, 0.2380952380952381, 1.0, 1.0, None],
  [0.5555555555555556,
   0.5555555555555556,
   0.42857142857142866,
   0.42857142857142866,
   0.42857142857142866,
   None],
  [0.06666666666666665,
   0.06666666666666665,
   0.14285714285714282,
   0.14285714285714282,
   0.14285714285714282,
   0.0,
   None]])
{% endraw %} {% raw %}
gtt
[['I:1-0', ['1', '1', '1', '1', '1', '1', '1']],
 ['I:1-1', ['2', '2', '1', '1', '1', '1', '2']],
 ['I:2-0', ['2', '2', '1', '1', '1', '2', '2']],
 ['I:2-1', ['1', '1', '1', '1', '1', '1', '1']],
 ['I:A-0', ['1', '1', '1', '1', '1', '1', '2']],
 ['I:A-1', ['1', '1', '1', '1', '1', '1', '2']],
 ['I:B-0', ['2', '2', '2', '2', '2', '2', '1']],
 ['I:B-1', ['1', '1', '1', '1', '1', '1', '1']]]
{% endraw %} {% raw %}
import egglib
{% endraw %} {% raw %}
gt
['1:', '1:', '1:', '1:', '1:', '1:', '1:']
{% endraw %} {% raw %}
ldi,ld = egglib.stats.matrix_LD(Align.create(gtt,egglib.Alphabet(cat='char',expl=['1','2'],miss='?')),('rsq'))
blocks = []
for j in range(len(ldi)):
    block = [j]
    for k in range(j+1,len(ldi)):
        if ld[k][j] > maker.r2:
            block.append(k)
    if len(block) > 1:
        blocks.append(block)
clusters = [[markers[idx] for idx in item] for item in list(connected_components(blocks))]
{% endraw %} {% raw %}
clusters
[['V0-89984370', 'V1-89984604'], ['V2-89984739', 'V3-89985940', 'V4-89986608']]
{% endraw %} {% raw %}
varnames
{'1': ['V0-89984370',
  'V1-89984604',
  'V2-89984739',
  'V3-89985940',
  'V4-89986608',
  'V5-89986760',
  'V6-89987201'],
 '2': ['V0-89984370',
  'V1-89984604',
  'V2-89984739',
  'V3-89985940',
  'V4-89986608',
  'V5-89986760',
  'V6-89987201']}
{% endraw %} {% raw %}
ld = Align.create(founder_haplotypes).matrixLD(validCharacters="12")["r2"]
blocks = []
for j in ld:
    block = [j]
    for k in ld[j]:
        if ld[j][k] > maker.r2:
            block.append(k)
    if len(block) > 1:
        blocks.append(block)
# get LD clusters
clusters = [[markers[idx] for idx in item] for item in list(connected_components(blocks))]
{% endraw %} {% raw %}
ld
{% endraw %} {% raw %}
block
{% endraw %} {% raw %}
list(connected_components([]))
{% endraw %} {% raw %}
list(connected_components(blocks))
{% endraw %} {% raw %}
clusters
{% endraw %}

def __CodeHaplotypes(self, data, haplotypes, mafs, varnames, clusters):

{% raw %}
if clusters is not None:
    clusters_idx = [[[varnames[item].index(x) for x in y] for y in clusters] for item in haplotypes]
else:
    clusters_idx = [[[]] for item in haplotypes]
{% endraw %} {% raw %}
clusters_idx
{% endraw %} {% raw %}
maker.coder.Execute(haplotypes.values(), [[mafs[v] for v in varnames[item]] for item in haplotypes], clusters_idx)
{% endraw %} {% raw %}
data.superMarkerCount
{% endraw %} {% raw %}
for line in maker.coder.GetHaplotypes():
    print(line)
    if not line[1] in data:
        # this sample is not in VCF file. Every variant site should be missing
        # they have to be skipped for now
        continue
    data[line[1]] = (line[2].split(','), line[3].split(','))
    if len(data[line[1]][0]) > data.superMarkerCount:
        data.superMarkerCount = len(data[line[1]][0])
        
{% endraw %} {% raw %}
data
{% endraw %} {% raw %}
data.superMarkerCount
{% endraw %} {% raw %}
for item in haplotypes:
    data.maf[item] = maker.coder.GetAlleleFrequencies(item)
    data.maf[item] = tuple(tuple(np.array(v) / np.sum(v)) if np.sum(v) else v
                      for v in data.maf[item])
{% endraw %} {% raw %}
data.maf
{% endraw %} {% raw %}
maker._MarkerMaker__FormatHaplotypes(data,recombPos,varnames,uniq_vars)
{% endraw %} {% raw %}
data
{% endraw %} {% raw %}
type(data['I:1'][0])
{% endraw %} {% raw %}
    for item in data.famvaridx:
        if item not in haplotypes and data[data.families[item][0]] != ('0','0'):
            # when only wild-type haplotypes are present in a family, still code them instead of ignoring the family
            if self.freq_by_fam:
                pop=data.freq_by_fam[item]
                try:
                    varnames[item]=data.total_varnames[pop]
                    mafs[item]=data.total_mafs[pop]
                except:
                    continue
            else:
                varnames[item]=data.total_varnames['pop']
                mafs[item]=data.total_mafs
            haplotypes[item]=[]
            for person in data.families[item]:
                tmp_person=[item, person]
                if '00' in data[person]:
                    tmp_person+=['?:']*len(varnames[item])
                else:
                    tmp_person+=['1:']*len(varnames[item])
                haplotypes[item].append(tmp_person)
                haplotypes[item].append(tmp_person)
        elif item in haplotypes:
            nonvar_hap_flag=False
            #determine if wild-type haplotype is present in a family
            for hap in haplotypes[item]:
                tmp_genes=[]
                for tmpa in hap[2:]:
                    if 'A' in tmpa or 'B' in tmpa:
                        tmp_genes.append(tmpa[1])
                    else:
                        tmp_genes.append(tmpa[0])
                if set(tmp_genes)==set(['1']):
                    #non variant haplotype
                    nonvar_hap_flag=True
                    break
            if not nonvar_hap_flag:
                #if family don't have wild-type haplotype, add a fake one to ensure correct coding
                var_num=len(varnames[item])
                fake_person=[item, 'FAKEPERSON']+['1:']*var_num
                haplotypes[item].append(fake_person)
            for hidx,hap in enumerate(haplotypes[item]):
                if hap[1] in data.missing_persons:
                    missing_person=[item,hap[1]]+['?:']*len(varnames[item])
                    haplotypes[item][hidx]=missing_person

    if not clusters is None:
        clusters_idx = [[[varnames[item].index(x) for x in y] for y in clusters] for item in haplotypes]
    else:
        clusters_idx = [[[]] for item in haplotypes]
    if env.debug:
        for item in haplotypes:
            with env.lock:
                print(varnames[item],file=sys.stderr)
                print("hap{0}\t{1}\n".format(item,haplotypes[item]),file=sys.stderr)
    self.coder.Execute(haplotypes.values(), [[mafs[item][v] for v in varnames[item]] for item in haplotypes], clusters_idx)
    if env.debug:
        with env.lock:
            if clusters:
                print("Family LD clusters: ", clusters_idx, "\n", file = sys.stderr)
            self.coder.Print()
    # line: [fid, sid, hap1, hap2]
    for line in self.coder.GetHaplotypes():
        if not line[1] in data:
            # this sample is not in VCF file. Every variant site should be missing
            # they have to be skipped for now
            continue
        data[line[1]] = (line[2].split(','), line[4].split(','))
        #sub-region count for each sample individual
        superMarkerCount=len(data[line[1]][0])
        if line[0] not in data.patterns:
            data.patterns[line[0]]=[[] for x in range(superMarkerCount)]
        for t_Marker in range(superMarkerCount):
            t_pat1=line[3].split(',')[t_Marker]
            t_pat2=line[5].split(',')[t_Marker]
            if t_pat1 not in data.patterns[line[0]][t_Marker]:
                data.patterns[line[0]][t_Marker].append(t_pat1)
            if t_pat2 not in data.patterns[line[0]][t_Marker]:
                data.patterns[line[0]][t_Marker].append(t_pat2)
        if len(data[line[1]][0]) > data.superMarkerCount:
            data.superMarkerCount = len(data[line[1]][0])
    # get MAF
    for item in data.famvaridx:
        if item not in haplotypes:
            for person in data.families[item]:
                data[person]=(['0']*data.superMarkerCount,['0']*data.superMarkerCount)
    for item in haplotypes:
        data.maf[item] = self.coder.GetAlleleFrequencies(item)
        if not len(data.maf[item][0]):
            continue
        data.varnames_by_fam[item]=varnames[item]
        wt_maf=0
        if self.freq_by_fam:
            try:
                wt_maf=data.wt_maf[data.freq_by_fam[item]]
            except:
                pass
        else:
            wt_maf=data.wt_maf['pop']
        tmp_data_maf=[]
        for v in data.maf[item]:
            if len(v)==1:
                tmp_data_maf.append((v[0],1-v[0]))
            else:
                if np.sum(v)<1:
                    tmp_ratio=sum(v[1:])/(1-wt_maf)
                    tmp_list=[wt_maf]
                    if tmp_ratio==0:
                        tmp_list.append(1-wt_maf)
                    else:
                        for tmpv in v[1:]:
                            tmp_list.append(tmpv/tmp_ratio)
                    tmp_data_maf.append(tuple(tmp_list))
                else:
                    tmp_data_maf.append(v)
        data.maf[item]=tuple(tmp_data_maf)
    if env.debug:
        with env.lock:
            print("marker freqs = ", data.maf, "\n", file = sys.stderr)
{% endraw %} {% raw %}
for item in data.families:
    varnames[item], positions, vcf_mafs = data.getFamVariants(item, style = "map")
    if len(varnames[item]) == 0:
        for person in data.families[item]:
            data[person] = self.missings
        continue
    if env.debug:
        with env.lock:
            sys.stderr.write('\n'.join(['\t'.join(x) for x in data.getFamSamples(item)]) + '\n\n')
    # haplotyping
    with env.lock:
        if not env.prephased:
            with stdoutRedirect(to = env.tmp_log + str(os.getpid()) + '.log'):
                haplotypes[item] = self.haplotyper.Execute(data.chrom, varnames[item],
                                                       sorted(positions), data.getFamSamples(item))[0]
        else:
            haplotypes[item] = self.__PedToHaplotype(data.getFamSamples(item))
    if len(haplotypes[item]) == 0:
        # C++ haplotyping implementation failed
        with env.chperror_counter.get_lock():
            env.chperror_counter.value += 1
    # either use privided MAF or computer MAF
    if all(vcf_mafs):
        for idx, v in enumerate(varnames[item]):
            if v not in mafs:
                mafs[v] = vcf_mafs[idx]
    else:
        # count founder alleles
        for hap in haplotypes[item]:
            if not data.tfam.is_founder(hap[1]):
                continue
            for idxv, v in enumerate(varnames[item]):
                if v not in mafs:
                    # [#alt, #haplotypes]
                    mafs[v] = [0, 0]
                gt = hap[2 + idxv][1] if hap[2 + idxv][0].isupper() else hap[2 + idxv][0]
                if not gt == "?":
                    mafs[v][0] += self.gtconv[gt]
                    mafs[v][1] += 1.0
{% endraw %} {% raw %}
maker.haplotyper
{% endraw %} {% raw %}
tmp1
{% endraw %} {% raw %}
aa = []
for _ in range(10):
    a = queue.get()
    print(a)
    tmp.getRegion(a)
    tmp.apply(dd)
    tmp1.apply(dd)
    #tmp2.apply(dd)
    if len(dd.variants) != 0:
        aa.append(a)
{% endraw %} {% raw %}
data1 = deepcopy(data)
{% endraw %}

_MarkerMaker__Haplotype

{% raw %}
data = dd
{% endraw %} {% raw %}
haplotypes = OrderedDict()
mafs = {}   ##Per fam per variant
uniq_vars = []
exclude_vars = []
varnames = {}
recombPos = {}
{% endraw %} {% raw %}
tmp1.markers
{% endraw %} def __Haplotype(self, data, haplotypes, mafs, varnames,recombPos,uniq_vars,exclude_vars): '''genetic haplotyping. haplotypes stores per family data''' # FIXME: it is SWIG's (2.0.12) fault not to properly destroy the object "Pedigree" in "Execute()" # So there is a memory leak here which I tried to partially handle on C++ # # Per family haplotyping # {% raw %}
tmp1.markers = ["V{}-{}".format(idx, item[1]) for idx, item in enumerate(data.variants)]
{% endraw %} {% raw %}
tmp_mafs = {}
if tmp1.freq_by_fam:
    ## if families are from different populations
    ## estimate MAF by different population
    fam_to_analyze={}
    for fam,pop in data.freq_by_fam.iteritems():
        if pop not in fam_to_analyze:
            fam_to_analyze[pop]=[fam]
        else:
            fam_to_analyze[pop].append(fam)
{% endraw %} {% raw %}
if tmp1.count:
    ## estimate MAF by counting founder alleles
    if tmp1.freq_by_fam:
        local_count_mafs={}
        for pop in fam_to_analyze:
            local_count_mafs[pop]=tmp1._MarkerMaker__computefounderfreq(data,fam_to_analyze[pop])
    else:
        local_count_mafs=tmp1._MarkerMaker__computefounderfreq(data,data.families.keys())
        print('run here')
{% endraw %} {% raw %}
local_count_mafs
{% endraw %} {% raw %}
tmp1.mle = True
{% endraw %} {% raw %}
if tmp1.mle:
    ## estimate MLE allele frequency using all fam
    local_mle_mafs={}
    if tmp1.freq_by_fam:
        for pop in fam_to_analyze:
            local_mle_mafs[pop]={}
            markers_to_analyze=[]
            pos_all=[]
            markers_analyzed={}
            if pop not in data.mle_mafs:
                data.mle_mafs[pop]={}
            else:
                for tmpv in data.mle_mafs[pop]:
                    markers_analyzed[tmpv.split('-')[-1]]=data.mle_mafs[pop][tmpv]
            output_log=env.tmp_log+"AF_{}_{}.log".format(pop,tmp1.name)
            popidx=tmp1.af_info.index(pop)
            variants_in_fams=[]
            for item in fam_to_analyze[pop]:
                for tmpvar in data.getFamVariants(item):
                    if tmpvar not in variants_in_fams:
                        variants_in_fams.append(tmpvar)
            variants_in_fams=sorted(variants_in_fams, key=lambda x: x[1])
            for item in variants_in_fams:
                idx=data.variants.index(item)
                if item[-1][popidx]==0:
                    if str(item[1]) in markers_analyzed.keys():
                        #if variant has been analyzed
                        vname="V{}-{}".format(idx,item[1])
                        local_mle_mafs[pop][vname]=markers_analyzed[str(item[1])]
                    else:
                        #variant not analyzed before
                        markers_to_analyze.append("V{}-{}".format(idx,item[1]))
                        pos_all.append(item[1])
            tmp_mle_mafs=tmp1._MarkerMaker__getMLEfreq(data, markers_to_analyze, pos_all, fam_to_analyze[pop], tmp1.rsq, output_log)
            if len(tmp_mle_mafs) > 0:
                for vname,vmaf in tmp_mle_mafs.iteritems():
                    data.mle_mafs[pop][vname]=vmaf
                    local_mle_mafs[pop][vname]=vmaf
    else:
        #Homogeneous families
        markers_to_analyze=[]
        pos_all=[]
        markers_analyzed={}
        for tmpv in data.mle_mafs:
            markers_analyzed[tmpv.split('-')[-1]]=data.mle_mafs[tmpv]
        variants_in_fams=[]
        for item in data.families.keys():
            var_per_fam=[tuple(tmpvar) for tmpvar in data.getFamVariants(item)]
            variants_in_fams=list(set(var_per_fam+variants_in_fams))
        variants_in_fams=[list(tmpvar) for tmpvar in sorted(variants_in_fams, key=lambda x: x[1])]
        for item in variants_in_fams:
            idx=data.variants.index(item)
            if item[-1]==0 or tmp1.af_info is None:
                if str(item[1]) in markers_analyzed.keys():
                    #if variant has been analyzed
                    vname="V{}-{}".format(idx,item[1])
                    local_mle_mafs[vname]=markers_analyzed[str(item[1])]
                else:
                    #variant not analyzed before
                    markers_to_analyze.append("V{}-{}".format(idx,item[1]))
                    pos_all.append(item[1])
        output_log=env.tmp_log+"AF_{}.log".format(tmp1.name)
        tmp_mle_mafs=tmp1._MarkerMaker__getMLEfreq(data, markers_to_analyze, pos_all, data.families.keys(), tmp1.rsq, output_log)
        if len(tmp_mle_mafs) > 0:
            for vname, vmaf in tmp_mle_mafs.iteritems():
                data.mle_mafs[vname]=vmaf
                local_mle_mafs[vname]=vmaf
{% endraw %} {% raw %}
tmp_mle_mafs
{% endraw %} {% raw %}
varnames
{% endraw %} {% raw %}
data.families
{% endraw %} {% raw %}
data.families.keys()[0]
{% endraw %} {% raw %}
data.getFamVariants(data.families.keys()[1],style="map")
{% endraw %} {% raw %}
data.famvaridx
{% endraw %} {% raw %}
data.famsampidx
{% endraw %} {% raw %}
gnomAD_pop=None
for item in data.families:
    varnames[item], positions, vcf_mafs = data.getFamVariants(item, style = "map")
    recombPos[item]={}
    var_for_haplotype=[]
    positions_for_haplotype=[]
    output_sample=[]
    if env.debug:
        with env.lock:
            sys.stderr.write('\n'+repr(varnames[item])+'\n')
            sys.stderr.write('\n'.join(['\t'.join(x) for x in data.getFamSamples(item)]) + '\n\n')
    # either use privided MAF or compute MAF
    if tmp1.freq_by_fam:
        mafs[item]={}
        tfreq_fam=data.freq_by_fam[item]
        for pop in data.gnomAD_estimate.keys():
            if pop in tfreq_fam:
                gnomAD_pop=pop
                break
    elif gnomAD_pop is None and data.freq is not None:
        for pop in data.gnomAD_estimate.keys():
            if pop in data.freq:
                gnomAD_pop=pop
                break
    for idx, v in enumerate(varnames[item]):
        tmp_maf_var=0
        if tmp1.af_info is None:
        #no vcf freq column specified
            if v not in tmp_mafs:
                if tmp1.mle:
                #use MLE freq for all variants
                    tmp_mafs[v]=local_mle_mafs[v]
                elif tmp1.count:
                #estimate MAF based on founder counts if MLE not specified
                    tmp_mafs[v]=local_count_mafs[v]
                tmp_maf_var=tmp_mafs[v]
        elif not tmp1.af_info is None:
            #if vcf freq column is specified
            #use vcf_mafs if possible
            if vcf_mafs[idx]:
                tmp_maf_var=vcf_mafs[idx]
                if tmp1.freq_by_fam:
                    mafs[item][v] = vcf_mafs[idx]
                else:
                    if v not in tmp_mafs:
                        tmp_mafs[v] = vcf_mafs[idx]
            else:
                #if variants do not have valid vcf_mafs values if specified
                if tmp1.freq_by_fam:
                    if gnomAD_pop is not None:
                        mafs[item][v]=data.gnomAD_estimate[gnomAD_pop]
                    elif tmp1.mle:
                            mafs[item][v]=local_mle_mafs[data.freq_by_fam[item]][v]
                    elif tmp1.count:
                            mafs[item][v]=local_count_mafs[data.freq_by_fam[item]][v]
                    tmp_maf_var=mafs[item][v]
                else:
                    if v not in tmp_mafs:
                        if gnomAD_pop is not None:
                            tmp_mafs[v]=data.gnomAD_estimate[gnomAD_pop]
                        elif tmp1.mle:
                            tmp_mafs[v]=local_mle_mafs[v]
                        elif tmp1.count:
                            tmp_mafs[v]=local_count_mafs[v]
                    tmp_maf_var=tmp_mafs[v]
        if tmp1.rvhaplo:
            if tmp_maf_var<=tmp1.maf_cutoff:
                var_for_haplotype.append(v)
                positions_for_haplotype.append(positions[idx])
    if not tmp1.rvhaplo:
        var_for_haplotype=varnames[item]
        positions_for_haplotype=positions
    #collect sample+genotypes
    for person in data.tfam.sort_family(item):
        output_sample.append([])
        last_ele=len(output_sample)-1
        output_sample[last_ele] = data.tfam.samples[person][:-1]
        if person in data.samples:
            for marker in var_for_haplotype:
                idx=int(marker.split('-')[0][1:])
                output_sample[last_ele].append(data.genotype_all[person][idx])
        else:
            output_sample[last_ele].extend(["00"] * len(var_for_haplotype))
    # haplotyping
    if len(var_for_haplotype)==0:
        varnames.pop(item,None)
        #for person in data.families[item]:
        #    data[person] = tmp1.missings
        continue
    for person in output_sample:
        if set(person[5:])==set(['00']):
            data.missing_persons.append(person[1])
    with env.lock:
        if not env.prephased:
            tmp_log_output=env.tmp_log + str(os.getpid())
            with stdoutRedirect(to = tmp_log_output + '.log'):
                haplotypes[item] = tmp1.haplotyper.Execute(data.chrom, var_for_haplotype, positions_for_haplotype, output_sample, tmp1.rsq, tmp_log_output)[0]
        else:
            haplotypes[item] = tmp1.__PedToHaplotype(data.getFamSamples(item))
    if len(haplotypes[item]) == 0:
        # C++ haplotyping implementation failed
        with env.chperror_counter.get_lock():
            env.chperror_counter.value += 1
    varnames[item]=var_for_haplotype
    
for item in haplotypes:
    for hap_idx,haploid in enumerate(haplotypes[item]):
        for vidx,var in enumerate(haploid[2:]):
            if not var.endswith(':') and not var.endswith('|') and vidx!=0:
                postvar_name=varnames[item][vidx]
                prevar_name=varnames[item][vidx-1]
                recomb_pair = (prevar_name,postvar_name)
                try:
                    recombPos[item][recomb_pair].append(hap_idx)
                except:
                    recombPos[item][recomb_pair]=[hap_idx]
#
# Compute founder MAFs
#
if len(tmp_mafs) > 0:
    if tmp1.freq_by_fam:
        for pop in tmp_mafs:
            for v in tmp_mafs[pop]:
                if type(tmp_mafs[pop][v]) is list:
                    tmp_mafs[pop][v] = tmp_mafs[pop][v][0]/tmp_mafs[pop][v][1] if tmp_mafs[pop][v][1] >0 else 0.0
    else:
        for v in tmp_mafs:
            if type(tmp_mafs[v]) is list:
                tmp_mafs[v] = tmp_mafs[v][0]/tmp_mafs[v][1] if tmp_mafs[v][1] > 0 else 0.0
## Make mafs consistent in structure regardless of freq_by_fam
if tmp1.freq_by_fam:
    for item in haplotypes:
        popname=data.freq_by_fam[item]
        if popname not in tmp_mafs:
            continue
        if item not in mafs:
            mafs[item]=tmp_mafs[popname]
        else:
            for v in tmp_mafs[popname]:
                if v not in mafs[item]:
                    mafs[item][v]=tmp_mafs[popname][v]
else:
    for item in haplotypes:
        mafs[item]=tmp_mafs
if env.debug:
    with env.lock:
        print("variant mafs = ", mafs, "\n", file = sys.stderr)
##
#
# Drop some variants if maf is greater than given threshold
#
if not tmp1.maf_cutoff is None or tmp1.single_markers:
    if tmp1.freq_by_fam:
        exclude_vars=[[] for x in range(len(data.freq))]
    for i in haplotypes.keys():
        if tmp1.freq_by_fam:
            pop_idx=data.freq.index(data.freq_by_fam[i])
            tmp_exclude_vars=exclude_vars[pop_idx]
        else:
            tmp_exclude_vars=exclude_vars
        for v in mafs[i].keys():
            if not tmp1.maf_cutoff is None:
                if mafs[i][v] > tmp1.maf_cutoff and v not in tmp_exclude_vars or v.split('-')[-1] not in data.include_vars:
                    tmp_exclude_vars.append(v)
            if tmp1.single_markers:
                if v.split('-')[-1] not in data.include_vars:
                    tmp_exclude_vars.append(v)
        haplotypes[i] = listit(haplotypes[i])
        tmp_remain_vars=[x for x in varnames[i] if x not in tmp_exclude_vars]
        recomb_remain_vars=[]
        if len(tmp_remain_vars) == 0:
            recombPos[i]={}
        else:
            if len(recombPos[i]) > 0:
                #extend recombination signal to neighbouring RVs
                #if the original variant is to be excluded
                #Only allow a maximum of one recombination event between one pair of consecutive markers
                for pair in recombPos[i].keys():
                    if pair[1] not in tmp_exclude_vars:
                        if tmp_remain_vars.index(pair[1])!=0 and pair[1] not in recomb_remain_vars:
                            recomb_remain_vars.append(pair[1])
                        else:
                            del recombPos[i][pair]
                    else:
                        if varnames[i].index(pair[1]) > varnames[i].index(tmp_remain_vars[-1]):
                            #last variant
                            del recombPos[i][pair]
                            continue
                        for tmp_idx in range(varnames[i].index(pair[1])+1,len(varnames[i])):
                            if varnames[i][tmp_idx] not in tmp_exclude_vars:
                                if tmp_remain_vars.index(varnames[i][tmp_idx])==0:
                                    #delete recombination pair if the recombination was marked to the first remaining variant
                                    del recombPos[i][pair]
                                    break
                                for tmp_hap in recombPos[i][pair]:
                                    tmp_var=haplotypes[i][tmp_hap][tmp_idx+2]
                                    if tmp_var.endswith(':') or tmp_var.endswith('|'):
                                        haplotypes[i][tmp_hap][tmp_idx+2]=tmp_var[:-1]+'/'
                                if varnames[i][tmp_idx] not in recomb_remain_vars:
                                    recomb_remain_vars.append(varnames[i][tmp_idx])
                                else:
                                    del recombPos[i][pair]
                                break
        for j in range(len(haplotypes[i])):
            haplotypes[i][j] = haplotypes[i][j][:2] + \
              [x for idx, x in enumerate(haplotypes[i][j][2:]) if varnames[i][idx] not in tmp_exclude_vars]
        for tmp_var in varnames[i]:
            if tmp_var not in uniq_vars:
                     uniq_vars.append(tmp_var)
        varnames[i] = [x for x in varnames[i] if x not in tmp_exclude_vars]
        # handle trivial data
        if len(varnames[i]) == 0:
            del varnames[i]
            del haplotypes[i]
        if len(recombPos[i].keys())>tmp1.recomb_max:
            #treat as missing if recombination events occurred more than speicified times
            recombPos[i]={}
            for person in data.families[i]:
                data[person] = tmp1.missings
            del varnames[i]
            del haplotypes[i]
    # count how many variants are removed
    with env.commonvar_counter.get_lock():
        if tmp1.freq_by_fam:
            tmp_ex_vars=[tmp_var for tmp_vars in exclude_vars for tmp_var in tmp_vars]
            env.commonvar_counter.value += len(set(tmp_ex_vars))
        else:
            env.commonvar_counter.value += len(exclude_vars)
    # get total observed variants
    if tmp1.freq_by_fam:
        for item in varnames:
            pop=data.freq_by_fam[item]
            if pop not in data.total_mafs:
                data.total_mafs[pop]={}
                data.total_varnames[pop]=[]
            for v in varnames[item]:
                if v not in data.total_mafs[pop]:
                    data.total_varnames[pop].append(v)
                    data.total_mafs[pop][v]=mafs[item][v]
        for pop in data.total_varnames:
            data.total_varnames[pop]=sorted(data.total_varnames[pop], key=lambda x: int(x.split("-")[0][1:]))
            data.wt_maf[pop]=1.0
            for v,tmaf in data.total_mafs[pop].iteritems():
                data.wt_maf[pop]*=(1-tmaf)
    else:
        data.total_varnames['pop']=[]
        for item in varnames:
            for v in varnames[item]:
                if v not in data.total_mafs:
                    data.total_varnames['pop'].append(v)
                    data.total_mafs[v]=mafs[item][v]
        data.wt_maf['pop']=1.0
        for v,tmaf in data.total_mafs.iteritems():
            data.wt_maf['pop']*=(1-tmaf)
        data.total_varnames['pop']=sorted(data.total_varnames['pop'], key=lambda x: int(x.split("-")[0][1:]))
{% endraw %} {% raw %}
data.total_varnames
{% endraw %} {% raw %}
??cstatgen.HaplotypingEngine()
{% endraw %} {% raw %}
data.wt_maf
{% endraw %} {% raw %}
aa = []
for _ in range(1000):
    a = queue.get()
    tmp.getRegion(a)
    tmp.apply(dd)
    if len(dd.variants) != 0:
        aa.append(a)
{% endraw %} {% raw %}
len(aa)
{% endraw %} {% raw %}
tmp.getRegion(aa[0])
dd = deepcopy(data)
tmp.apply(dd)
{% endraw %} {% raw %}
tmp1.apply(dd)
{% endraw %} {% raw %}
tmp1._MarkerMaker__Haplotype
{% endraw %} {% raw %}
tmp1.freq_by_fam
{% endraw %} {% raw %}
tmp1.count
{% endraw %} {% raw %}
tmp1.mle
{% endraw %} {% raw %}
tmp1.rvhaplo
{% endraw %} {% raw %}
tmp1.apply(dd)
tmp2.apply(dd)
{% endraw %} {% raw %}
tmp1.freq_by_fam
{% endraw %} {% raw %}
tmp1.count
{% endraw %} {% raw %}
env.prephased
{% endraw %} {% raw %}
env.tmp_log
{% endraw %} {% raw %}
haplotypes = OrderedDict()
mafs = {}   ##Per fam per variant
uniq_vars = []
exclude_vars = []
varnames = {}
recombPos = {}
tmp1._MarkerMaker__Haplotype(dd, haplotypes, mafs, varnames,recombPos,uniq_vars,exclude_vars)
{% endraw %} {% raw %}
tm
{% endraw %} {% raw %}
tmp1.recomb_perfam
{% endraw %} {% raw %}
tmp1.apply(dd)
{% endraw %} {% raw %}
tmp2.apply(dd)
{% endraw %} {% raw %}
data.variants
{% endraw %} {% raw %}
dd.include_vars
{% endraw %} {% raw %}
dd.variants
{% endraw %} {% raw %}
tmp1.getRegion(aa[0])
tmp1.apply(dd)
{% endraw %} {% raw %}
env.debug =True
{% endraw %} {% raw %}
data.variants
{% endraw %} {% raw %}
dd.chrom
{% endraw %} {% raw %}
dd.variants
{% endraw %} {% raw %}
tmp.vcf
{% endraw %} {% raw %}
??EncoderWorker
{% endraw %} {% raw %}
env.total_counter.value
{% endraw %} {% raw %}
jobs
{% endraw %} {% raw %}
for j in jobs:
    j.start()
for j in jobs:
    j.join()
faulthandler.disable()
{% endraw %} {% raw %}
    try:
        faulthandler.enable(file=open(env.tmp_log + '.SEGV', 'w'))
        for i in regions:
            if isinstance(queue, list):
                queue.append(i)
            else:
                queue.put(i)
        freq_by_fam_flag = False
        if not args.freq_by_fam is None:
            print('haha')
            freq_by_fam_flag = True
            with open(args.freq_by_fam) as freq_fh:
                for freq_line in freq_fh:
                    tmp_eles=freq_line.split()   #Fam and Population
                    data.freq_by_fam[tmp_eles[0]]=tmp_eles[1]
            data.freq=sorted(list(set(data.freq_by_fam.values())))
        else:
            data.freq=args.freq
        jobs = [EncoderWorker(
            queue, len(regions), deepcopy(data),
            RegionExtractor(args.vcf, chr_prefix = args.chr_prefix, allele_freq_info = data.freq, include_vars_file=args.include_vars),
            MarkerMaker(args.bin, maf_cutoff = args.maf_cutoff,single_markers=args.single_markers,recomb_max=args.recomb_max,af_info=data.freq,freq_by_fam=freq_by_fam_flag,rsq=args.rsq,mle=args.mle, rvhaplo=args.rvhaplo, recomb_perfam=not args.recomb_cross_fam),
            LinkageWriter(len(samples_not_vcf))
            ) for i in range(env.jobs)]
        for j in jobs:
            j.start()
        for j in jobs:
            j.join()
        faulthandler.disable()
    except KeyboardInterrupt:
        # FIXME: need to properly close all jobs
        raise ValueError("Use 'killall {}' to properly terminate all processes!".format(env.prog))
    else:
        env.log('{:,d} units (from {:,d} variants) processed; '\
            '{:,d} Mendelian inconsistencies and {:,d} recombination events handled\n'.\
            format(env.success_counter.value,
                   env.variants_counter.value,
                   env.mendelerror_counter.value,
                   env.recomb_counter.value), flush = True)
        if env.triallelic_counter.value:
            env.log('{:,d} tri-allelic loci were ignored'.format(env.triallelic_counter.value))
        if env.commonvar_counter.value:
            env.log('{:,d} variants ignored due to having MAF > {} and other specified constraints'.\
                    format(env.commonvar_counter.value, args.maf_cutoff))
        if env.null_counter.value:
            env.log('{:,d} units ignored due to absence in VCF file'.format(env.null_counter.value))
        if env.trivial_counter.value:
            env.log('{:,d} units ignored due to absence of variation in samples'.format(env.trivial_counter.value))
        fatal_errors = 0
        try:
            # Error msg from C++ extension
            os.system("cat {}/*.* > {}".format(env.tmp_dir, env.tmp_log))
            fatal_errors = wordCount(env.tmp_log)['fatal']
        except KeyError:
            pass
        if env.chperror_counter.value:
            env.error("{:,d} regional markers failed to be generated due to haplotyping failures!".\
                      format(env.chperror_counter.value))
        if fatal_errors:
            env.error("{:,d} or more regional markers failed to be generated due to runtime errors!".\
                      format(fatal_errors))
        env.log('Archiving regional marker data to directory [{}]'.format(env.cache_dir))
        cache.write(arcroot = 'CACHE', source_dir = env.tmp_cache)
env.jobs = args.jobs
{% endraw %} {% raw %}
tpeds = [os.path.join(env.tmp_cache, item) for item in os.listdir(env.tmp_cache) if item.startswith(env.output) and item.endswith('.tped')]
for fmt in args.format:
    cache.setID(fmt)
    if not args.vanilla and cache.check():
        env.log('Loading {} data from archive ...'.format(fmt.upper()))
        cache.load(target_dir = env.tmp_dir, names = [fmt.upper()])
    else:
        env.log('{:,d} units will be converted to {} format'.format(env.success_counter.value, fmt.upper()))
        env.format_counter.value = 0
        format(tpeds, os.path.join(env.tmp_cache, "{}.tfam".format(env.output)),
               args.prevalence, args.wild_pen, args.muta_pen, fmt,
               args.inherit_mode, args.theta_max, args.theta_inc)
        env.log('{:,d} units successfully converted to {} format\n'.\
                format(env.format_counter.value, fmt.upper()), flush = True)
        if env.skipped_counter.value:
            # FIXME: perhaps we need to rephrase this message?
            env.log('{} region - family pairs skipped'.\
                    format(env.skipped_counter.value))
        env.log('Archiving {} format to directory [{}]'.format(fmt.upper(), env.cache_dir))
        cache.write(arcroot = fmt.upper(),
                    source_dir = os.path.join(env.tmp_dir, fmt.upper()), mode = 'a')
mkpath(env.outdir)
if args.run_linkage:
    cache.setID('analysis')
    if not args.vanilla and cache.check():
        env.log('Loading linkage analysis result from archive ...'.format(fmt.upper()))
        cache.load(target_dir = env.output, names = ['heatmap'])
    else:
        env.log('Running linkage analysis ...'.format(fmt.upper()))
        run_linkage(args.blueprint, args.theta_inc, args.theta_max, args.output_limit)
        env.log('Linkage analysis succesfully performed for {:,d} units\n'.\
                format(env.run_counter.value, fmt.upper()), flush = True)
        if env.makeped_counter.value:
            env.log('{} "makeped" runtime errors occurred'.format(env.makeped_counter.value))
        if env.pedcheck_counter.value:
            env.log('{} "pedcheck" runtime errors occurred'.format(env.pedcheck_counter.value))
        if env.unknown_counter.value:
            env.log('{} "unknown" runtime errors occurred'.format(env.unknown_counter.value))
        if env.mlink_counter.value:
            env.log('{} "mlink" runtime errors occurred'.format(env.mlink_counter.value))
        cache.write(arcroot = 'heatmap', source_dir = os.path.join(env.output, 'heatmap'), mode = 'a')
    html(args.theta_inc, args.theta_max, args.output_limit)
else:
    env.log('Saving data to [{}]'.format(os.path.abspath(env.output)))
    cache.load(target_dir = env.output, names = [fmt.upper() for fmt in args.format])
{% endraw %} {% raw %}
Args.get()
{% endraw %}