示例#1
0
def processhapmap():
	print "parsing hapmap genotypes chrom files"
	parsegenotypes.parsehapmap()
	print "now filtering SNPs"
	b = parsegenotypes.filterSNPs('../genotypes/hapmap')
	print "{0} SNPs filtered out".format(len(b))
	[flips, errors] = parsegenotypes.checkRef('../genotypes/hapmap')
	print "{0} flips and {1} errors".format(len(flips),len(errors))
	#flips = glob.json('../genotypes/hapmapflips')
	#errors = glob.json('../genotypes/hapmaperrors')
	parsegenotypes.flipGeno('hapmapGeno', flips, errors)
示例#2
0
def processgenotypes():
	"""parse genotype files and flip them around according to hg19
	
	"""
	for i, n in enumerate(homedirnames):
		parsegenotypes.parse1KGvcf(vcffiles[i], names1KG[i])
		b = parsegenotypes.filterSNPs(names1KG[i])
		print "{0} SNPs filtered out".format(len(b))
		c = parsegenotypes.checkRef(n)
		print "{0} errors and {1} flipped".format(len(c[1]),len(c[0]))
		#parsegenotypes.corrRef(c[0], n)
		parsegenotypes.flipGeno(n+'Geno', c[0], c[1])