How to convert genotypes "1, 2" to "0,1, 2"?

1

Hi everyone,

I have genotypes with the codes of 1 and 2. For my aim, I must convert them to 0, 1, and 2. I found that plink can do it. So, I run them by plink with the use of the below codes.

shell("plink --file r --maf 0.05 --geno 0.01 --mind 0.1 --hwe 1e-6
--nonfounders --horse --recode --out rk")

3011 3011 2788 2327 1 1.4625 2 2 1 1 1 2 2 2 1 2 1 1 2 2 2 1 1 2 1 2 1 1 2

shell("plink --file r --maf 0.05 --geno 0.01 --mind 0.1 --hwe 1e-6
--nonfounders --horse --recodeA --out rA")

3011 3011 2788 2327 1 1.4625 0 0 1 0 1 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1

shell("plink --file r --maf 0.05 --geno 0.01 --mind 0.1 --hwe 1e-6
--nonfounders --horse --recodeAD --out rAD")

3011 3011 2788 2327 1 1.4625 0 0 0 0 1 1 0 0 1 1 0 0 0 0 1 1 1 1 1 1 0 0 1

By the use of "--recode", I only see 1 and 2 codes.For "--recodeA" and "--recodeAD" options, they generated codes 0, 1, 2. But when I compared the results of them, they are different in genomic regions.

How can I have accurately converted genotypes (0,1,2) from my data?
Which option in plink is suitable for my work?

Thanks


convert


snp

• 30 views



Source link