Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readBGENToMatrixByRange cannot found variants but not so after pruning by PLINK2 #15

Open
garyzhubc opened this issue Feb 8, 2021 · 3 comments

Comments

@garyzhubc
Copy link

garyzhubc commented Feb 8, 2021

Why is it that the dimension increased after pruning? In PLINK2 I did:

./plink2 --bgen ukb_imp_chr1_v3.bgen ref-first --sample ukb51283_imp_chr1_v3_s487283.sample --indep-pairwise 50 25 0.2 --rm-dup exclude-all --out ukb_imp_chr1_v3

./plink2 --bgen ukb_imp_chr1_v3.bgen ref-first --sample ukb51283_imp_chr1_v3_s487283.sample --extract ukb_imp_chr1_v3_pruned.prune.in --export bgen-1.2 bits=8 --out ukb_imp_chr1_v3_pruned

Then I use seqminer to check the dimension.

> library(seqminer)

> end_pos <- 1000000

> ukb_imp_chr1_v3.bgen <- "ukb_imp_chr1_v3.bgen"

> ukb_imp_chr1_v3_pruned.bgen <- "ukb_imp_chr1_v3_pruned.bgen"

> ukb_imp_chr1_v3.bgen <- readBGENToMatrixByRange(ukb_imp_chr1_v3.bgen, paste0("1:1-", format(end_pos, scientific=F)))

1 region to be extracted.

> ukb_imp_chr1_v3_pruned.bgen <- readBGENToMatrixByRange(ukb_imp_chr1_v3_pruned.bgen, paste0("1:1-", format(end_pos, scientific=F)))

1 region to be extracted.

> dim(ukb_imp_chr1_v3.bgen[[1]])

[1]      0 487409

> dim(ukb_imp_chr1_v3_pruned.bgen[[1]])

[1]   1008 487409

It means there wasn't any variant between POS 1 to 1000000 in the original file (which isn't the case) and now there are 1008 variants after pruning. This is very strange.

@zhanxw
Copy link
Owner

zhanxw commented Feb 8, 2021

@garyzhubc What is the version of your PLINK2?

@zhanxw
Copy link
Owner

zhanxw commented Feb 8, 2021 via email

@garyzhubc
Copy link
Author

My PLINK2 should be the latest stable version: alpha 2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants