ben-laufer / DMRichR

A R package and executable for the preprocessing, statistical analysis, and downstream testing and visualization of differentially methylated regions (DMRs) from CpG count matrices (Bismark cytosine reports)
https://www.benlaufer.com/DMRichR/
MIT License
39 stars 22 forks source link

Error during the adjustment covariate #81

Closed mukhtarsadykov closed 10 months ago

mukhtarsadykov commented 10 months ago

Hi!

I am running 80 RRBS samples, with 3 covariates: Age, Gender and Batch. this is my running code: run.txt I tried with 2 samples but without Batch as a covariate and it worked. The error that I get is the following:

Rscript --vanilla /ibex/scratch/covid19/dnam/dmrsrich/DM.R --genome hg38 --coverage 1 --perGroup '0.75' --minCpGs 5 --maxPerms 10 --maxBlockPerms 10 --cutoff '0.05' --testCovariate Group --adjustCovariate 'Sex;Age;Batch' --sexCheck TRUE --GOfuncR TRUE --EnsDb FALSE --cores 20

[DMRichR] Initializing                   15-11-2023 09:08:58 PM 

[DMRichR] Processing arguments from script       15-11-2023 09:09:30 PM 
genome = hg38
coverage = 1
perGroup = 0.75
minCpGs = 5
maxPerms = 10
maxBlockPerms = 10
cutoff = 0.05
testCovariate = Group
adjustCovariate = Sex
adjustCovariate = Age
adjustCovariate = Batch
cores = 20
sexCheck = TRUE
EnsDb = FALSE
GOfuncR = TRUE

[DMRichR] Selecting annotation databases         15-11-2023 09:09:31 PM 
Loading BSgenome.Hsapiens.UCSC.hg38.masked
Loading TxDb.Hsapiens.UCSC.hg38.knownGene
Loading org.Hs.eg.db
Saving Rdata...

[DMRichR] Processing Bismark cytosine reports        15-11-2023 09:09:36 PM 
Selecting files...
Reading cytosine reports...
[read.bismark] Parsing files and constructing valid loci ...
Done in 117 secs
[read.bismark] Parsing files and constructing 'M' and 'Cov' matrices ...
Done in 75.1 secs
[read.bismark] Constructing BSseq object ... 
Assigning sample metadata with Group as factor of interest...
DataFrame with 80 rows and 4 columns
         Group       Age      Sex    Batch
      <factor> <numeric> <factor> <factor>
ICU01  ICU_ABS        72   Male    Batch12
ICU02  ICU_ABS        51   Female  Batch12
ICU03  ICU_ABS        64   Male    Batch1 
ICU04  ICU_ABS        71   Male    Batch1 
ICU05  ICU_ABS        50   Female  Batch1 
...        ...       ...      ...      ...
NON36   NONICU        63   Female  Batch10
NON37   NONICU        84   Female  Batch10
NON38   NONICU        33   Male    Batch10
NON39   NONICU        77   Male    Batch10
NON40   NONICU        84   Female  Batch11
Checking sex of samples...
Sex of all samples matched correctly. Sex choromosomes will now be dropped
Filtering CpGs for Group...
Assuming adjustment covariate Sex is discrete and including it for filtering...
Assuming adjustment covariate Age is continuous and excluding it from filtering...
Assuming adjustment covariate Batch is discrete and including it for filtering...
slurmstepd: error: poll(): Bad address
Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : 
  cannot coerce class '"try-error"' to a data.frame
Calls: <Anonymous> ... <Anonymous> -> as.data.frame -> as.data.frame.default
In addition: Warning messages:
1: In dir.create("RData") : 'RData' already exists
2: In parallel::mclapply(., FUN = as.matrix, mc.cores = cores) :
  scheduled cores 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 16, 17, 18, 19, 20 did not deliver results, all values of the jobs will be affected
3: In parallel::mclapply(., FUN = DelayedMatrixStats::colSums2, mc.cores = cores) :
  scheduled cores 19, 18, 17, 16, 15, 12, 11, 10, 9, 8, 7, 6, 5, 4, 2, 20 encountered errors in user code, all values of the jobs will be affected
Execution halted
10502

I will run two samples with the Batch as a covariate. Before I also tried to run with different number of cpu-per-task (1, 10 and 20) as well as ntask (1, 20, 20) in my SBATCH params.