Force PLINK2 to neglect chrX as the sex chromosome
1
2
Entering edit mode
7 weeks ago
8armed ▴ 20

I'd like to run PLINK2 on a vcf file to do linkage pruning, followed by a PCA. The input vcf file is from a non-human organism. I have already excluded the known sex chromosome from the vcf file. However, when I run PLINK2, I always get an error since it recognizes chrX as the sex chromosome. How can I force PLINK2 to treat chrX as a normal autosome (which is the case in my species). PLINK2 makes a few suggestions for how one may solve the error (see below the error message), but I don't find any of those solutions straight forward to simply force PLINK2 to not treat chrX as the sex chromosome. Notably, when I instead run PLINK (and not PLINK2), I don't get a respective error.

Here the command I run for linkage pruning:

plink2 \
--vcf ${FILE}.vcf \
--allow-extra-chr \
--set-all-var-ids @:# \
--indep-pairwise 50 10 0.3 \
--make-bed \
--out ${FILE}_pruningFact.0.3 

Here the error I'm getting:

Error: chrX is present in the input file, but no sex information was provided;
rerun this import with --psam or --update-sex.  --split-par may also be
appropriate.
PLINK2 • 486 views
ADD COMMENT
1
Entering edit mode
6 weeks ago

(cross-posted from https://groups.google.com/g/plink2-users/c/Qphx_6BpPII )

You need to use --chr-set, not --allow-extra-chr, to specify a nonhuman chromosome set.

Your command line was just as wrong for PLINK 1.9 as it was for PLINK 2.0, but PLINK 2.0 has better sanity-checking.

ADD COMMENT
0
Entering edit mode

Thanks for your answer! Yet, I'm still confused. I don't understand why "--allow-extra-chr" doesn't work, as it should just ignore the chromosome-ID, no? At least in plink1.9, it seems to work fine but no longer for plink2.0.

Also, I'm not sure how I should correctly use the "--chr-set" flag. The description is rather cryptic to me. How do I use this flag if I wanted to specify that the data I'm using is WGS-snp data set from a non-human species from 20 autosomes? And what would I' need to do if I wanted to additionally just run plink2 for all those autosomes plus the two known sex chromosomes in my species (the sex chromosomes are named "chrY" and "chrXIX" in my species)?

Thanks again for your help!

ADD REPLY

Login before adding your answer.

Traffic: 1467 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