from genda.formats.panVCF import VCF from genda.formats.Snp_array import SNP_array from genda.formats.PED import PED v = VCF('./tests/data/chr22.test.vcf') #Preview VCF v.vcf.ix[0:10,0:7] #Preview genotype matrix v.geno.ix[0:10,0:7] #Load in data from a SNP array which is formatted with both alleles in one column (eg. 23 and me data) s = SNP_array('./tests/data/one-column-test-data', fileformat='one column', delim = '\t', encoding = {'rs4477212':'A/G','rs3094315':'A/G','rs3131972':'G/A','rs12124819':'A/G','rs11240777':'A/G',\ 'rs6681049':'C/T','rs4970383':'T/C','rs4475691':'T/C','rs7537756':'A/T'}) #Preview data from SNP array s.df.ix[0:10,:] #Preview genotype data from SNP array s.geno.ix[0:10,:] #Load in data form a SNP array with two columns representing the alleles of an individual t = SNP_array('tests/data/two-column-test-data', fileformat = 'two column', delim = '\t',\ encoding = {'rs4477212':'A/G','rs3094315':'A/G','rs3131972':'G/A','rs12124819':'A/G',\ 'rs11240777':'A/G','rs6681049':'C/T','rs4970383':'T/C','rs4475691':'T/C','rs7537756':'A/T'}) #Preview data t.df.ix[0:10,0:4] #Preview genotype matrix t.geno.ix[0:10,0:7] #Load in a PED file p = PED('tests/data/test.ped', 'tests/data/test.map', {'snp1':'A/C','snp2':'A/C','snp3':'C/A','snp4':'T/G','snp5':'C/A'}) #See the parsed out PED file p.PED #See parsed out MAP file p.MAP #Vieing the genotype matrix p.geno