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 1 forks source link

[Bug]: 03d- #18

Closed ks164 closed 1 month ago

ks164 commented 2 months ago

Contact Details

No response

Scripts

03d-non_genetic_methylation_pcs.sh

What happened?

script runs through loading chunks and reading rows, halts with the following output:

Identified 1 out of 4 PCs with significant genetic component Error in dimnames(x)[[2L]] %||% if (do.NULL) NULL else { : could not find function "%||%" Calls: main -> %in% -> colnames -> colnames In addition: There were 50 or more warnings (use warnings() to see the first 50) Execution halted

How can the bug be reproduced?

No response

R version

4.3.3 (February, 2024)

Python version

None

Relevant log output

Identified 1 out of 4 PCs with significant genetic component
Error in dimnames(x)[[2L]] %||% if (do.NULL) NULL else { :
  could not find function "%||%"
Calls: main -> %in% -> colnames -> colnames
In addition: There were 50 or more warnings (use warnings() to see the first 50)
Execution halted
ZXiaopu commented 2 months ago

Hi,

The issue looks like in your current R %in% function does not work.

Can you try the code below to see if it works.

a <- c(1,2,3)
b <- 1
b %in% a
ks164 commented 2 months ago

Thanks!

it evaluates to TRUE in my version of R:

a <- c(1,2,3) b <- 1 b %in% a [1] TRUE

ZXiaopu commented 1 month ago

Hi,

Another reason might be the inconsistent names between PCs and matrixEQTL output. Can you upload these two scripts to your godmc scripts path and remove the .txt? (github cannot upload .R or .sh extension documents so I manually added .txt). genetic_meth_pcs_temp.R.txt 03d-non_genetic_methylation_pcs_temp.sh.txt

And then run

sbatch 03d-non_genetic_methylation_pcs_temp.sh 

we can check the colnames of matrixEQTL results and PCs.

ks164 commented 1 month ago

Thanks for forwarding the updated scripts; I have run them, but the .Rdata output just contains an error warning:

"Error in tcrossprod(slice, cvrt) : \"tcrossprod\" is not a BUILTIN function\n"

I found some mention of the tcrossprod function changing to a primitive function recently (e.g. https://stat.ethz.ch/pipermail/r-package-devel/2023q4/009958.html)- could this be helpful in debugging?

I've attached the .Rdata and log files (with the fake .txt extension)

03d_temp.txt matrixEQTL_res.RData.txt

ks164 commented 1 month ago

Oh, and I forgot to mention- tcrossprod does appear to be builtin in my R version

grep(pattern = "cross", x = builtins(), value = TRUE) [1] "tcrossprod" "crossprod"

epzjlm commented 1 month ago

reinstall of matrixeqtl solved this