after benchmarking fixes - #26
Conversation
data loading and import fixes
Description update
|
@ned-procogia I realized this has not been reviewed and merged. Is this ready to be reviewed and tested? |
|
@***@***.***> – I would hold off for now. It is stable, but I think I have identified the areas responsible for the CPU maxxing out and think have some ideas for fixing that, hopefully.
Thanks,
Ned
From: rvitancol ***@***.***>
Reply to: Nanostring-Biostats/GeoDiff ***@***.***>
Date: Tuesday, December 14, 2021 at 12:45 PM
To: Nanostring-Biostats/GeoDiff ***@***.***>
Cc: "Edward (Ned) Booker" ***@***.***>, Mention ***@***.***>
Subject: External:Re: [Nanostring-Biostats/GeoDiff] after benchmarking fixes (PR #26)
Warning: External. Please do not click on any links unless you trust the sender
@ned-procogia<https://github.com/ned-procogia> I realized this has not been reviewed and merged. Is this ready to be reviewed and tested?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#26 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AV2DAO3BB6Z35EQ5XRJCEO3UQ57DHANCNFSM5IXB5P3A>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
made explicit what code was changed
There was a problem hiding this comment.
NBth.R - why was the parameter "split" removed (edit - nevermind, I was viewing files in a weird way)
PoisBG.R - line 143: sizefact <- apply(object, 2, mean, na.rm = TRUE) changed to sizefact <- colMeans(object). Are NAs possible? Should na.rm=TRUE be added?
^same question for lines 155, 156, 162, 244, 264, 265, 272
|
"ScoreTest.R - remove "#, na.rm = TRUE)" from lines 341 and 351"
"NBth.R - why was the parameter "split" removed?"
"PoisBG.R - line 143: sizefact <- apply(object, 2, mean, na.rm = TRUE) changed to sizefact <- colMeans(object). Are NAs possible? Should na.rm=TRUE be added?" - Rfast::colmeans/rowmeans/colsums/rowsums do not allow the na.rm=TRUE argument, so it should not be added here. R native row/colMeans/Sums are very slow compared to the Rfast implementations (better than apply, but not great). I think what I have works and handles nans fine ^ same question for lines 155, 156, 162, 244, 264, 265, 272 |
| @@ -1,4 +1,4 @@ | |||
| #' Poisson threshold model based normalization-log2 transformation for single slide or for multiple slides | |||
| #' Poisson threshold model based normalization-log2 transformation for single slide or for multiple slides | |||
| @@ -0,0 +1,3 @@ | |||
| *.o | |||
There was a problem hiding this comment.
What's this separate .gitignore file and did you need to move these ignores to the main repo .gitignore?
This reverts commit ef30b9e.
NicoleEO
left a comment
There was a problem hiding this comment.
- Don't forget remove the pdf
- Don't worry about src-i386 folder. I double-checked and your rstudio was smart and deleted these files for us.
- I am still looking at the test scripts, but have gotten through everything else
make sure NBthDE results consistent with coefNBth contrastNBth and that parallel processing works as expected
| @@ -322,171 +543,15 @@ setMethod( | |||
| #' | |||
| #' @rdname fitNBthDE-methods | |||
| #' @aliases fitNBthDE,matrix-method | |||
There was a problem hiding this comment.
add roxygen alias for dgcmatrix
There was a problem hiding this comment.
This still needs attention
There was a problem hiding this comment.
@NicoleEO Added the method for dgcmatrix in my branch will be pushing it once I have addressed others
There was a problem hiding this comment.
@AMAKIRI-AUGUSTINE, I was able to get the result I wanted by just using @Rdname to put in the right markdown file and @export to ensure the method gets into the markdown.

| sizescalebythreshold=TRUE, | ||
| run_parallel = TRUE, | ||
| n_parallel = (parallel::detectCores())) | ||
| expect_error( |
There was a problem hiding this comment.
Add note of what you are testing for here.
|
|
||
| expect_true(all(colnames(NBthDEmod2$X) == rownames(coefmreg$estimate))) | ||
|
|
||
| ## 3. The user input test:statistical test, choose from c("two-sided", ">", "<") |
There was a problem hiding this comment.
Is this numbering correct? It goes 3., 4., then 3. again.
| expect_true(class(demoData) == "NanoStringGeoMxSet") | ||
| expect_true(nrow(phenoData(demoData)) == nrow(phenoData(demoData))) | ||
| expect_true(nrow(featureData(demoData)) == nrow(featureData(demoData))) | ||
| # 1 The function outputs a GeoMx S4 class with length same as length of ROIs, sizefact, in phenoData. |
There was a problem hiding this comment.
Update comment to match what you are testing. Technically we do not confirm length is the same here.
There was a problem hiding this comment.
Noted but required to ensure the function accepts and processes the right inputs
| sizefact_mat <- matrix(rep(sizefact, n_feature), n_feature, n_sample, byrow = TRUE) | ||
| sizefact_mat[ind_na] <- NA | ||
| featfact0 <- matrix(0, n_feature, length(uniid)) | ||
| tmp_obj = object |
There was a problem hiding this comment.
This still needs attention
| tmp_sizefact_mat = sizefact_mat | ||
| tmp_sizefact_mat[ind_na] = 0 | ||
| for (iter in seq_len(iterations)) { | ||
| #featfact <- sapply(uniid, function(x) { |
There was a problem hiding this comment.
This still needs attention
| # apply(object[, x == id, drop = FALSE], 1, sum, na.rm = TRUE) / | ||
| # apply(sizefact_mat[, x == id, drop = FALSE], 1, sum, na.rm = TRUE) | ||
| featfact <- sapply(uniid, function(x) { | ||
| rowSums(tmp_obj[, x == id, drop = FALSE], na.rm=TRUE) / |
There was a problem hiding this comment.
This still needs attention
|
|
||
| featfact_mat <- featfact[, id] | ||
| featfact_mat[ind_na] <- NA | ||
| tmp_featfact_mat = featfact_mat |
There was a problem hiding this comment.
This still needs attention
| graphics::abline(a = 0, b = 1) | ||
| } | ||
|
|
||
| # tmp_mat = (countmat - countmat_expected)^2 / countmat_expected |
There was a problem hiding this comment.
This still needs attention
|
Another edit to add to the list. The build system will run checks on three different OS including windows. Test chunks within unit tests using parallel package need to be set to only run on non-window OS. Here's an example of us diverting windows users to non-parallel analysis. You will want to build something of this nature in the function itself or around every unit test chunk using parallel so the unit test doesn't fail on the Bioconductor build system. https://github.com/Nanostring-Biostats/GeomxTools/blob/97959d5f38eb07b3bab380e5b82048ae368d3f72/R/NanoStringGeoMxSet-de.R#L80 |
Happy Thanksgiving!
after benchmarking fixes - phew!
passes build tests, bioccheck, vignettes run,