Plink2 --keep Removing All Samples
1
1
Entering edit mode
2.4 years ago
J ▴ 20

I am trying to include the --keep and --remove options in my plink2 command. I am finding that despite my files for these options having identical text to the main file's IDs, all the samples are removed.

Command: plink2 --bfile  pca_final --keep EUR.sample --remove toberemoved.txt \
--make-bed --out unrelated_EUR

So my original .fam file has:

0002

The --keep file would have:

#FID    IID
0002    0002

The --remove file would have:

#FID    IID
1067    1067
plink plink2 • 2.0k views
ADD COMMENT
0
Entering edit mode

Do you have the full header of the .fam file? The file format of your .fam seems to be wrong.

ADD REPLY
0
Entering edit mode
0   0002    0   0   0   -9
0   0005    0   0   0   -9
0   0007    0   0   0   -9
0   0008    0   0   0   -9
0   0009    0   0   0   -9

The code I used to make the given fam and other files:

plink2 --vcf $FILE_PATH --make-bed --out working/all_vcf_for_pc --threads 4 --max-alleles 2

plink2 --bfile all_vcf_for_pc --chr 1-22 --exclude range LD_exclude_grch38_pca.txt --geno 0.05 --hwe 1E-6 midp --indep-pairwise 50 5 0.05 \
--keep-allele-order --mac 5 --maf 0.01 --out bqc19_pca --threads 4

plink2 --bfile all_vcf_for_pc --extract pca.prune.in --make-bed --out pca_final
ADD REPLY
2
Entering edit mode
2.4 years ago
J ▴ 20

I was able to figure out the issue. The FID column (the first column in the fam file) was all zeroes and I put text there as I was confused by the format used by my colleague.

ADD COMMENT

Login before adding your answer.

Traffic: 2773 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6