Skip to content

Instantly share code, notes, and snippets.

@lorenapr92
lorenapr92 / Parsing.final
Created April 3, 2018 15:13
Parsing python code for vcf files. We can use this to parse vcf file based on their POS for specific genes
import sys
infile = 'chr7first300.vcf'
class ParseV:
def __init__(self,infile,List=None,samplestuff=None):
self.infile = infile
self.List = []
self.samplestuff=[] # creates a new empty list, think this addresses the problem from last time where the mistaken use of class variable with a mutable data type?
#This will parse out the SNPs from chr 7 Foxp2 gene into a vcf file, from phase 3 1000 genomes project, all subjects genome build 37
#Jennifer Owen
#Stephanie Perez Robles
#Lisa Dimusto
import sys
infile = 'ALL.chr7.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf'
class ParseV:
#This will parse out the SNPs from chr 6 KIAA0319 gene into a vcf file, from phase 3 1000 genomes project, all subjects genome build 37
#Jennifer Owen
#Stephanie Perez Robles
#Lisa Dimusto
import sys
infile = 'ALL.chr6.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf'
class ParseV:
#This will parse out the SNPs from chr 7 CNTNAP2 gene into a vcf file, from phase 3 1000 genomes project, all subjects genome build 37
#Jennifer Owen
#Stephanie Perez Robles
#Lisa Dimusto
import sys
infile = 'ALL.chr7.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf'
class ParseV:
#This code will convert sequences into amino acids by using the gencode table below.
#Jennifer Owen
#Stephanie Perez
#Lisa DiMusto
import sys
import re