Indeed it was the issue with data.table. I converted it to data.frame
and it worked like a charm.
Thank you so much for your insight!
This is the code that worked:
library(parallel)
library(data.table)
library(doSNOW)
n <- parallel::detectCores()
cl <- parallel::makeCluster(n, type = "SOCK")
HI Jim,
this is what I as running:
library(parallel)
library(data.table)
library(foreach)
library(doSNOW)
n <- parallel::detectCores()
cl <- parallel::makeCluster(n, type = "SOCK")
doSNOW::registerDoSNOW(cl)
files <- list.files("/WEIGHTS1/Retina", pattern=".RDat", ignore.case=T)
lst_out <-
Hi Ana,
Back on the job. I'm not sure how this will work in your setup, but
here is a try:
a<-read.table(text="top1 blup lasso enet
rs4980905:184404:C:A 0.07692622 -1.881795e-04 00
rs7978751:187541:G:C 0.62411425 9.934994e-04 00
rs2368831:188285:C:T 0.69529158 1.211028e-03
Hi Jim,
as always you're completely right, this is what is happening:
> head(a)
top1 blup lasso enet
rs4980905:184404:C:A 0.07692622 -1.881795e-04 00
rs7978751:187541:G:C 0.62411425 9.934994e-04 00
rs2368831:188285:C:T 0.69529158
Hi Ana,
I would look at "data" in your second example and see if it contains a
column named "blup" or just the values that were extracted from
a$blup. Also, I assume that weight=blup looks for an object named
"blup", which may not be there.
Jim
On Wed, Dec 16, 2020 at 1:20 PM Ana Marija wrote:
Hi Jim,
Maybe my post is confusing.
so "dd" came from my slow code and I don't use it again in parallelized code.
So for example for one of my files:
if
i="retina.ENSG0120647.wgt.RDat"
> a <- get(load(i))
> head(a)
top1 blup lasso enet
Hi Ana,
My guess is that in your second code fragment you are assigning the
rownames of "a" and the _values_ contained in a$blup to the data.table
"data". As I don't have much experience with data tables I may be
wrong, but I suspect that the column name "blup" may not be visible or
even present
Hello,
I made a terribly inefficient code which runs forever but it does run.
library(dplyr)
library(splitstackshape)
datalist = list()
files <- list.files("/WEIGHTS1/Retina", pattern=".RDat", ignore.case=T)
for(i in files)
{
a<-get(load(i))
names <- rownames(a)
data <-
8 matches
Mail list logo