Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoMethAllRegions() returns invisibly #16

Open
gabrielodom opened this issue Mar 1, 2022 · 7 comments
Open

CoMethAllRegions() returns invisibly #16

gabrielodom opened this issue Mar 1, 2022 · 7 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@gabrielodom
Copy link
Member

We have an example where there are no comethylated regions for a subset of the probes of interest. When we save the output, it saves as NULL; However, when I run the function without saving the output, nothing is printed to the console. The function should return NULL regardless, and perhaps even print a message that no regions of concurrent methylation were found.

@gabrielodom gabrielodom added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Mar 1, 2022
@gabrielodom gabrielodom self-assigned this Mar 1, 2022
@gabrielodom
Copy link
Member Author

I was testing a small subset (about 500) close-by gene regions for J. Jones' EPIC methylation data (n = 33 controls).

@gabrielodom
Copy link
Member Author

Ok, so the issue is something else. I just tested all 49k regions and got back NULL after 3 hours of computing. There is something seriously wrong. Even if there is an issue in the data, we should have an error at the start of the CoMethAllRegions() call before people spend literal hours of computing time.
I'm digging in now

@gabrielodom
Copy link
Member Author

I figured it out: I'm using a tibble to store the data, which just hates row names. We need a check to confirm that some of the rownames are contained in the list of CpGs; perhaps with

sum(rownames(dnam) %in% unlist(CpGs_ls))

@gabrielodom gabrielodom removed the enhancement New feature or request label Mar 2, 2022
@gabrielodom
Copy link
Member Author

Also, (and I need to make this another issue), the lmmTest() functions can't handle the output from GetResiduals() because these functions assume that the methylation values are betas. The transformation to M values is hard coded. I either need to have GetResiduals() return logit-transformed residuals (in the beta scale), or add a switch to the lmmTest() functions if the "betas" are actually M-values already.

@gabrielodom
Copy link
Member Author

Also, when lmmTestAllRegions() hits an error, the log file doesn't close. You have to close RStudio to finish writing to the file.

@gabrielodom
Copy link
Member Author

gabrielodom commented Mar 19, 2022

More lmmTestAllRegions() stuff: when you don't want to include a covariate, you have to set covariates_char = NULL; using covariates_char = "" will not error, but the statistics and p-values will all be NA.

@gabrielodom
Copy link
Member Author

This NULL trick works in serial, but not in parallel?

Warning in parallel::mccollect(wait = FALSE, timeout = 1) :
  1 parallel job did not deliver a result
Error in env[[as.character(i)]] <- value : 
  wrong args for environment subassignment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant