bgen and qctool

13 views
Skip to first unread message

Giulia Pontali

unread,
Nov 3, 2025, 9:46:01 AM (6 days ago) Nov 3
to plink2-users

Hi,

I need to prepare a .bgen file to use with qctool. I’m currently running the following command:


plink2 --pfile chr22 --export bgen-1.2 bits=8 id-paste=fid,iid id-delim=: --out mydata

However, when I run qctool, I get the following error:

qctool -g mydata.bgen -snp-stats -osnp out


!! Error (genfile::BadArgumentError): In argument(s) order_type=6, value_type=1 to function genfile::ToGP::set_number_of_entries(): Unsupported order_type/value_type combination..

Would you like me to also help explain or fix the actual error (Unsupported order_type/value_type combination)?
It’s likely due to how plink2 exports the BGEN format (especially with bits=8) and qctool not supporting that combination.

than you, 
Giulia

Chris Chang

unread,
Nov 3, 2025, 9:48:30 AM (6 days ago) Nov 3
to Giulia Pontali, plink2-users
Please post a full .log file when asking for troubleshooting help.

--
You received this message because you are subscribed to the Google Groups "plink2-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plink2-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/plink2-users/83407a75-2d0f-49c4-968c-43f2469bf1c6n%40googlegroups.com.

Giulia Pontali

unread,
Nov 3, 2025, 10:50:27 AM (6 days ago) Nov 3
to Chris Chang, plink2-users

Welcome to qctool

(version: 2.2.0, revision: unknown)


(C) 2009-2020 University of Oxford


Opening genotype files                                      : [******************************] (1/1,0.0s,23.4/s)

========================================================================


Input SAMPLE file(s):         Output SAMPLE file:             "(n/a)".

Sample exclusion output file:   "(n/a)".


Input GEN file(s):

                                                    ( 219305 snps)  "mydata.bgen (bgen v1.2; 9219 named samples; zlib compression)"

                                         (total 219305 snps in 1 sources).

                      Number of samples: 9219

Output GEN file(s):             (n/a)

Output SNP position file(s):    (n/a)

Sample filter:                  .

# of samples in input files:    9219.

# of samples after filtering:   9219 (0 filtered out).


========================================================================


SNPSummaryComponent: the following components are in place:

  HWEComputation

  AlleleFrequencyComputation

  InfoComputation

  MissingnessComputation


Processing SNPs                                             :  (0/?,0.1s,0.0/s)

========================================================================


Number of SNPs:

                     -- in input file(s):                 219305.

 -- in output file(s):                0


Number of samples in input file(s):   9219.


========================================================================


!! Error (genfile::BadArgumentError): In argument(s) order_type=6, value_type=1 to function genfile::ToGP::set_number_of_entries(): Unsupported order_type/value_type combination..


Thank you for using qctool.

Chris Chang

unread,
Nov 3, 2025, 10:54:14 AM (6 days ago) Nov 3
to Giulia Pontali, plink2-users
And the plink2 .log?

Giulia Pontali

unread,
Nov 3, 2025, 10:55:11 AM (6 days ago) Nov 3
to Chris Chang, plink2-users

PLINK v2.00a6LM AVX2 Intel (26 May 2024)

Options in effect:

  --export bgen-1.2 bits=8 id-paste=fid,iid id-delim=:

  --out mydata

  --pfile chr22


Hostname: hnode02

Working directory: /scratch/giulia.pontali/belive_qctool

Start time: Mon Nov  3 16:49:27 2025


Random number seed: 1762184967

384915 MiB RAM detected, ~353068 available; reserving 192457 MiB for main

workspace.

Using up to 40 threads (change this with --threads).

9219 samples (0 females, 0 males, 9219 ambiguous; 9219 founders) loaded from

chr22.psam.

219305 variants loaded from chr22.pvar.

Note: No phenotype data present.

Warning: Unphased heterozygous hardcalls in partially-phased variants are

poorly represented with bits=8.

It is necessary to use e.g. --dosage-erase-threshold 0.006 to re-import them

cleanly.

Writing mydata.bgen ... done.

Writing mydata.sample ... done.


End time: Mon Nov  3 16:49:32 2025

Chris Chang

unread,
Nov 3, 2025, 11:17:53 AM (6 days ago) Nov 3
to Giulia Pontali, plink2-users
Try rerunning with a newer plink2 build; there was a bgen-export bugfix in Oct 2024.

If that doesn’t work, is it possible for you to post a plink2 dataset (could contain just the first few variants of chr22) that is sufficient to exhibit the problem?
Reply all
Reply to author
Forward
0 new messages