Entering edit mode
8.1 years ago
mm
▴
20
I want to edit my column sex in ped file and place in numbers 2 and 1 instead of F and M . How do I do this Linux?
I want to edit my column sex in ped file and place in numbers 2 and 1 instead of F and M . How do I do this Linux?
awk '{OFS="\t";if($5=="M") {$5="1";} else if($5=="F") {$5="2";} else {$5="0";}print;}' in.ped > out.ped
From: http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml The PED file is a white-space (space or tab) delimited file: the first six columns are mandatory:
Family ID
Individual ID
Paternal ID
Maternal ID
Sex (1=male; 2=female; other=unknown)
Phenotype
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Despite Individual ID Paternal ID Maternal ID- how to build Family ID?
How to build a family ID?