This is a test version of Biostars. For the public version, visit https://www.biostars.org.
PLINK: Change affection status

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

ok, thanks! That simplifies my job considerably!!

2 answers

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.

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?

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

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

Log in to answer this question.