Comments (9)
I could not reproduce this error. If it persists after restarting your R session, could you please share sessionInfo()
?
from genesis.
was there a solution to this?
from genesis.
Restart your R session. If that doesn't work and you are seeing this error, please share sessionInfo()
.
from genesis.
from genesis.
Hate to dredge this up again, but I'm getting the same error. Here's my sessionInfo()
Edit to add that I have restarted R and encounter the same issue.
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] GENESIS_2.20.0 SNPRelate_1.24.0 gdsfmt_1.26.1
loaded via a namespace (and not attached):
[1] quantsmooth_1.56.0 Rcpp_1.0.5 lattice_0.20-41 tidyr_1.1.2 Biostrings_2.58.0
[6] formula.tools_1.7.1 zoo_1.8-8 digest_0.6.27 lmtest_0.9-38 foreach_1.5.1
[11] R6_2.5.0 GenomeInfoDb_1.26.2 backports_1.2.0 MatrixModels_0.4-1 stats4_4.0.3
[16] RSQLite_2.2.1 pillar_1.4.7 zlibbioc_1.36.0 rlang_0.4.9 rstudioapi_0.13
[21] data.table_1.13.4 SparseM_1.78 blob_1.2.1 S4Vectors_0.28.1 Matrix_1.2-18
[26] splines_4.0.3 GWASExactHW_1.01 RCurl_1.98-1.2 bit_4.0.4 tinytex_0.28
[31] broom_0.7.3 compiler_4.0.3 xfun_0.19 pkgconfig_2.0.3 BiocGenerics_0.36.0
[36] mgcv_1.8-33 tidyselect_1.1.0 tibble_3.0.4 GenomeInfoDbData_1.2.4 DNAcopy_1.64.0
[41] IRanges_2.24.1 codetools_0.2-18 matrixStats_0.57.0 crayon_1.3.4 dplyr_1.0.2
[46] conquer_1.0.2 bitops_1.0-6 grid_4.0.3 nlme_3.1-151 lifecycle_0.2.0
[51] DBI_1.1.0 magrittr_2.0.1 SeqVarTools_1.28.1 XVector_0.30.0 mice_3.12.0
[56] ellipsis_0.3.1 generics_0.1.0 vctrs_0.3.6 sandwich_3.0-0 iterators_1.0.13
[61] tools_4.0.3 bit64_4.0.5 Biobase_2.50.0 glue_1.4.2 purrr_0.3.4
[66] parallel_4.0.3 survival_3.2-7 SeqArray_1.30.0 GenomicRanges_1.42.0 GWASTools_1.36.0
[71] operator.tools_1.6.3 memoise_1.1.0 logistf_1.24 quantreg_5.75
from genesis.
I think this is an error that can be resolved by restarting R. Can you try starting a brand-new R session and running the following?
library(GENESIS)
library(SNPRelate)
gdsfile <- system.file("extdata", "HapMap_ASW_MXL_geno.gds", package="GENESIS")
gds <- snpgdsOpen(gdsfile)
class(gds) # should see "SNPGDSFileClass"
data("HapMap_ASW_MXL_KINGmat")
mypcair <- pcair(gds, kinobj = HapMap_ASW_MXL_KINGmat, divobj = HapMap_ASW_MXL_KINGmat)
snpgdsClose(gds)
from genesis.
Hello, I am having the same issue but this time with pcrelate. I am wondering if the R version or the version of the packages could be the issue?
I have run the above code in a new R session, but with pc relate at the end (like below) but pcrelate still generates the error, any thoughts?
Code that is sufficient to produce error, R v 4.1.3 :
library(GENESIS)
library(SNPRelate)
gdsfile <- system.file("extdata", "HapMap_ASW_MXL_geno.gds", package="GENESIS")
gds <- snpgdsOpen(gdsfile)
class(gds) # should see "SNPGDSFileClass"
data("HapMap_ASW_MXL_KINGmat")
mypcair <- pcair(gds, kinobj = HapMap_ASW_MXL_KINGmat, divobj = HapMap_ASW_MXL_KINGmat)
mypcrelate <- pcrelate(gds, pcs = mypcair$vectors[,1:2],
training.set = mypcair$unrels,
BPPARAM = BiocParallel::SerialParam())
snpgdsClose(gds)
from genesis.
I have figured out the issue. It is with the way the .gds files are read into R, perhaps in different versions. If your data produces this error, reading the .gds files back into R in different ways can help (which you should probably do after restarting R according to this thread, but in my experience it is not necessary as long as you can reload in the .gds files). It is always best to do so using the two part commands like this:
HapMap_geno <- GdsGenotypeReader(filename = "MyGDS.gds")
HapMap_genoData <- GenotypeData(HapMap_geno)
Instead of using other GDS commands like this:
genofile <- snpgdsOpen("MyGDS.gds")
Both sets of code produce the same class of object but the package throws an error for the latter and not the former. Apologies to the developers if this is something obvious, but I thought I would just post here in case others run into this issue.
Best,
Alexander
from genesis.
@AlexHatoum pcair
has more options for input classes than pcrelate
, which is why you saw the error for the latter but not the former. This has to do with the way the two functions are implemented internally: pcair
calls the snpgdsPCA
function in the SNPRelate package, so it can accept SNPRelate classes, but pcrelate
requires an Iterator object defined in GWASTools or SeqVarTools. You can see this difference in the "Usage" section of the man pages for the two functions:
Usage:
## S4 method for signature 'gds.class'
pcair(gdsobj, kinobj = NULL, divobj = NULL,
<...>
## S4 method for signature 'SNPGDSFileClass'
pcair(gdsobj, ...)
## S4 method for signature 'GdsGenotypeReader'
pcair(gdsobj, ...)
## S4 method for signature 'MatrixGenotypeReader'
pcair(gdsobj, ...)
## S4 method for signature 'GenotypeData'
pcair(gdsobj, ...)
## S4 method for signature 'SeqVarGDSClass'
pcair(gdsobj, ...)
vs
Usage:
## S4 method for signature 'GenotypeIterator'
pcrelate(gdsobj,
<...>
## S4 method for signature 'SeqVarIterator'
pcrelate(gdsobj,
from genesis.
Related Issues (20)
- Error in assocTestSingle() results when covariate is confounded with SNP genotype. HOT 6
- pcrelateToMatrix slow on 50k samples HOT 10
- fitNullModel doesn't converge when provided a list of matrices with more than 1 matrix HOT 3
- Error in seqVCF2GDS(vcf.files, gds.file, verbose = FALSE) HOT 1
- correctK2() drops samples under specific conditions HOT 1
- Estimate PVE HOT 1
- add check in varCompCI that family is gaussian
- pcrelate REDUCE error while calculating individual AF betas HOT 8
- analysis pipeline for chromosome X HOT 1
- ERROR:unused arguments (two.stage = TRUE, norm.option = "all", rescale = "residSD") HOT 2
- Error when running the pcrelate function HOT 2
- High Memory Consumption with Large Dataset in PC-Relate HOT 1
- Conditional analysis HOT 1
- HOW to FIX - PCAir excludes all my SNPs because there is no chromosome information HOT 1
- Error using assocTestAggregate HOT 1
- Issue with PCAir - Segmentation fault (core dumped) HOT 1
- Issue: Running PCAir on 140K individuals HOT 1
- pcrelate: error with rbindlist() HOT 1
- Cholesky factorization failed HOT 1
- Filter extreme p-values using `.Machine$double.xmin` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from genesis.