PCA --read-freq warning: 0 variants loaded

74 views
Skip to first unread message

Noel Clark

unread,
Jul 23, 2024, 4:55:29 PM7/23/24
to plink2-users
Hi, I am brand new to PLINK so this might be a relatively simple question, but I was confused by the output of my log file after running PCA. 

1) I initially ran --freq using the following lines of code:
" plink2 --bcf {input.bcf}  --freq --set-missing-var-ids @:#[b37]\$r,\$a  --allow-extra-chr --not-chr NC_048593.1 --out {output.afreq} 2> {log} "

2) Then I ran --pca with this code:
" plink2 --bcf {input.bcf}  --read-freq {input.afreq} --pca --allow-extra-chr --not-chr NC_048593.1 --out {output.pca} 2> {log} "

Attached are the two log files for each of those runs. I am confused in the pca.log file why it says that 0 variants were loaded from the afreq file, and why it gives a warning that all 14057294 entries were skipped (due to missing variant IDs, mismatching
allele codes, and/or zero observations - what does that mean?). I plotted the resulting first and second PC axes and my samples are clustering according to our expectations, but the 0 variants loaded and warning raised a reg flag. Any guidance would be much appreciate, thank you!
snps-no-y.afreq.log
snps-no-y-pca.log

Christopher Chang

unread,
Jul 24, 2024, 12:07:05 AM7/24/24
to plink2-users
You included "--set-missing-var-ids @:#[b37]\$r,\$a" in the first run, but not the second.

Noel Clark

unread,
Jul 24, 2024, 3:19:36 PM7/24/24
to plink2-users
Okay, thank you for that update! I was confused because I checked the .afreq file and the variants were renamed according to the flag format so I didn't think I needed to include "--set-missing-var-ids @:#[b37]\$r,\$a" again, but it seems like that's needed to properly read in the BCF file each time (unless you save a new BCF with the renamed variant ids, correct?). Am I understanding that properly?

Thanks so much again for the clarification. 

Christopher Chang

unread,
Jul 29, 2024, 12:30:10 AM7/29/24
to plink2-users
Reply all
Reply to author
Forward
0 new messages