--extract range is excluding my variants

1,164 views
Skip to first unread message

Amirul Hakim

unread,
Aug 14, 2022, 9:46:39 AM8/14/22
to plink2-users
I am working with a .bgen file. I initially carried out the GWAS on the entire chromosome and retrieved a list of SNPs and their positions. However, I wanted to then do a GWAS on certain parts of the chromosome, genes which I am interested in. I used --extract range but it showed be that all variants are excluded from the range. But I know that from the .assoc file and the location of SNPs that some SNPs are meant to be showed. Can anyone help me please? The label, I gave it just an abritary random numbers.

My range file is shown as such
CHR Chromosome code (1-22, X, Y, XY, MT, 0)
BP1 Start of range, physical position in base units 
 BP2 End of range, as above 
 LABEL Name of range/gene For example, 

 1 30000000 35000000 R1 
 1 60000000 62000000 R2 
 1 10000000 20000000 R3

The code I used is this 
plink --bgen data_chr01.bgen --sample data.sample --remove transcriptomic_patient_IDS.txt --extract range extract_dist.txt --pheno pheno.txt --pheno-name Height --covar pheno.txt --covar-name Age, TSat17 --linear --ci 0.95 --maf 0.001 --adjust --out GWAS_chr01_test

Christopher Chang

unread,
Aug 14, 2022, 10:06:35 AM8/14/22
to plink2-users
You did not include .log output, so I basically have no way to help you.

Amirul Hakim

unread,
Aug 14, 2022, 11:41:03 AM8/14/22
to plink2-users
Sorry, is this the .lot output?

>plink --bgen data_chr01.bgen --sample data.sample --remove transcriptomic_patient_IDS.txt --extract range extract_try.txt --allow-extra-chr --pheno pheno.txt --pheno-name Height --covar pheno.txt --covar-name Age, TSat17 --linear --ci 0.95 --maf 0.001 --adjust --out GWAS_chr01_test
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 GWAS_chr01_test.log.
Options in effect:
  --adjust
  --allow-extra-chr
  --bgen data_chr01.bgen
  --ci 0.95

  --covar pheno.txt
  --covar-name Age, TSat17
  --extract range extract_try.txt
  --linear
  --maf 0.001
  --out GWAS_chr01_test
  --pheno pheno.txt
  --pheno-name Height
  --remove transcriptomic_patient_IDS.txt
  --sample data.sample

16333 MB RAM detected; reserving 8166 MB for main workspace.
--bgen: GWAS_chr01_test-temporary.bed + GWAS_chr01_test-temporary.bim +
GWAS_chr01_test-temporary.fam written.
2155158 variants loaded from .bim file.
8941 people (4580 males, 4361 females) loaded from .fam.
3047 phenotype values present after --pheno.
Error: All variants excluded by '--extract range'.

Christopher Chang

unread,
Aug 14, 2022, 11:42:25 AM8/14/22
to plink2-users
Ok.  What are the first few lines of the GWAS_chr01_test-temporary.bim file that's created, and the first few lines of the "--extract range" input file?

Christopher Chang

unread,
Aug 14, 2022, 11:43:14 AM8/14/22
to plink2-users
(meanwhile, as a practical matter, you almost certainly should be using PLINK 2.0 instead of PLINK 1.9 when working with .bgen data)

Amirul Hakim

unread,
Aug 14, 2022, 11:48:40 AM8/14/22
to plink2-users
this is the first few lines got the temporary bim file. I just realise now, is the first colum the chromosome? and if so, is it stating as 0? Thus why its not being able to call for it??

temporary bim file:
0 rs58108140 0 10583 G A
0 rs189107123 0 10611 C G
0 rs180734498 0 13302 C T
0 rs144762171 0 13327 G C
0 rs201747181 0 13957 TC T
0 rs151276478 0 13980 T C
0 rs140337953 0 30923 G T
0 rs199681827 0 46402 C CTGT
0 rs200430748 0 47190 G GA
0 rs187298206 0 51476 T C

--extract range file
X 100584936 100599885 TNMD
20 50934867 50959140 DPM1
1 27612064 27635185 FGR
6 41072974 41102403 NFYA
X 65438549 65534810 LAS1L
7 99238829 99311130 MYH16
X 2691187 2741309 CD99

Amirul Hakim

unread,
Aug 14, 2022, 11:51:09 AM8/14/22
to plink2-users
i might have been using 1.9, let me just re-download. thank you for this advice

Christopher Chang

unread,
Aug 14, 2022, 4:00:17 PM8/14/22
to plink2-users
As for the chromosome values being 0, yes, that's why "--extract range" didn't work.  You should be able to address this by importing the .bgen with the --oxford-single-chr flag.
Reply all
Reply to author
Forward
0 new messages