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]: 3a halts at calculate DunedinPACE #14

Closed ks164 closed 1 month ago

ks164 commented 1 month ago

Contact Details

ks164@duke.edu

Scripts

03a-methylation_variables.sh

What happened?

script runs successfully until calculating DunedinPACE:

Predicting, adjusting and standardizing DunedinPACE Loading required namespace: preprocessCore Error in PredAgeDun$DunedinPACE : $ operator is invalid for atomic vectors Calls: main -> data.frame Execution halted

How can the bug be reproduced?

Don't know if this is the relevant code, but bug not reproduced running DunedinPACE calculation outside of ./03a-methylation_variables.sh

i..e the following code from dnamage.R script directly on norm.beta (from methylation_no_outliers.Robj) generates paceresult dataframe:

message("Predicting, adjusting and standardizing DunedinPACE")######################################## PredAgeDun <- try(PACEProjector(norm.beta, proportionOfProbesRequired=0.7), silent = TRUE) paceresult <- data.frame("IID" = names(PredAgeDun$DunedinPACE), "PredAge" = PredAgeDun$DunedinPACE)

and

is.atomic(PredAgeDun) [1] FALSE

R version

4.3.3 (February, 2024)

Python version

None

Relevant log output

No response

SiyiSEA commented 1 month ago

Hi,

Thank you for running the pipeline.

The error has been fixed in the branch of 3a-halts-at-calculate-DunedinPACE and I've create a pull request for this issue.

Please be patient for merging and you could run the script again.

Best, Siyi

SiyiSEA commented 1 month ago

Hi @ks164 ,

The main repo has been updated.

Please run the git pull before you run the pipeline.

Thank you.

Best, Siyi

ks164 commented 1 month ago

Thank you so much Siyi!

Unfortunately, the script still fails, this time with the error:

Error in PredAgeDun[["DunedinPACE"]] : subscript out of bounds Calls: main -> data.frame Execution halted

Could it be that the PACEprojector is returning an empty list?

SiyiSEA commented 1 month ago

Hi,

That's fine. Thanks for cooperating with me.

Could you please run print(PredAgeDun) in your R terminal? If there's an error message, it might be due to an issue with the PACEprojector function.

Since the PACEprojector belongs to the DunedinPACE package, could you also check if the DunedinPACE package has been installed successfully?

If not, please reinstall it by following the instructions on the wiki (https://github.com/genetics-of-dna-methylation-consortium/godmc_phase2/wiki/System-requirements). If it is installed, could you please check the version of the DunedinPACE package by typing the following command in your R terminal:

# check the package version
packageVersion('DunedinPACE')

Please don't hesitate to contact me.

Best, Siyi

ks164 commented 1 month ago

Thanks again!

I've caught the issue running through the code a line at a time: it's a problem with preprocessCore

Error in preprocessCore::normalize.quantiles.use.target(betas.mat, target = mPACE_Models$gold_standard_means[[model_name]]) : ERROR; return code from pthread_create() is 22

e.g. https://github.com/Bioconductor/bioconductor_docker/issues/22

I use conda environments and I think it might only be an issue in that instance. I will try to manually reinstall and downgrade openblas

SiyiSEA commented 1 month ago

Hi,

That's cool.

There is another solution as mentioned in the wiki. I wish this could help you. image

I'll enhance my code to make sure the error message will show up. Thank you a lot.

Best, Siyi

ks164 commented 1 month ago

Thanks!

the threading.ok() came back as TRUE for me, so I think that's not the problem in this case.

I think it's an issue with conda environments- I recall having to modify the openblas/libopenblas library one other time to get preprocessCore to work. Other times it's fine...

ks164 commented 1 month ago

The bug is fixed by manual install of preprocessCore from Github with threading disabled

  - name: Manually install preprocessCore
    run: |
      git clone https://github.com/bmbolstad/preprocessCore.git
      cd preprocessCore
      R CMD INSTALL --configure-args="--disable-threading"  .

I have now successfully run module 03a

SiyiSEA commented 1 month ago

Well done! I will update the wiki about the preprocessCore.