Skip to content

Commit f97f683

Browse files
committed
1.0.4 release
2 parents 57c676b + 52cbd19 commit f97f683

23 files changed

+188
-59
lines changed

.Rbuildignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
^test$
77
^test_output$
88
^paper
9-
^_pkgdown.yml$
10-
^index.md$
11-
^codemeta.json$
9+
^index\.md$
10+
^codemeta\.json$
1211
^docs$
13-
^varistran.sublime-
14-
12+
^varistran\.sublime-
13+
^MBP-logo.png$
14+
^_pkgdown\.yml$

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Description: Transform RNA-Seq count data so that variance due to biological
1010
Authors@R: person("Paul", "Harrison", email = "[email protected]", role = c("aut", "cre"))
1111
Maintainer: Paul Harrison <[email protected]>
1212
URL: https://github.com/MonashBioinformaticsPlatform/varistran
13-
Version: 1.0.3
13+
Version: 1.0.4
1414
License: LGPL-2.1 | file LICENSE
1515
Depends:
1616
grid
@@ -27,4 +27,4 @@ Suggests:
2727
DESeq2,
2828
biomaRt,
2929
NBPSeq
30-
RoxygenNote: 6.0.1
30+
RoxygenNote: 7.1.0

MBP-logo.png

171 KB
Loading

NEWS

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11

2-
1.0.3
2+
1.0.4
33
=====
44

55
Increase robustness of heatmap to missing values.
66

77
Baseline plot is not shown in heatmap if all zero.
88

9+
1.0.3
10+
=====
11+
12+
No code changes. Updated READEME with references and supporting/contributing section.
13+
914
1.0.2
1015
=====
1116

