Created
March 11, 2013 15:08
-
-
Save indapa/5134896 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pedobjects=[] #list of pedobjects, represents lines in a pedfile | |
pedfh=open(options.pedfile, 'r') | |
for line in pedfh: | |
fields=line.strip().split('\t') | |
(fid,iid,pid,mid,sex,phenotype)=fields[0:6] | |
phenotype=int(phenotype) | |
pedobjects.append( Ped(fid,iid,pid,mid,sex,phenotype) ) | |
#the phenotype status is set to 2 if the sample is affected: http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped | |
affecteds=[ pedobj.getid() for pedobj in pedobjects if pedobj.getpheno() == 2 ] | |
unaffecteds=[ pedobj.getid() for pedobj in pedobjects if pedobj.getpheno() == 1 ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment