genetics-of-dna-methylation-consortium / godmc_phase2

This repository contains the code to run the analysis pipeline for phase 2 of goDMC released June 2024.
GNU General Public License v3.0
2 stars 0 forks source link

[Bug]: in 3e, ./03e-methylation_adjustment2.sh 1 fails due to indexing issue #10

Closed drsora closed 1 month ago

drsora commented 2 months ago

Contact Details

sonja.rajic@tuni.fi

Scripts

03e-methylation_adjustment2.sh

What happened?

./03e-methylation_adjustment2.sh 1 fails when it gets to MaleY First 3 iterations run successfully (pcs.1, Female.chrX and Male.chrX), as well as 2-100.

I think the issue is due to this part of adjust_nongeneticpcs.R script:

get.index.list <- function(n, mc.cores) { mc.cores <- ifelse(mc.cores < 1, 1, mc.cores) div <- floor(n / mc.cores) rem <- n %% mc.cores l1 <- lapply(1:div, function(x) (x-1) * mc.cores + 1:mc.cores) **if(rem != 0) l1[[div+1]] <- l1[[div]][mc.cores] + 1:rem** return(l1)``

How can the bug be reproduced?

No response

R version

4.4.0 (April, 2024)

Python version

None

Relevant log output

Reading methylation data...
Data size: 589 individuals and 27 CpGs.
Running with 120 threads
Error in l1[[div]] : 
  attempt to select less than one element in get1index <real>
Calls: main -> adjust.covs -> get.index.list
Execution halted
ZXiaopu commented 1 month ago

Hi,

The error is because number of threads > number of CpG and not all thread is used to process CpG. Can you try a smaller threads (<27) given there are 27 CpGs on chrY. From my experience, running 03e with 16 threads is efficient in ~500 individuals dataset.

drsora commented 1 month ago

Thank you, that worked!