TransBioInfoLab/coMethDMR

Failed to bind results due to missing column

Closed this issue · 6 comments

Hi,
The column Stat should be included in the dataframe here

coMethDMR/R/lmmTest.R

Lines 127 to 131 in 04eec91

ps_df <- data.frame(
Estimate = NA_real_,
StdErr = NA_real_,
pValue = 1
)

Otherwise the results binding in lmmTestAllRegions will not work due to different number of columns, because you extract 4 columns from lmer test results (Estimate, StdErr, Stat and pValue), while there are only 3 columns created when the lmer test failed
outDF <- do.call(rbind, results_ls)

I suggest to add this to fix the rbind problem :

if (length(results_ls) > 0) {
    # outDF <- do.call(rbind, results_ls)
    outDF <- data.table::rbindlist(results_ls, fill = TRUE) ## --here fixed 
    outDF$FDR <- p.adjust(outDF$pValue, method = "fdr")
    outDF$region_names <- names(region_ls) ## --here to keep region names
    row.names(outDF) <- NULL
  }

Wow! Thank you so much for the help.
Do you want to be authors on the package for the next version? We are going to add support for whole genome data next (see Issue #8), but there's a lot of documentation (and clearly bugs) to fix first. If you're interested, I'll send you a zoom link for some morning my time (which should be afternoon where you are).

Hello,
Thank you for your return!
With pleasure, I can continue to give you feedback because my colleagues and I are currently using your coMethDMR package. I can continue to give you ideas for improvements as well as fixed bugs that we will see.
I have never worked on the whole exom yet, but it will be interesting!

Speaking with @Ning-L , I understood that she was interested to better understand why some regions had failed in lmer test.
We will look, if it is possible, to add a piece of code like try(tools::assertCondition()), silent = TRUE) or tryCatch to capture the error and return it to the result tables within the dedicated row (region). I will let you know if it works well and if it helps.

Wow! Thank you so much for the help. Do you want to be authors on the package for the next version? We are going to add support for whole genome data next (see Issue #8), but there's a lot of documentation (and clearly bugs) to fix first. If you're interested, I'll send you a zoom link for some morning my time (which should be afternoon where you are).

Glad to contribute.
Please email me the zoom link a few days before the time that suits you so I can pre-schedule my work ^^

@mboissel and @Ning-L, can you please send me an email from your preferred email accounts? I'm gabriel.odom@fiu.edu
Also, I'm adding you both as package contributors for now :)