@@ -13,12 +13,12 @@ file or another ped based alternative.
1313
1414.ped and .fam always have 6 columns, these are
1515
16- Family_ID - '.' or '0' for unknown
17- Individual_ID - '.' or '0' for unknown
18- Paternal_ID - '.' or '0' for unknown
19- Maternal_ID - '.' or '0' for unknown
20- Sex - '1'=male; '2'=female; [ 'other', '0', '.'] =unknown
21- Phenotype - '1'=unaffected, '2'=affected, [ '-9', '0', '.'] = missing,
16+ Family_ID - '.' or '0' for unknown\n
17+ Individual_ID - '.' or '0' for unknown\n
18+ Paternal_ID - '.' or '0' for unknown\n
19+ Maternal_ID - '.' or '0' for unknown\n
20+ Sex - '1'=male; '2'=female; [ 'other', '0', '.'] =unknown\n
21+ Phenotype - '1'=unaffected, '2'=affected, [ '-9', '0', '.'] = missing\n
2222
2323The other types must specify the columns in the header.
2424Header always start with '#'.
@@ -118,10 +118,35 @@ Ped like objects can be created from within a python program and convert them to
118118
119119 > from ped_parser import Individual, Family
120120
121+ > outfile = open (' my_family.ped' ,' a' )
121122 > my_individuals = []
122- > my_individuals.append(Individual(' proband' , family = ' 1' , mother = ' mother' , father = ' father' ,sex = ' 1' ,phenotype = ' 2' ))
123- > my_individuals.append(Individual(' mother' , family = ' 1' , mother = ' 0' , father = ' 0' ,sex = ' 2' ,phenotype = ' 1' ))
124- > my_individuals.append(Individual(' father' , family = ' 1' , mother = ' 0' , father = ' 0' ,sex = ' 1' ,phenotype = ' 1' ))
123+ > my_individuals.append(Individual(
124+ ' proband' ,
125+ family = ' 1' ,
126+ mother = ' mother' ,
127+ father = ' father' ,
128+ sex = ' 1' ,
129+ phenotype = ' 2'
130+ )
131+ )
132+ > my_individuals.append(Individual(
133+ ' mother' ,
134+ family = ' 1' ,
135+ mother = ' 0' ,
136+ father = ' 0' ,
137+ sex = ' 2' ,
138+ phenotype = ' 1'
139+ )
140+ )
141+ > my_individuals.append(Individual(
142+ ' father' ,
143+ ' family' = ' 1' ,
144+ ' mother' = ' 0' ,
145+ ' father' = ' 0' ,
146+ ' sex' = ' 1' ,
147+ ' phenotype' = ' 1'
148+ )
149+ )
125150 > my_family = Family(family_id = ' 1' )
126151 > for individual in my_individuals:
127152 my_family.add_individual(individual)
0 commit comments