Skip to content

Commit 9acb240

Browse files
committed
Numerous changes to the core workflow, now all
paths go through splicejamFigure(), including the R-shiny app. Fixed all internal warnings, added visual testthat tests, added test environment. Import supports bigwig, bigbed, bed, and SJ.out.tab from STAR. Intermediate data.frame keeps all coverage coordinates in NumericList and not per-row tidy format, speed and memory improvements. Updated pkgdown docs. Recategorized all functions.
1 parent 3a4e6df commit 9acb240

448 files changed

Lines changed: 50125 additions & 29154 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.Rbuildignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@
88
^doc$
99
^Meta$
1010
^data-raw$
11+
^.vscode
12+
^.vdoc.*
13+
^TODO_.*md$
14+
^gencode.*$

.gitignore

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
1-
inst/doc
2-
.Rproj.user
3-
.Rhistory
4-
.RData
5-
.Ruserdata
6-
*_memoise
7-
gencode*
8-
doc
9-
Meta
10-
.vscode
1+
.Rproj.user/
2+
.Rhistory
3+
.Rapp.history
4+
.RData
5+
.RDataTmp
6+
.Ruserdata
7+
*-Ex.R
8+
/*.tar.gz
9+
/*.Rcheck/
10+
/doc/
11+
/Meta/
12+
inst/doc
13+
vignettes/*.html
14+
vignettes/*.pdf
15+
.httr-oauth
16+
/cache
17+
*_cache/
18+
rsconnect/
19+
.vscode
20+
air.toml
21+
.vdoc*
22+
/.quarto/
23+
**/*.quarto_ipynb
24+
*_memoise
25+
gencode*annotation*
26+
TODO_*
27+
/docs/*/*.md

DESCRIPTION

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Description: Jam Bioinformatics methods for RNA-seq and other genomics
2020
methods for manipulating gene expression data.
2121
Depends: R (>= 3.5.0)
2222
biocViews:
23-
Imports: jamba(>= 1.0.0),
24-
jamma(>= 0.0.38.900),
23+
Imports: jamba(>= 1.0.4),
24+
jamma(>= 0.0.40.900),
2525
colorjam(>= 0.0.35.900),
2626
data.table,
2727
GenomicRanges,
@@ -44,7 +44,6 @@ Imports: jamba(>= 1.0.0),
4444
shinyjqui,
4545
shinycssloaders,
4646
shinyjs,
47-
cowplot,
4847
plotly,
4948
DT,
5049
caTools,
@@ -64,6 +63,7 @@ Suggests:
6463
org.Mm.eg.db,
6564
farrisdata(>= 0.0.9.900),
6665
testthat(>= 3.0.0),
66+
cowplot,
6767
vdiffr
6868
License: GPL-2
6969
Encoding: UTF-8
@@ -76,9 +76,9 @@ Remotes:
7676
github::RinteRface/shinydashboardPlus,
7777
github::Yang-Tang/shinyjqui,
7878
github::rnabioco/cpp11bigwig
79-
URL: http://github.com/jmw86069/splicejam
80-
BugReports: http://github.com/jmw86069/splicejam/issues
79+
URL: https://jmw86069.github.io/splicejam
80+
BugReports: https://github.com/jmw86069/splicejam/issues
8181
Roxygen: list(markdown = TRUE)
8282
VignetteBuilder: knitr
83-
Config/roxygen2/version: 8.0.0
83+
Config/roxygen2/version: 8.0.0.9000
8484
Config/testthat/edition: 3

NAMESPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export(getGRLgaps)
3535
export(getGRcoverageFromBw)
3636
export(getGRgaps)
3737
export(getGtfAttrs)
38-
export(get_fn_envir)
3938
export(grl2df)
4039
export(groups2contrasts)
4140
export(import_juncs_from_bed)

NEWS.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
11
# splicejam 0.0.91.900
22

3+
* Re-categorized all function families, for "See Also"
4+
and for pkgdown site docs.
5+
* Updated pkgdown site help docs.
36
* Added 'testthat', 'vdiffr' with `splicejamFigure()`.
47
* Added data `'sjenvtest'` with two genes from Farris et al.
8+
* Simplified vignette 'create-a-sashimi-plot.Rmd'.
9+
* Removed all other vignettes, no longer necessary.
10+
* Updated 'README.Rmd' with the abbreviated workflow,
11+
added alt text.
12+
513

614
## Changes
715

16+
* `splicejamFigure()`
17+
18+
* returns 'timings_df' `data.frame` with time duration
19+
for each of several steps in the process.
20+
* Now adds 10% to y-axis ranges to accomodate junction labels.
21+
22+
* `plotSashimi()` now positions junction labels below the arc
23+
for negative strand genes, junctions with negative scores.
24+
* `import_juncs_from_bed()` help docs include formatting for
25+
BED, bigBed using optional 'name' column to store scores
26+
higher than 1000, or 'SJ.out.tab' as produced by STAR aligner.
827
* `sashimiDataConstants()`
928

1029
* Now properly defines 'color_sub' when farrisdata is used.
@@ -16,6 +35,12 @@
1635

1736
* `sashimiAppServer()` no longer assumes 'exonsByTx' exists,
1837
will skip this step if not present.
38+
* `exoncov2polygons()`
39+
40+
* Refactored to use `NumericList` coverage data as-is without
41+
further processing.
42+
* Updated StatUnpackPolygon to handle this format, adding
43+
initial and final point with y-value 0.
1944

2045
# splicejam 0.0.90.900
2146

R/data-sjenvtest.R

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
2-
#' Splicejam Environment Test Data
3-
#'
4-
#' Splicejam Environment Test Data, minimal subset of
5-
#' Farris et al bulk RNA-seq data from mouse hippocampus.
6-
#' It contains only 'CellType' values CA1 and CA2, with
7-
#' both 'Compartment' values CB (cell body) and
8-
#' DE (dendrites).
9-
#'
10-
#' @family splicejam data
11-
#'
12-
#' @format `environment` with components suitable as
13-
#' input to `splicejamFigure()` and other functions
14-
#' which accept environment as input, typically
15-
#' using argument 'sjenv'.
16-
#' \describe{
17-
#' \item{tx2geneDF}{`data.frame` with colnames including
18-
#' the minimum required: 'gene_name', 'transcript_id'.}
19-
#' \item{detectedGenes}{`character` vector of gene symbols.}
20-
#' \item{detectedTx}{`character` vector of 'transcript_id'.}
21-
#' \item{flatExonsByGene}{`GRangesList` named by 'gene_name'}
22-
#' \item{flatExonsByTx}{`GRangesList` named by 'transcript_id'}
23-
#' \item{txdb}{`TxDb` object used to create various exon
24-
#' `GRanges` and `GRangesList` intermediate objects.
25-
#' Not essential for processing, but often useful.}
26-
#' \item{filesDF}{`data.frame` with colnames including
27-
#' the minimum required: 'sample_id', 'url', 'type'}
28-
#' }
29-
"sjenvtest"
1+
2+
#' Splicejam Environment Test Data
3+
#'
4+
#' Splicejam Environment Test Data, minimal subset of
5+
#' Farris et al bulk RNA-seq data from mouse hippocampus.
6+
#' It contains only 'CellType' values CA1 and CA2, with
7+
#' both 'Compartment' values CB (cell body) and
8+
#' DE (dendrites).
9+
#'
10+
#' @family Splicejam data
11+
#'
12+
#' @format `environment` with components suitable as
13+
#' input to `splicejamFigure()` and other functions
14+
#' which accept environment as input, typically
15+
#' using argument 'sjenv'.
16+
#' \describe{
17+
#' \item{tx2geneDF}{`data.frame` with colnames including
18+
#' the minimum required: 'gene_name', 'transcript_id'.}
19+
#' \item{detectedGenes}{`character` vector of gene symbols.}
20+
#' \item{detectedTx}{`character` vector of 'transcript_id'.}
21+
#' \item{flatExonsByGene}{`GRangesList` named by 'gene_name'}
22+
#' \item{flatExonsByTx}{`GRangesList` named by 'transcript_id'}
23+
#' \item{txdb}{`TxDb` object used to create various exon
24+
#' `GRanges` and `GRangesList` intermediate objects.
25+
#' Not essential for processing, but often useful.}
26+
#' \item{filesDF}{`data.frame` with colnames including
27+
#' the minimum required: 'sample_id', 'url', 'type'}
28+
#' }
29+
"sjenvtest"

R/jam-sets.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#' updated to reflect the count of each element.
2626
#' @param verbose logical indicating whether to print verbose output.
2727
#'
28-
#' @family jam list functions
28+
#' @family Internal utility functions
2929
#'
3030
#' @examples
3131
#' set.seed(123);

R/jambio-data.R

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#' begins at position 100, the junction would end at position
1818
#' 99.
1919
#'
20-
#' @family splicejam data
20+
#' @family Splicejam data
2121
#'
2222
#' @examples
2323
#' # The code below is used to create the junction test data
@@ -38,7 +38,8 @@
3838
#'
3939
#' # To plot junctions, use grl2df(..., shape="junction")
4040
#' junc_df <- grl2df(test_junc_gr, shape="junction")
41-
#' gg1 <- ggplot(junc_df, aes(x=x, y=y, group=id, fill=gr_name)) +
41+
#' gg1 <- ggplot2::ggplot(junc_df,
42+
#' ggplot2::aes(x=x, y=y, group=id, fill=gr_name)) +
4243
#' ggforce::geom_diagonal_wide(alpha=0.7) +
4344
#' colorjam::theme_jam() +
4445
#' colorjam::scale_fill_jam()
@@ -69,7 +70,7 @@
6970
#' begins at position 100, the junction would end at position
7071
#' 99.
7172
#'
72-
#' @family splicejam data
73+
#' @family Splicejam data
7374
#'
7475
#' @examples
7576
#' # The code below is used to create the junction test data
@@ -88,12 +89,13 @@
8889
#'
8990
#' # To plot junctions, use grl2df(..., shape="junction")
9091
#' junc_wide_df <-grl2df(test_junc_wide_gr, shape="junction")
91-
#' ggWide1 <- ggplot(junc_wide_df, aes(x=x, y=y, group=id, fill=gr_name)) +
92+
#' ggWide1 <- ggplot2::ggplot(junc_wide_df,
93+
#' ggplot2::aes(x=x, y=y, group=id, fill=gr_name)) +
9294
#' ggforce::geom_diagonal_wide(alpha=0.7) +
9395
#' colorjam::theme_jam() +
9496
#' colorjam::scale_fill_jam() +
95-
#' xlab("chr1") +
96-
#' ggtitle("junctions (full intron width)")
97+
#' ggplot2::xlab("chr1") +
98+
#' ggplot2::ggtitle("junctions (full intron width)")
9799
#' print(ggWide1);
98100
#'
99101
#' # The exons are required to define compressed ranges
@@ -104,23 +106,24 @@
104106
#' ref2c <- make_ref2compressed(test_exon_wide_gr,
105107
#' nBreaks=10);
106108
#' ggWide1c <- ggWide1 +
107-
#' scale_x_continuous(trans=ref2c$trans_grc) +
108-
#' xlab("chr1 (compressed introns)") +
109-
#' ggtitle("junctions (compressed introns, distorted)");
109+
#' ggplot2::scale_x_continuous(trans=ref2c$trans_grc) +
110+
#' ggplot2::xlab("chr1 (compressed introns)") +
111+
#' ggplot2::ggtitle("junctions (compressed introns, distorted)");
110112
#' print(ggWide1c);
111113
#'
112114
#' # to fix the arc shapes, supply the transform to grl2df()
113115
#' # Note: USE THESE STEPS
114-
#' junc_wide_c_df <-grl2df(test_junc_wide_gr,
116+
#' junc_wide_c_df <- grl2df(test_junc_wide_gr,
115117
#' shape="junction",
116118
#' ref2c=ref2c);
117-
#' ggWide1c2 <- ggplot(junc_wide_c_df, aes(x=x, y=y, group=id, fill=gr_name)) +
119+
#' ggWide1c2 <- ggplot2::ggplot(junc_wide_c_df,
120+
#' ggplot2::aes(x=x, y=y, group=id, fill=gr_name)) +
118121
#' ggforce::geom_diagonal_wide(alpha=0.7) +
119122
#' colorjam::theme_jam() +
120123
#' colorjam::scale_fill_jam() +
121-
#' scale_x_continuous(trans=ref2c$trans_grc) +
122-
#' xlab("chr1 (compressed introns)") +
123-
#' ggtitle("junctions (compressed introns)");
124+
#' ggplot2::scale_x_continuous(trans=ref2c$trans_grc) +
125+
#' ggplot2::xlab("chr1 (compressed introns)") +
126+
#' ggplot2::ggtitle("junctions (compressed introns)");
124127
#' print(ggWide1c2);
125128
#'
126129
"test_junc_wide_gr"
@@ -136,7 +139,7 @@
136139
#' exon for an arbitrary gene. It has one column of values,
137140
#' `"gene_name"` used for Sashimi plot preparation.
138141
#'
139-
#' @family splicejam data
142+
#' @family Splicejam data
140143
#'
141144
#' @examples
142145
#' # The code below is used to create the exon test data
@@ -176,7 +179,7 @@
176179
#' exon for an arbitrary gene. It has one column of values,
177180
#' `"gene_name"` used for Sashimi plot preparation.
178181
#'
179-
#' @family splicejam data
182+
#' @family Splicejam data
180183
#'
181184
#' @examples
182185
#' # The code below is used to create the exon test data
@@ -222,7 +225,7 @@
222225
#' with NumericList values representing RNA-seq read coverage
223226
#' across these exons.
224227
#'
225-
#' @family splicejam data
228+
#' @family Splicejam data
226229
#'
227230
#' @examples
228231
#' suppressPackageStartupMessages(library(GenomicRanges));
@@ -244,7 +247,8 @@
244247
#' exondf <- exoncov2polygon(test_cov_gr, covNames="sample_A");
245248
#' gg3 <- ggplot(exondf,
246249
#' aes(x=x, y=y, group=gr, fill=gr, color=gr)) +
247-
#' ggforce::geom_shape(alpha=0.8) +
250+
#' ggforce::geom_shape(alpha=0.8,
251+
#' stat="unpack_polygon") +
248252
#' colorjam::theme_jam() +
249253
#' colorjam::scale_fill_jam() +
250254
#' colorjam::scale_color_jam();
@@ -275,7 +279,7 @@
275279
#' coverage data on a genomic scale. See examples
276280
#' for steps to compress the intron sizes.
277281
#'
278-
#' @family splicejam data
282+
#' @family Splicejam data
279283
#'
280284
#' @examples
281285
#' # The steps below demonstrate how to create coverage data manually
@@ -291,7 +295,8 @@
291295
#' widecovdf <- exoncov2polygon(test_cov_wide_gr, covNames="sample_A");
292296
#' ggWide3 <- ggplot(widecovdf,
293297
#' aes(x=x, y=y, group=gr, fill=gr, color=gr)) +
294-
#' ggforce::geom_shape(alpha=0.7) +
298+
#' ggforce::geom_shape(alpha=0.7,
299+
#' stat="unpack_polygon") +
295300
#' colorjam::theme_jam() +
296301
#' colorjam::scale_fill_jam() +
297302
#' colorjam::scale_color_jam();

0 commit comments

Comments
 (0)