I am running a programme called 'stdeconvolve', on my Spatial single-cell data. I have ~ 100,000 column (cells) and ~26K rows (genes). I am getting the "Cholmod error 'problem too large' at file". I am unable to debug it, how can I resolve this error?
> dim(pdach1.mat)
[1] 26273 100974
My codes are as follows
library(Seurat)
library(STdeconvolve)
pdac.int <- readRDS("pd_integ.rds")
## extract the counts matrix
pdac.mat <- Matrix((pdac.int#assays$Spatial#counts), sparse = TRUE)
## remove poor genes and pixels
pdac.mat <- cleanCounts(pdac.mat, min.lib.size = 100)
## filter for features in less than 100% of pixels but more than 5% of pixels
pdac.mat <- restrictCorpus(pdac.mat, removeAbove = 1.0, removeBelow = 0.05)
pdf("pdac.int.perplexity.pdf")
pdac.ldas = fitLDA(pdac.mat), Ks = 6:20, plot=T, verbose=TRUE)
dev.off()
pdac.optLDA <- optimalModel(models = pdac.ldas, opt = "min")
pdac.results <- getBetaTheta(pdac.optLDA, perc.filt = 0.05, betaScale = 1000)
#you can obtain the spatial coordinates of the pixels (if available) by doing something like:
now the scary part - The ERROR
Error in asMethod(object) :
Cholmod error 'problem too large' at file ../Core/cholmod_dense.c, line 102
Calls: restrictCorpus ... is.data.frame -> as.matrix -> as.matrix.Matrix -> as -> asMethod
Execution halted
I am using TCGAbiolinks package. I have run this code:
coadquery <- GDCquery(project = "TCGA-COAD",
data.category = "Transcriptome Profiling",
data.type ="Gene Expression Quantification",
workflow.type ="STAR - Counts", legacy = F,
experimental.strategy ="RNA-Seq")
GDCdownload(query = coadquery, method = "api")
coadprpr <- GDCprepare(coadquery, summarizedExperiment = T)
but when I run GDCprepare function it gives me error:
|==================================================|100%
Completed after 12 m
Error in `vectbl_as_col_location()`: ! Can't subset columns past the
end. i Locations 2, 3, and 4 don't exist. i There is only 1 column.
Run `rlang::last_error()` to see where the error occurred. There were
50 or more warnings (use warnings() to see the first 50)
I created a MOJO file with H2O and try to predict based on the saved modell with R. However, I get an exit status 127 error and could not find any solution.
I have updated to the latest H2O release. The issues only occurs with Windows, running the code on Kaggle gives no error at all.
> modelpath <- h2o.download_mojo(fileh, path=getwd(), get_genmodel_jar=TRUE)
> modelpath
[1] "DeepLearning_model_R_1560926535628_2.zip"
> if(is.vector(X)) X <- t(X)
> X <- as.matrix(X)
> Ynew <- h2o.mojo_predict_df(frame = X, mojo_zip_path=modelpath, verbose=T)
...
input_csv: C:\Users\PAPERS~1\AppData\Local\Temp\Rtmpem4zDz/input.csv
mojo_zip:C:\Users\paperspace\Documents\DeepLearning_model_R_1560926535628_2.zip genmodel_jar: C:/Users/paperspace/Documents/h2o-genmodel.jar
output_csv: C:\Users\PAPERS~1\AppData\Local\Temp\Rtmpem4zDz/prediction.csv
classpath: C:/Users/paperspace/Documents/h2o-genmodel.jar
java_options: -Xmx4g -XX:ReservedCodeCacheSize=256m
java cmd: java -Xmx4g -XX:ReservedCodeCacheSize=256m -cp C:/Users/paperspace/Documents/h2o-genmodel.jar hex.genmodel.tools.PredictCsv --mojo C:\Users\paperspace\Documents\DeepLearning_model_R_1560926535628_2.zip --input C:\Users\PAPERS~1\AppData\Local\Temp\Rtmpem4zDz/input.csv --output C:\Users\PAPERS~1\AppData\Local\Temp\Rtmpem4zDz/prediction.csv --decimal
Fehler in h2o.mojo_predict_csv(input_csv_path = input_csv_path, mojo_zip_path = mojo_zip_path, :
SYSTEM COMMAND FAILED (exit status 127)
Zusätzlich: Warnmeldung:
In dir.create(tmp_dir) :
'C:\Users\PAPERS~1\AppData\Local\Temp\Rtmpem4zDz' existiert bereits
I'm terrible when it comes to run models with R. I'm trying to run the following command, that can be found here:
## load data on Japanese hospitals (Besstremyannaya 2013, 2011)
data("hospitals", package="rDEA")
## inputs and outputs for analysis
Y = hospitals[c('inpatients', 'outpatients')]
X = hospitals[c('labor', 'capital')]
W = hospitals[c('labor_price', 'capital_price')]
## Naive input-oriented DEA score for the first 20 firms under variable returns-to-scale
firms=1:20
di_naive = dea(XREF=X, YREF=Y, X=X[firms,], Y=Y[firms,], model="input", RTS="variable")
di_naive$thetaOpt
## Naive DEA score in cost-minimization model for the first 20 firms under variable returns-to-scale
ci_naive = dea(XREF=X, YREF=Y, X=X[firms,], Y=Y[firms,], W=W[firms,],
model="costmin", RTS="variable")
ci_naive$XOpt
ci_naive$gammaOpt
The command works very well, but, when I try to run the command applied to my data, I get the this stuff here:
> ## inputs and outputs for analysis
> Y = data[c('V7', 'V8')]
Error in data[c("V7", "V8")] :
object of type 'closure' is not subsettable
> X = data[c('V3', 'V4','V5','V6')]
Error in data[c("V3", "V4", "V5", "V6")] :
object of type 'closure' is not subsettable
> W = data[c('V2')]
Error in data[c("V2")] : object of type 'closure' is not subsettable
> ## Naive input-oriented DEA score for the first 20 firms under variable returns-to-scale
> firms=1:19
> di_naive = dea(XREF=X, YREF=Y, X=X[firms,], Y=Y[firms,], model="input", RTS="variable")
Error in dea.input(XREF = XREF, YREF = YREF, X = X, Y = Y, RTS = RTS) :
object 'X' not found
> di_naive$thetaOpt
Error: object 'di_naive' not found
> ## Naive DEA score in cost-minimization model for the first 20 firms under variable returns-to-scale
> ci_naive = dea(XREF=X, YREF=Y, X=X[firms,], Y=Y[firms,], W=W[firms,],
+ model="costmin", RTS="variable")
Error in dea.costmin(XREF = XREF, YREF = YREF, X = X, Y = Y, W = W, RTS = RTS) :
object 'X' not found
> ci_naive$XOpt
Error: object 'ci_naive' not found
> ci_naive$gammaOpt
Error: object 'ci_naive' not found
>
Someone can give me a hand?
I'm getting an error while running plyr on a cluster, and I'm having a tough time debugging it. I'm sharing pseudo-code below. I run a function called getopt wrapped in Xgetopt, which handles errors. It basically does gridsearch optimization on a matrix of inputs, row-wise. The input matrix is 11644x2.
Can anybody tell me where this error comes from or what it means? I can't do traceback, because I can't replicate the error locally.
> library(plyr)
> library(doMC)
> registerDoMC(32)
>
> Xgetopt = function(input){
+ out = tryCatch(getopt(input), error=function(e) e, finally=NA)
+ if(inherits(out, "error")) {out=NA; print("an error happened but it got handled.")}
+ return(out)
+ }
>
> tocalc = expand.grid(ID = sort(unique(m$model$ID)), price = seq(from=0,to=100,by=2.5))
> tocalc$ID = as.character(tocalc$ID)
> out = dlply(.data=tocalc,c('ID','price'),.fun=Xgetopt,.parallel=TRUE)
[1] "an error happened but it got handled."
[1] "an error happened but it got handled."
[1] "an error happened but it got handled."
snip (only a few errors, mostly successes)
[1] "99 37.5"
Error in names(result) <- names(pieces) :
'names' attribute [11644] must be the same length as the vector [11187]
Calls: dlply -> llply
Execution halted