joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
586 stars 186 forks source link

parallelizing script for R cluster-Error- Function cannot find "tax_glom" #1653

Open pulidofabs opened 1 year ago

pulidofabs commented 1 year ago

Hello, I am working with a large metagenomes dataset. As such, I need to use the cluster to parallelize the script to work on my > 800,000-row file. However, to use phyloseq here, I need to parallelize a script, and unfortunately, I am getting an error that makes no sense, and I cannot seem to find any advice online.

Any advice on why I am getting this error when phyloseq is loaded?

Fct<- function(physeq, ...) {
   library(physeq)
   Fun <- tax_glom(physeq, "Function")
   Fun1<-psmelt(Fun)
   FunTrt <- merge_samples(Fun, "Treatment") #
   FunTrt1<-psmelt(FunTrt)
   names(FunTrt1)[2]<-"Trt" 
   return(FunTrt1)
}

#Submit slurm job using batchtools

Njobs <- 1:4 # Define number of jobs (here 4)
ids <- batchMap(fun=myFct, x=Njobs)
done <- submitJobs(ids, reg=reg, resources=list(partition="short", walltime=60, ntasks=10, ncpus=1, memory=1024))
waitForJobs()

#When I run this script, I get the following error > showLog() Error in convertId(reg, id) : argument "id" is missing, with no default > findErrors() Empty data.table (0 rows and 1 cols): job.id > getErrorMessages() Empty data.table (0 rows and 4 cols): job.id,terminated,error,message

Thanks a million