Repository navigation
VCF and bfile sample IDs mismatch
This may occur when sample IDs were anonymised during data upload to an imputation server. Then, the IDs in the VCF files do not match the IIDs in the PLINK .fam file, and PLINK may report that no samples remain after --keep in 01g.
Create a two-column mapping file without a header:
OLD_ID_1 NEW_ID_1
OLD_ID_2 NEW_ID_2
Then update the VCF IDs with PLINK 2:
for chr in {1..22}; do
plink2 \
--vcf "chr${chr}.vcf.gz" \
--update-ids id_map.txt \
--export vcf bgz id-paste=iid \
--out "chr${chr}_ids_updated"
doneThe id-paste=iid option ensures that only the IID is written to the VCF header, rather than a combined FID_IID value. This is because a VCF file can only store each ID in one column.
Check the updated IDs before rerunning the pipeline:
zgrep -m1 '^#CHROM' chr1_ids_updated.vcf.gz | less -SThe line should contain the IIDs your bfiles have:
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT SAMPLE_1 SAMPLE_2 ...
PLINK 2 documentation:
- Home
- Frequently Asked Questions
- Participation requirements
- Submit an issue or start a discussion
- System requirements and pipeline installation
0. Set up folders
1a. Check data
1b. Process genetic data
1c. Check methylation and phenotypes
1d. mQTL control GWAS
1e. GWAS of genetic PCs
1f. Cross-cohort normalisation of methylation data
1g. Compute haplotype components
1 upload. Upload to Bristol SFTP
2a. Relatedness assessment/removal
2b. Regular and variance EWAS
3a. Run meQTL analysis
3b. Run variance meQTL analysis