PLINK: Change affection status
2
1
Entering edit mode
9.4 years ago
bsmith030465 ▴ 240

Hi,

I need to change the affection status in my PLINK files (data1.bed, data1.bim, data1.fam) to '2' for all samples. To do this, I was thinking of:

1. Convert bed to ped using:

plink --bfile data1 --recode --tab --out data2

2. Copy data1.fam as data2.fam

3. Change the 6th column of both the data2.fam and data2.ped files so that the new affection status is '2' for everything

4. Convert the modified ped file back to bed using:

plink --ped data2.ped --map data2.map

Do these steps look complete and correct for what I am trying to do?

Thanks

plink • 7.6k views
ADD COMMENT
2
Entering edit mode
9.4 years ago

You could:

1) Change the affected status in the fam file. Smaller file, less steps.

or

2) Use the option --pheno to use an alternate phenotype.

ADD COMMENT
0
Entering edit mode

Yes, I could change the status in the fam file, but the old status would still remain in the bed file. Won't that be problematic for downstream analysis?

ADD REPLY
1
Entering edit mode

No status in the bed file.

ADD REPLY
1
Entering edit mode
5.9 years ago

You can simply use the following code to get plink bed files with new phenotype:

plink --bfile PlinkBed --pheno replacementPhenotypes --make-bed  --out PlinkBedWithPheno
ADD COMMENT

Login before adding your answer.

Traffic: 3038 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6