Filtering variants by rsid and alternate allele

Issue #61 invalid
Leda Coelewij
created an issue


I'm trying to subset a bgen file to only include a specific list of variants (total of 3516 variants). I've tried using the -incl-variants flag, which looks as follows:


this however creates a bgen file with 0 SNPs in the output.

If I add the option -compare-variants-by rsid, I get more variants than expected (3527). I've been able to see that the extra variants are ones with the same rsid, but a different alleleB.

So I'm wondering if there's a way to filter variants by rsid and alleles?

Thank you, Leda

Comments (4)

  1. Gavin Band repo owner

    Hi, You don't say what data you are passing in. By default it matches on SNPID, rsid, chromosome, position, and alleles. You may want e.g.

    -compare-variants-by rsid,position,alleles

    to avoid matching on the SNPID but match everything else.

    If this still doesn't work, it's best to check what the fields look like in the input data, for example qctool -g <input file> -og - will be informative.

    Best, g.

  2. Log in to comment