This is a test version of Biostars. For the public version, visit https://www.biostars.org.
plink logistic regression error

I'm running the following command with Plink 1.90b6.26:

plink --bfile European.imputed.merged.cleanedx --logistic --pheno ../European.pheno.plink.tsv --pheno-name event --covar ../European.pheno.plink.tsv --covar-name age,Sex,PC1,PC2 –-ci 0.95 --out t2d_basic_model.txt

where the first 10 rows of ../European.pheno.plink.tsv are

FID IID event   age Sex PC1 PC2
MZEDVVQN    0   0   54.0    50.0    1.0 51.70
ZAAVNBZ 1   0   84.0    80.0    0.0 21.30
ZABDDNB 2   0   86.0    83.0    0.0 31.86
ZACEBGQ 3   0   79.0    72.0    1.0 31.08
ZADQQCN 4   0   70.0    65.0    1.0 28.55
ZAGCNV  5   0   53.0    51.0    1.0 41.21
ZAGZNNG 6   0   67.0    61.0    1.0 27.32
ZBAABVZN    7   0   63.0    50.0    0.0 29.04
MZDCVQEC    8   0   54.0    51.0    0.0 32.13

Unfortunately, I cannot post the bed file as it is binary.

which gives the output:

PLINK v1.90b6.26 64-bit (2 Apr 2022)
www.cog-genomics.org/plink/1.9/ (C) 2005-2022 Shaun Purcell, Christopher Chang GNU General Public License v3 Logging to t2d_basic_model.txt.log. Options in effect: --bfile European.imputed.merged.cleanedx --covar ../European.pheno.plink.tsv --covar-name age,Sex,PC1,PC2 –-ci 0.95 --logistic --out t2d_basic_model.txt --pheno ../European.pheno.plink.tsv
--pheno-name event

23947 MB RAM detected; reserving 11973 MB for main workspace. 11538876 variants loaded from .bim file. 2501 people (0 males, 0 females, 2501 ambiguous) loaded from .fam. Ambiguous sex IDs written to t2d_basic_model.txt.nosex . 0 phenotype values present after --pheno. Using 1 thread (no multithreaded calculations invoked). Error: Missing --covar-name token in --covar file header line.

but the problem is that all --covar-name tokens are present in the header of ../European.pheno.plink.tsv

This error message doesn't appear to be correct, but maybe I missed something.

How can I get this logistic regression working?

plink

Please post a fileset (could contain just 1 variant, and fake phenotype/covariate data) that allows me to replicate what you're seeing.

I've updated the post with the first 10 lines from the pheno file. I cannot post the bed file, as it's binary

That 10-line .pheno.tsv excerpt, and .log file, do reveal two problems with your input:

  1. The sample with FID="MZEDVVQN" has IID="0", which is not allowed.
  2. Your .fam file has no sex information, and you did not run with --allow-no-sex. This actually isn't a problem when using plink 2.0 --logistic, but plink 1.9 will throw all unknown-sex samples out of the logistic regression unless you specify --allow-no-sex. (No, it doesn't automatically scrape sex information from the "Sex" covariate.)

However, it does not allow me to replicate the "Missing --covar-name token" error you are seeing. (Try copying and pasting that 10-line excerpt to a new file, and then providing that new file as input to --pheno and --covar. Does the error still occur on your end?)

thanks, I've fixed the two issues that you mentioned.

Perhaps there is something wrong with the input bed file itself?

I made the input bed file via plink2:

plink2 --vcf European.imputed.merged.cleaned.vcf.gz --out eu --make-bed European.imputed.merged.cleanedx

perhaps that command was wrong?

No, this relates to your .tsv.

You haven't said whether you can reproduce the error by copying and pasting the 10 lines you posted in this webpage. If you can't, it should be obvious why I can't, and it's basically impossible for me to provide further help until you post enough information to allow error replication.

0 answers

No answers yet.

Log in to answer this question.