R/heatmap.R

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,20 @@
33
#'
44
#' Produces a heatmap as a grid grob.
55
#'
6-
#' Clustering is performed using the "seriation" package, and is approximately a Travelling Salesman Problem ordering. If there are many features (more than a couple of thousand) clustering may be slow.
6+
#' This heatmap differs from other heatmaps in R in the method of clustering used:
77
#'
8-
#' @param y A matrix of expression levels, such as a transformed counts matrix.
8+
#' 1. The distances used are cosine distances (i.e. the magnitude of log fold changes is not important, only the pattern).
9+
#'
10+
#' 2. \code{hclust()} is used to produce a clustering, as normal.
11+
#'
12+
#' 3. Branches in the hierarchical clustering are flipped to minimize sharp changes between neighbours, using the seriation package's OLO (Optimal Leaf Ordering) method.
13+
#'
14+
#' @param y A matrix of expression levels, such as a transformed counts matrix as produced by \code{varistran::vst}.
915
#' @param cluster_samples Should samples (columns) be clustered?
1016
#' @param cluster_features Should features (rows) be clustered?
1117
#' @param sample_labels Names for each sample. If not given and y has column names, these will be used instead.
1218
#' @param feature_labels Names for each feature. If not given and y has row names, these will be used instead.
13-
#' @param baseline Baseline level for each row, to be subtracted when drawing the heatmap colors. If omitted, the row mean will be used.
19+
#' @param baseline Baseline level for each row, to be subtracted when drawing the heatmap colors. If omitted, the row mean will be used. Specify \code{baseline=0} to not subtract anything and not show a baseline bar graph.
1420
#' @param baseline_label Text description of what the baseline is.
1521
#' @param scale_label Text description of what the heatmap colors represent (after baseline is subtracted).
1622
#' @param n Show only this many rows. Rows are selected in order of greatest span of expression level.
@@ -20,6 +26,15 @@
2026
#' Additionally $info$row_order will contain row ordering and $info$col_order will contain column ordering.
2127
#' @author Paul Harrison.
2228
#'
29+
#' @examples
30+
#'
31+
#' # Generate some random data.
32+
#' counts <- matrix(rnbinom(1000, size=1/0.01, mu=100), ncol=10)
33+
#'
34+
#' y <- varistran::vst(counts, cpm=TRUE)
35+
#' print( varistran::plot_heatmap(y, n=20) )
36+
#'
37+
#'
2338
#' @export
2439
plot_heatmap <- function(
2540
y,
@@ -50,11 +65,14 @@ plot_heatmap <- function(
5065

5166
feature_labels[is.na(feature_labels)] <- ""
5267

53-
if (!is.null(baseline))
68+
if (!is.null(baseline)) {
69+
if (length(baseline) == 1)
70+
baseline <- rep(baseline, nrow(y))
71+
stopifnot(length(baseline) == nrow(y))
5472
means <- baseline
55-
else
73+
} else {
5674
means <- rowMeans(y, na.rm=TRUE)
57-
75+
}
5876

5977
# Show only a subset of rows, if desired
6078
if (n < nrow(y)) {

R/plot.R

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,13 @@ plot_stability <- function(y, x=NULL, design=NULL, bins=20) {
133133
#'
134134
#' Produce a ggplot object containing a biplot of expression data.
135135
#'
136-
#' Biplot based on the Singular Value Decomposition of the matrix x. The
137-
#' dimensions corresponding to the two largest singular values are shown.
136+
#' Biplot based on the Singular Value Decomposition of the matrix x, after subtracting row means. The dimensions corresponding to the two largest singular values are shown.
138137
#'
139138
#' Genes are shown in blue and samples in red.
140139
#'
141-
#' The dot product of the gene and sample vectors approximates the difference
142-
#' from the average expression level of that gene in that sample.
140+
#' The dot product of the gene and sample vectors approximates the difference from the average expression level of that gene in that sample.
143141
#'
144-
#' Sample points (red) are scaled to have the same variance in the two
145-
#' dimensions. Therefore the gene points (blue) may have greater variance along
146-
#' dimension 1 if dimension 1 explains more of the variance than dimension 2.
142+
#' Sample points (red) are scaled to have the same variance in the two dimensions. Therefore the gene points (blue) may have greater variance along dimension 1 if dimension 1 explains more of the variance than dimension 2.
147143
#'
148144
#' @param x Matrix of expression levels, with features (eg genes) as rows and
149145
#' samples as columns. For example, you could use the output of varistran::vst

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ Varistran is an R package providing a Variance Stabilizing Transformation approp
1010

1111
* [Poster for ABACBS 2015](doc/varistran-poster-abacbs-2015.pdf) [(on F1000, doi: 10.7490/f1000research.1110757.1)](http://f1000research.com/posters/4-1041)
1212

13+
* [Publication in the Journal of Open Source Software](http://joss.theoj.org/papers/10.21105/joss.00257)
14+
1315
Varistran is developed by Paul Harrison ([email protected], [@paulfharrisson](https://twitter.com/paulfharrison)) for the [Monash Bioinformatics platform](https://platforms.monash.edu/bioinformatics/).
1416

17+
<a href="https://platforms.monash.edu/bioinformatics/"><img src="MBP-logo.png" height="88"></a>
18+
1519
## Install
1620

1721
Varistran is most easily installed from GitHub using devtools:
@@ -143,6 +147,13 @@ Pull requests gratefully considered.
143147
* [RNA Systems Laboratory, Monash University](http://rnasystems.erc.monash.edu)
144148

145149

150+
## Citing Varistran
151+
152+
To cite this R package, use:
153+
154+
> Harrison, Paul F. 2017. "Varistran: Anscombe's variance stabilizing transformation for RNA-seq gene expression data." *The Journal of Open Source Software* 2 (16). [doi:10.21105/joss.00257](http://dx.doi.org/10.21105/joss.00257)
155+
156+
146157
## References
147158

148159
Anscombe, Francis J. 1948. "The Transformation of Poisson, Binomial and Negative-Binomial Data." *Biometrika* 35 (3/4): 246–54.

_pkgdown.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ reference:
1313
contents:
1414
- vst
1515
- shiny_report
16+
- plot_stability
17+
- plot_biplot
18+
- plot_heatmap
1619

1720
- title: Support functions
1821
contents:

inst/CITATION

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
citEntry(
3+
entry = "Article",
4+
author = personList(as.person("Paul Francis Harrison")),
5+
title = "Varistran: Anscombe's variance stabilizing transformation for {RNA}-seq gene expression data",
6+
journal = "The Journal of Open Source Software",
7+
year = "2017",
8+
volume = "2",
9+
number = "16",
10+
doi = "10.21105/joss.00257",
11+
url = "http://dx.doi.org/10.21105/joss.00257",
12+
textVersion = paste(
13+
"Paul F. Harrison (2017).",
14+
"Varistran: Anscombe's variance stabilizing transformation for RNA-seq gene expression data.",
15+
"The Journal of Open Source Software 2 (16).",
16+
"doi:10.21105/joss.00257")
17+
)

man/composable_shiny_app.Rd

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)