Unrecognized flag errors with recode

1,501 views
Skip to first unread message

emily....@live.com.au

unread,
Oct 5, 2017, 10:48:00 PM10/5/17
to plink2-users
Hi there,

I'm trying to use PLINK2 to convert my .ped and .map files to a VCF, as in the examples below:

plink2 --ped test.ped  --map .test.map --recode vcf --out testVCF
plink2 --file test --recode vcf --out testVCF

However, I am thrown the errors:

Error: Unrecognized flag ('--ped').
Error: Unrecognized flag ('--file').

I really want to use PLINK2 because (to my understanding), PLINK2 addresses the issue of REF allele assignment. I don't have a file with the correct reference alleles so I can't address this in plink.

Thanks in advance for any insight.

Christopher Chang

unread,
Oct 6, 2017, 2:07:26 AM10/6/17
to plink2-users
plink 2.0 alpha is intended to be more of a companion to 1.9 rather than a replacement.  In particular, while --ped and --file will eventually be added to 2.0 for convenience's sake, that's a lower priority than enabling some crucial operations which are currently impossible with any plink version.  When you run into an "Unrecognized flag" error, just use 1.9 for now.  (Specifically, for older file formats, start with 1.9 to convert to .bed+.bim+.fam (--make-bed); then 2.0 can read the data.)

As for setting the correct reference alleles, that *always* requires some sort of reference genome file.  plink 2.0 currently has the --ref-allele flag to scrape reference allele assignments from a VCF or similar file; if your variants are in e.g. 1000 Genomes, that may be enough to get by (though you may need to do a bit of work matching the variant ID naming schemes).  (Let me know if you have questions about downloading 1000 Genomes Project files.)  Otherwise, you should download a fasta file for the appropriate reference genome build; plink 2.0 should soon have a flag that can set at least SNP reference alleles correctly from the fasta, though deletions and some other variants will remain ambiguous.

Debashree Ray

unread,
Jul 19, 2019, 12:03:52 PM7/19/19
to plink2-users
Hi,
I am getting the same error when trying to convert bed/bim/fam to vcf using plink-1.9. I have re-installed the latest version and still getting unrecognized flag error for --bfile and --recode.

I am using the command ./plink-1.9_2019Jul19/plink --bfile datchr22 --recode vcf-iid --out datchr22

PLINK v1.90b6.10 64-bit (17 Jun 2019)          www.cog-genomics.org/plink/1.9/
(C) 2005-2019 Shaun Purcell, Christopher Chang   GNU General Public License v3
Error: Unrecognized flag
('--bfile datchr22 --recode').
For more information, try "plink --help <flag name>" or "plink --help | more".

Any help will be highly appreciated. Thanks!

Christopher Chang

unread,
Jul 19, 2019, 12:19:43 PM7/19/19
to plink2-users
I would delete and retype the spaces in between "--bfile", "datchr22", and "--recode".  It sounds like you've copied and pasted characters which look like basic spaces, but are actually other nonstandard characters.

Debashree Ray

unread,
Jul 19, 2019, 2:14:06 PM7/19/19
to plink2-users
Much thanks, that worked!
Reply all
Reply to author
Forward
0 new messages