D: 14 Nov 2024 Main functions (--make-grm-bin...) Quick index search |
Variant IDsSignificanceIn some cases we need to change the name of variant IDs. For example, when there are multiple variants. See Linkage tutorial for how we changed the IDs using set-all-var-ids. Later in our analyses, we may want to recover the original IDs.ObjectiveShow how to recover the original variant IDs using a .pvar/VCF/.bim file with the original IDs.Let's recover rs IDs after LD pruning using recover-var-ids. We will use ./data/processed/all_hg38_qcd_LE1 from a prior tutorial. If you do not have this, see Tutorial Shortcuts. We will randomly grab 10 SNPs from the prior renamed dataset (10 is for illustration purposes; the operation is still fast for even larger sets). First we will grab some variants with the altered IDs. We will then compare to when the IDs are recovered. Plink 2: time plink2 \
--pfile ./data/processed/all_hg38_qcd_LE1 \
--make-pgen \
--chr 22 \
--thin-count 10 --seed 111 --threads 1 --memory 8000 require \
--out ./data/processed/all_hg38_qcd_LE1_chr22_thin10
--thin-count 10 --seed 111 --threads 1 --memory 8000 require Randomly sample 10 SNPs. Use the seed, thread, memory parameters for reproducibilty with this tutorial. time plink2 \
--pfile ./data/processed/all_hg38_qcd_LE1_chr22_thin10 \
--recover-var-ids ./data/raw/all_hg38.pvar.zst \
--make-pgen \
--out ./data/processed/all_hg38_qcd_LE1_chr22_thin10_rsids
--recover-var-ids <reference file with the original variant IDs>Main command to revert the variant IDs. The associated file has the original variant IDs that we want to recover (revert). In this case, we do not need to do anything special for the zstd compressed file. --pfile <file that we want to change, recover IDs for> You can pull up the pvar files for both located in ./data/processed/. Below is the last variant for both files; top is the altered (non - rs ID) and the bottom the reverted (rs ID). You can verify this using dbSNP by searching the rsID and confirming the location and alleles keeping in mind the build 38 version. 22 49499362 22:49499362C,G C G AC=2367;AF=0.369613;CM=81.9027;AN=6404;AN_EAS=1170;AN_AMR=980;AN_EUR=1266;AN_AFR=1786;AN_SAS=1202;AN_EUR_unrel=1006;AN_EAS_unrel=1008;AN_AMR_unrel=694;AN_SAS_unrel=978;AN_AFR_unrel=1322;AF_EAS=0.266667;AF_AMR=0.264286;AF_EUR=0.339652;AF_AFR=0.596305;AF_SAS=0.250416;AF_EUR_unrel=0.345924;MAF_EUR_unrel=0.345924;AF_EAS_unrel=0.262897;MAF_EAS_unrel=0.262897;AF_AMR_unrel=0.257925;MAF_AMR_unrel=0.257925;AF_SAS_unrel=0.237219;MAF_SAS_unrel=0.237219;AF_AFR_unrel=0.586989;MAF_AFR_unrel=0.413011;AC_EAS=312;AC_AMR=259;AC_EUR=430;AC_AFR=1065;AC_SAS=301;AC_EUR_unrel=348;AC_EAS_unrel=265;AC_AMR_unrel=179;AC_SAS_unrel=232;AC_AFR_unrel=776;AC_Het_EAS=212;AC_Het_AMR=189;AC_Het_EUR=278;AC_Het_AFR=423;AC_Het_SAS=215;AC_Het_EUR_unrel=224;AC_Het_EAS_unrel=181;AC_Het_AMR_unrel=137;AC_Het_SAS_unrel=168;AC_Het_AFR_unrel=312;AC_Het=1317;AC_Hom_EAS=100;AC_Hom_AMR=70;AC_Hom_EUR=152;AC_Hom_AFR=642;AC_Hom_SAS=86;AC_Hom_EUR_unrel=124;AC_Hom_EAS_unrel=84;AC_Hom_AMR_unrel=42;AC_Hom_SAS_unrel=64;AC_Hom_AFR_unrel=464;AC_Hom=1050;HWE_EAS=0.0901093;ExcHet_EAS=0.970406;HWE_AMR=0.90745;ExcHet_AMR=0.628095;HWE_EUR=0.5956;ExcHet_EUR=0.738179;HWE_AFR=0.627022;ExcHet_AFR=0.715334;HWE_SAS=0.27659;ExcHet_SAS=0.899654;HWE=3.85487e-11;ExcHet=1 22 49499362 rs5770496 C G AC=2367;AF=0.369613;CM=81.9027;AN=6404;AN_EAS=1170;AN_AMR=980;AN_EUR=1266;AN_AFR=1786;AN_SAS=1202;AN_EUR_unrel=1006;AN_EAS_unrel=1008;AN_AMR_unrel=694;AN_SAS_unrel=978;AN_AFR_unrel=1322;AF_EAS=0.266667;AF_AMR=0.264286;AF_EUR=0.339652;AF_AFR=0.596305;AF_SAS=0.250416;AF_EUR_unrel=0.345924;MAF_EUR_unrel=0.345924;AF_EAS_unrel=0.262897;MAF_EAS_unrel=0.262897;AF_AMR_unrel=0.257925;MAF_AMR_unrel=0.257925;AF_SAS_unrel=0.237219;MAF_SAS_unrel=0.237219;AF_AFR_unrel=0.586989;MAF_AFR_unrel=0.413011;AC_EAS=312;AC_AMR=259;AC_EUR=430;AC_AFR=1065;AC_SAS=301;AC_EUR_unrel=348;AC_EAS_unrel=265;AC_AMR_unrel=179;AC_SAS_unrel=232;AC_AFR_unrel=776;AC_Het_EAS=212;AC_Het_AMR=189;AC_Het_EUR=278;AC_Het_AFR=423;AC_Het_SAS=215;AC_Het_EUR_unrel=224;AC_Het_EAS_unrel=181;AC_Het_AMR_unrel=137;AC_Het_SAS_unrel=168;AC_Het_AFR_unrel=312;AC_Het=1317;AC_Hom_EAS=100;AC_Hom_AMR=70;AC_Hom_EUR=152;AC_Hom_AFR=642;AC_Hom_SAS=86;AC_Hom_EUR_unrel=124;AC_Hom_EAS_unrel=84;AC_Hom_AMR_unrel=42;AC_Hom_SAS_unrel=64;AC_Hom_AFR_unrel=464;AC_Hom=1050;HWE_EAS=0.0901093;ExcHet_EAS=0.970406;HWE_AMR=0.90745;ExcHet_AMR=0.628095;HWE_EUR=0.5956;ExcHet_EUR=0.738179;HWE_AFR=0.627022;ExcHet_AFR=0.715334;HWE_SAS=0.27659;ExcHet_SAS=0.899654;HWE=3.85487e-11;ExcHet=1 |