Skip to content

Commit 71dcd05

Browse files
committed
Add point about tidybulk integrating with standard tidyverse functions e.g. facet_wrap
1 parent 4ca21d7 commit 71dcd05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vignettes/tidytranscriptomics.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ With tidybulk, it is not really necessary to explicitly filter lowly transcribed
188188

189189
## Scaling counts to normalise
190190

191-
Scaling of counts, normalisation, is performed to eliminate uninteresting differences between samples due to sequencing depth or composition. In the tidybulk package the function `scale_abundance` generates scaled counts, with scaling factors calculated on abundant (filtered) transcripts and applied to all transcripts. We can choose from different normalisation methods. Here we will use the default, TMM, [robinson2010scaling]. TMM normalisation (and most scaling normalisation methods) scale relative to one sample. We use `factor_of_interest` to specify the column containing the groups for the filtering described above.
191+
Scaling of counts, normalisation, is performed to eliminate uninteresting differences between samples due to sequencing depth or composition. In the tidybulk package the function `scale_abundance` generates scaled counts, with scaling factors calculated on abundant (filtered) transcripts and applied to all transcripts. We can choose from different normalisation methods. Here we will use the default, TMM, [@robinson2010scaling]. TMM normalisation (and most scaling normalisation methods) scale relative to one sample. We use `factor_of_interest` to specify the column containing the groups for the filtering described above.
192192

193193
```{r}
194194
# Scaling counts
@@ -200,7 +200,7 @@ counts_scaled
200200

201201
After we run `scale_abundance` we should see some columns have been added at the end. We have a column called `lowly_abundant` that indicates whether the gene has been filtered due to being lowly expressed. FALSE means the gene was not filtered, TRUE means it was. The `counts_scaled` column contains the scaled counts.
202202

203-
We can now see the difference of abundance densities before and after scaling.
203+
We can visualise the difference of abundance densities before and after scaling. As tidybulk output is compatible with tidyverse, we can simply pipe it into standard tidyverse functions such as `filter`, `pivot_longer` and `ggplot`. We can also take advantage of ggplot's `facet_wrap` to easily create multiple plots.
204204

205205
```{r out.width = "40%"}
206206
counts_scaled %>%

0 commit comments

Comments
 (0)