Bioconductor / Contributions

Contribute Packages to Bioconductor
134 stars 33 forks source link

bayNorm #878

Closed WT215 closed 5 years ago

WT215 commented 6 years ago

Update the following URL to point to the GitHub repository of the package you wish to submit to Bioconductor

Confirm the following by editing each check box to '[x]'

I am familiar with the essential aspects of Bioconductor software management, including:

For help with submitting your package, please subscribe and post questions to the bioc-devel mailing list.

bioc-issue-bot commented 5 years ago

Dear Package contributor,

This is the automated single package builder at bioconductor.org.

Your package has been built on Linux, Mac, and Windows.

On one or more platforms, the build results were: "WARNINGS". This may mean there is a problem with the package that you need to fix. Or it may mean that there is a problem with the build system itself.

Please see the build report for more details.

bioc-issue-bot commented 5 years ago

Received a valid push; starting a build. Commits are:

10f94ab simplify code in bayNorm a little bit

bioc-issue-bot commented 5 years ago

Dear Package contributor,

This is the automated single package builder at bioconductor.org.

Your package has been built on Linux, Mac, and Windows.

On one or more platforms, the build results were: "WARNINGS". This may mean there is a problem with the package that you need to fix. Or it may mean that there is a problem with the build system itself.

Please see the build report for more details.

bioc-issue-bot commented 5 years ago

Received a valid push; starting a build. Commits are:

d65abe2 Hide some Rcpp functions

bioc-issue-bot commented 5 years ago

Dear Package contributor,

This is the automated single package builder at bioconductor.org.

Your package has been built on Linux, Mac, and Windows.

Congratulations! The package built without errors or warnings on all platforms.

Please see the build report for more details.

WT215 commented 5 years ago

Hello @lshep ,

Thank you for your reviews, they are very helpful! I have done the following changes:

Looking good a few more comments:

  • [x] That warning comes from importing both SingleCellExperiment and stats packages that have a weights function. You could either selectively import functions from one or we will allow this warning

I have solved this problem by using #' @importFrom SingleCellExperiment SingleCellExperiment

  • [x] The vignette only shows BetaFun, bayNorm, bayNorm_sup yet you export 15 other functions - I would have a package man package or a section in the vignette that briefy describes what your other functions are for. If they are not meant to be used by the user, you can mark the documentation with the @Keywords internal and remove @export so they are not included in the NAMESPACE.

Some Rcpp functions are now hidden: Main_NB_Bay, Main_mean_NB_Bay, Main_mode_NB_Bay, MarginalF_NB_1D, MarginalF_NB_2D, GradientFun_NB_1D, and GradientFun_NB_2D . So that they will not be accessed by the users.

  • [ ] We recommend BiocParallel over parallel.

May I keep using foreach for now please? Because so far it works fine. Currently I am not familiar with BiocParallel but I will look into that.

R Files

PRIOR_FUNCTIONS.R

  • [x] You don't need to convert the SingleCellExperiment object into a SummarizedExperiment object. Apply this to all R functions The functions will work the same so for example

I removed the code Data <- methods::as(Data, "SingleCellExperiment"), which was adapted from SCnorm package.

library(SingleCellExperiment)
counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10)
sce <- SingleCellExperiment(assays = list(counts = counts))
assayNames(sce)
  • [x] We generally like to minimize repeat code as much as possible and opt for simplification. Something like the following could be reordered to make only one call to AdjustSIZE_fun setting appropriate variables
if (FIX_MU) {

            BB_prior <- cbind(MME_prior$MME_MU, BB_size)
            rownames(BB_prior) <- rownames(Data)
            colnames(BB_prior) <- c("MME_MU", "BB_SIZE")

            MME_SIZE_adjust <- AdjustSIZE_fun(
                BB_prior[, 2],
                MME_prior$MME_MU,
                MME_prior$MME_SIZE)
        } else {
            BB_prior <- BB_size
            rownames(BB_prior) <- rownames(Data)
            colnames(BB_prior) <- c("BB_SIZE", "BB_MU")
            MME_SIZE_adjust <- AdjustSIZE_fun(
                BB_prior[, 1],
                MME_prior$MME_MU,
                MME_prior$MME_SIZE)
        }

