alanocallaghan / scater

Clone of the Bioconductor repository for the scater package.
https://bioconductor.org/packages/devel/bioc/html/scater.html
95 stars 40 forks source link

fix wrong group factor levels #179

Closed Yunuuuu closed 2 years ago

Yunuuuu commented 2 years ago

when we provide a "block" argument into plotDots function, we will lose our original group levels

scater::plotDots(
        sce_clean, markers,
        block = "Sample",
        group = "label"
) + ggplot2::coord_flip()

This is just a snippet figure, but can let us know the problem (the order of the y axis): image

This commit just fix this by providing original levels into the group factor. and same code with the fixed figure is also here:

scater::plotDots(
        sce_clean, markers,
        block = "Sample",
        group = "label"
) + ggplot2::coord_flip()

image

Yunuuuu commented 2 years ago

By the way, is it necessary to correct batch for the the number of detected features, as I can see in the help page:

If block is specified, batch-corrected averages for each group are computed with `correctGroupSummary`.

Only batch-corrected average value is returned, but the internal code correct both mean and prop.detected

alanocallaghan commented 2 years ago

Hmm, I think the documentation needs to be updated there alright. Thanks again!