So somthing like the following

BB_prior <- BB_size
colnames(BB_prior) <- c("BB_SIZE", "BB_MU")
rownames(BB_prior) <- rownames(Data)
if (FIX_MU){
    BB_prior <- cbind(BB_prior, MME_prior$MME_MU)
    colnames(BB_prior) <- c("BB_SIZE", "MME_MU")
    vec <- BB_prior[,2]
}else{
   vec <- BB_prior[,1]
}
MME_SIZE_adjust <- AdjustSIZE_fun(vec,MME_prior$MME_MU,MME_prior$MME_SIZE)

This is a very good suggestion! I have modified that part of code.

Apply this concept throughout all R code Like there seems to be similar structure in BB_Fun too - when possible mimize code redundency

I have also simplified the code in BB_Fun, now it is shorten!

  • [x] bayNorm and bayNorm_sup have a lot of repeated code. It would be better to have all similar code in one function with a wrapper for the two different scenerios. Again standing behind limiting the amound of repeated code in packages.

I have tried my best to simplify the code in bayNorm.r and bayNorm_sup.r. Please let me know if there is still some improvement space.

When ready with updates don't forget to version bump for the new build report and comment back here

Cheers!

Thank you for your help! I am looking forward to your reviews!

Cheers, Wenhao

bioc-issue-bot commented 5 years ago

Your package has been accepted. It will be added to the Bioconductor Git repository and nightly builds. Additional information will be posed to this issue in the next several days.

Thank you for contributing to Bioconductor!

lshep commented 5 years ago

I would still look at using BiocParallel eventually bu tI will not enforce its use at this time. Cheers and welcome to Bioconductor.

WT215 commented 5 years ago

Hi @lshep , ok I will try to incorporate BiocParallel, thank you very much!

WT215 commented 5 years ago

Hi @lshep, I have replaced foreach with BiocParallel. Can I continue bumping the version and git push as before?

Thanks a lot!

lshep commented 5 years ago

You could if you like. Since the package hasn't offiically moved into our git.bioconductor.org repository yet you could and only have to push to your github repository.
Once the issue is closed (we will do this) and added you will have to set up your remotes to point to the git.bioconductor.org server and also push there. (instructions will be given when the package is added) and can always be found on the git help pages.

WT215 commented 5 years ago

@lshep Great! I have done that.

Cheers, Wenhao

mtmorgan commented 5 years ago

The master branch of your GitHub repository has been added to Bioconductor's git repository.

To use the git.bioconductor.org repository, we need an 'ssh' key to associate with your github user name. If your GitHub account already has ssh public keys (https://github.com/WT215.keys is not empty), then no further steps are required. Otherwise, do the following:

  1. Add an SSH key to your github account
  2. Submit your SSH key to Bioconductor

See further instructions at

https://bioconductor.org/developers/how-to/git/

for working with this repository. See especially

https://bioconductor.org/developers/how-to/git/new-package-workflow/ https://bioconductor.org/developers/how-to/git/sync-existing-repositories/

to keep your GitHub and Bioconductor repositories in sync.

Your package will be included in the next nigthly 'devel' build (check-out from git at about 6 pm Eastern; build completion around 2pm Eastern the next day) at

https://bioconductor.org/checkResults/

(Builds sometimes fail, so ensure that the date stamps on the main landing page are consistent with the addition of your package). Once the package builds successfully, you package will be available for download in the 'Devel' version of Bioconductor using biocLite(\"bayNorm\"). The package 'landing page' will be created at

https://bioconductor.org/packages/bayNorm

If you have any questions, please contact the bioc-devel mailing list (https://stat.ethz.ch/mailman/listinfo/bioc-devel); this issue will not be monitored further.