Skip to content

Commit 32b9e30

Browse files
authored
Merge pull request #44 from microbiome/review
Create TreePlot and GraphPlot families and add typical tree operations and ScreePlot panel.
2 parents 628462c + e005b8d commit 32b9e30

Some content is hidden

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

41 files changed

+2171
-970
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ inst/doc
1010
vignettes/*.html
1111
vignettes/*.R
1212
iSEEtree.BiocCheck/
13-
tests/testthat/*.pdf
13+
*.pdf

DESCRIPTION

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: iSEEtree
2-
Version: 1.1.2
2+
Version: 1.2.0
33
Authors@R:
44
c(person(given = "Giulio", family = "Benedetti", role = c("aut", "cre"),
55
email = "giulio.benedetti@utu.fi",
@@ -24,15 +24,20 @@ Depends:
2424
R (>= 4.4.0),
2525
iSEE (>= 2.19.2)
2626
Imports:
27+
ape,
28+
ggplot2,
29+
ggtree,
2730
grDevices,
2831
methods,
2932
miaViz,
33+
purrr,
3034
S4Vectors,
3135
shiny,
3236
mia,
3337
shinyWidgets,
3438
SingleCellExperiment,
3539
SummarizedExperiment,
40+
tidygraph,
3641
TreeSummarizedExperiment,
3742
utils
3843
Suggests:

NAMESPACE

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,28 @@
22

33
export(AbundanceDensityPlot)
44
export(AbundancePlot)
5+
export(ColumnGraphPlot)
56
export(ColumnTreePlot)
67
export(LoadingPlot)
78
export(RDAPlot)
9+
export(RowGraphPlot)
810
export(RowTreePlot)
11+
export(ScreePlot)
912
export(iSEE)
1013
exportClasses(AbundanceDensityPlot)
1114
exportClasses(AbundancePlot)
15+
exportClasses(ColumnGraphPlot)
1216
exportClasses(ColumnTreePlot)
17+
exportClasses(GraphPlot)
1318
exportClasses(LoadingPlot)
1419
exportClasses(RDAPlot)
20+
exportClasses(RowGraphPlot)
1521
exportClasses(RowTreePlot)
22+
exportClasses(ScreePlot)
23+
exportClasses(TreePlot)
1624
exportMethods(iSEE)
1725
importFrom(S4Vectors,isEmpty)
26+
importFrom(S4Vectors,metadata)
1827
importFrom(S4Vectors,setValidity2)
1928
importFrom(SingleCellExperiment,reducedDim)
2029
importFrom(SingleCellExperiment,reducedDimNames)
@@ -23,52 +32,38 @@ importFrom(SummarizedExperiment,assayNames)
2332
importFrom(SummarizedExperiment,colData)
2433
importFrom(SummarizedExperiment,rowData)
2534
importFrom(TreeSummarizedExperiment,TreeSummarizedExperiment)
35+
importFrom(TreeSummarizedExperiment,colTree)
2636
importFrom(TreeSummarizedExperiment,rowLinks)
27-
importFrom(TreeSummarizedExperiment,rowTreeNames)
37+
importFrom(TreeSummarizedExperiment,rowTree)
38+
importFrom(ape,Ntip)
39+
importFrom(ggplot2,aes)
40+
importFrom(ggplot2,geom_text)
41+
importFrom(ggtree,collapse)
42+
importFrom(ggtree,geom_tiplab)
43+
importFrom(ggtree,rotate_tree)
2844
importFrom(grDevices,dev.off)
2945
importFrom(grDevices,pdf)
3046
importFrom(grDevices,rainbow)
31-
importFrom(iSEE,.addSpecificTour)
32-
importFrom(iSEE,.addTourStep)
33-
importFrom(iSEE,.checkboxGroupInput.iSEE)
34-
importFrom(iSEE,.checkboxInput.iSEE)
35-
importFrom(iSEE,.conditionalOnCheckGroup)
36-
importFrom(iSEE,.conditionalOnCheckSolo)
37-
importFrom(iSEE,.conditionalOnRadio)
38-
importFrom(iSEE,.createProtectedParameterObservers)
39-
importFrom(iSEE,.createUnprotectedParameterObservers)
40-
importFrom(iSEE,.emptyDefault)
41-
importFrom(iSEE,.getEncodedName)
42-
importFrom(iSEE,.getPanelColor)
43-
importFrom(iSEE,.numericInput.iSEE)
44-
importFrom(iSEE,.processMultiSelections)
45-
importFrom(iSEE,.radioButtons.iSEE)
46-
importFrom(iSEE,.retrieveOutput)
47-
importFrom(iSEE,.selectInput.iSEE)
48-
importFrom(iSEE,.singleStringError)
49-
importFrom(iSEE,.sliderInput.iSEE)
50-
importFrom(iSEE,.textEval)
51-
importFrom(iSEE,.validLogicalError)
52-
importFrom(iSEE,.validNumberError)
5347
importFrom(iSEE,ColumnDataTable)
5448
importFrom(iSEE,ComplexHeatmapPlot)
5549
importFrom(iSEE,ExperimentColorMap)
5650
importFrom(iSEE,ReducedDimensionPlot)
5751
importFrom(iSEE,RowDataTable)
58-
importFrom(iSEE,collapseBox)
5952
importFrom(iSEE,createLandingPage)
6053
importFrom(methods,callNextMethod)
6154
importFrom(methods,is)
6255
importFrom(methods,new)
6356
importFrom(methods,slot)
6457
importFrom(mia,taxonomyRanks)
58+
importFrom(miaViz,plotColGraph)
6559
importFrom(miaViz,plotColTree)
6660
importFrom(miaViz,plotLoadings)
61+
importFrom(miaViz,plotRowGraph)
6762
importFrom(miaViz,plotRowTree)
63+
importFrom(miaViz,plotScree)
64+
importFrom(purrr,reduce)
6865
importFrom(shiny,plotOutput)
6966
importFrom(shiny,renderPlot)
7067
importFrom(shinyWidgets,addSpinner)
68+
importFrom(tidygraph,activate)
7169
importFrom(utils,stack)
72-
importMethodsFrom(iSEE,.generateOutput)
73-
importMethodsFrom(iSEE,.panelColor)
74-
importMethodsFrom(iSEE,.renderOutput)

NEWS

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
1-
Changes in version 0.1.3
1+
Changes in version 0.1.X
22
* Moved to microbiome org
3-
4-
Changes in version 0.1.4
53
* Added panel tours
64
* Prepared for submission
75

8-
Changes in version 0.99.0
6+
Changes in version 0.99.X
97
* Submitted to Bioconductor
10-
11-
Changes in version 0.99.2
128
* Extended data params for all panels
139
* Extended viz params for RDAPlot and RowTreePlot
14-
15-
Changes in version 0.99.3
1610
* Added .exportOutput method
17-
18-
Changes in version 0.99.8
1911
* Added ColumnTreePlot and LoadingPlot panels
2012

21-
Changes in version 1.1.1
13+
Changes in version 1.1.X
2214
* Updated .multiSelectionResponsive
2315
* Conformed to iSEE v2.19.2
16+
17+
Changes in version 1.2.X
18+
* Created TreePlot family
19+
* Added typical tree operations
20+
* Created GraphPlot family
21+
* Added ScreePlot panel

R/AllClasses.R

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
tree_slots <- c(layout="character", add.legend="logical",
2+
edge.colour.by="character", tip.colour.by="character", order.tree="logical",
3+
tip.size.by="character", edge.size.by="character", tip.shape.by="character",
4+
node.size.by="character", node.shape.by="character", collapse="character",
5+
node.colour.by="character", add.node.lab="logical", add.tip.lab="logical",
6+
open.angle="numeric", rotate.angle="numeric", branch.length="logical",
7+
visual_parameters="character", size_parameters="character",
8+
shape_parameters="character", colour_parameters="character")
9+
10+
#' @rdname TreePlot
11+
#' @export
12+
setClass("TreePlot", contains=c("Panel", "VIRTUAL"), slots=tree_slots)
13+
14+
#' @rdname RowTreePlot
15+
#' @export
16+
setClass("RowTreePlot", contains="TreePlot")
17+
18+
#' @rdname ColumnTreePlot
19+
#' @export
20+
setClass("ColumnTreePlot", contains="TreePlot")
21+
22+
graph_slots <- c(name="character", assay.type="character", layout="character",
23+
edge.type="character", show.label="logical", add.legend="logical",
24+
edge.colour.by="character", edge.size.by="character",
25+
node.colour.by="character", node.shape.by="character",
26+
node.size.by="character", visual_parameters="character",
27+
size_parameters="character", shape_parameters="character",
28+
colour_parameters="character")
29+
30+
#' @rdname GraphPlot
31+
#' @export
32+
setClass("GraphPlot", contains=c("Panel", "VIRTUAL"), slots=graph_slots)
33+
34+
#' @rdname RowGraphPlot
35+
#' @export
36+
setClass("RowGraphPlot", contains="GraphPlot")
37+
38+
#' @rdname ColumnGraphPlot
39+
#' @export
40+
setClass("ColumnGraphPlot", contains="GraphPlot")
41+
42+
setClassUnion("charlog", c("character", "logical"))
43+
44+
#' @rdname RDAPlot
45+
#' @export
46+
setClass("RDAPlot", contains="Panel", slots=c(dimred="character",
47+
add.ellipse="charlog", colour_by="character", vec.text="logical",
48+
add.vectors="logical", ellipse.alpha="numeric", confidence.level="numeric",
49+
add.significance="logical", add.expl.var="logical", ellipse.linewidth="numeric",
50+
ellipse.linetype="numeric", vec.size="numeric", vec.colour="character",
51+
vec.linetype="numeric", arrow.size="numeric", label.colour="character",
52+
label.size="numeric", visual_parameters="character"))
53+
54+
#' @rdname LoadingPlot
55+
#' @export
56+
setClass("LoadingPlot", contains="Panel", slots=c(dimred="character",
57+
layout="character", ncomponents="numeric", add.tree="logical"))
58+
59+
#' @rdname ScreePlot
60+
#' @export
61+
setClass("ScreePlot", contains="Panel", slots=c(dimred="character",
62+
show.barplot="logical", show.points="logical", show.line="logical",
63+
show.labels="logical", add.proportion="logical", add.cumulative="logical",
64+
n="numeric", show.names="logical", eig.name="character"))
65+
66+
#' @rdname AbundancePlot
67+
#' @export
68+
setClass("AbundancePlot", contains="Panel",
69+
slots=c(rank="character", use_relative="logical", add_legend="logical",
70+
order_sample_by_row="character", order_sample="character",
71+
decreasing="logical", order_sample_by_column="character"))
72+
73+
#' @rdname AbundanceDensityPlot
74+
#' @export
75+
setClass("AbundanceDensityPlot", contains="Panel", slots=c(layout="character",
76+
assay.type="character", n="numeric", dots_colour="character",
77+
dots_colour_by="character", add_legend="logical", flipped="logical",
78+
order_descending="logical", dots_shape="character",
79+
dots_shape_by="character"))
80+

R/class-AbundanceDensityPlot.R

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,6 @@
4646
#' @name AbundanceDensityPlot
4747
NULL
4848

49-
#' @rdname AbundanceDensityPlot
50-
#' @export
51-
setClass("AbundanceDensityPlot", contains="Panel", slots=c(layout="character",
52-
assay.type="character", n="numeric", dots_colour="character",
53-
dots_colour_by="character", add_legend="logical", flipped="logical",
54-
order_descending="logical", dots_shape="character", dots_shape_by="character"))
55-
56-
#' @importFrom iSEE .singleStringError .validNumberError .validLogicalError
5749
#' @importFrom S4Vectors setValidity2
5850
setValidity2("AbundanceDensityPlot", function(x) {
5951
msg <- character(0)
@@ -69,7 +61,6 @@ setValidity2("AbundanceDensityPlot", function(x) {
6961
TRUE
7062
})
7163

72-
#' @importFrom iSEE .emptyDefault
7364
#' @importFrom methods callNextMethod
7465
setMethod("initialize", "AbundanceDensityPlot", function(.Object, ...) {
7566
args <- list(...)
@@ -93,8 +84,6 @@ AbundanceDensityPlot <- function(...) {
9384
new("AbundanceDensityPlot", ...)
9485
}
9586

96-
#' @importFrom iSEE .getEncodedName .selectInput.iSEE .numericInput.iSEE .checkboxInput.iSEE
97-
#' .radioButtons.iSEE .conditionalOnRadio
9887
#' @importFrom methods slot
9988
#' @importFrom SummarizedExperiment assayNames
10089
setMethod(".defineDataInterface", "AbundanceDensityPlot",
@@ -134,8 +123,6 @@ setMethod(".defineInterface", "AbundanceDensityPlot",
134123
list(out[1], .create_visual_box_for_abunddens_plot(x, se), out[-1])
135124
})
136125

137-
#' @importFrom iSEE .getEncodedName .createProtectedParameterObservers
138-
#' .createUnprotectedParameterObservers
139126
setMethod(".createObservers", "AbundanceDensityPlot",
140127
function(x, se, input, session, pObjects, rObjects) {
141128

@@ -153,13 +140,9 @@ setMethod(".createObservers", "AbundanceDensityPlot",
153140
invisible(NULL)
154141
})
155142

156-
setMethod(".fullName", "AbundanceDensityPlot",
157-
function(x) "Abundance density plot")
158-
159-
#' @importMethodsFrom iSEE .panelColor
143+
setMethod(".fullName", "AbundanceDensityPlot", function(x) "Abundance density plot")
160144
setMethod(".panelColor", "AbundanceDensityPlot", function(x) "#8B5A2B")
161145

162-
#' @importFrom iSEE .getEncodedName
163146
#' @importFrom shiny plotOutput
164147
#' @importFrom shinyWidgets addSpinner
165148
setMethod(".defineOutput", "AbundanceDensityPlot", function(x) {
@@ -170,8 +153,6 @@ setMethod(".defineOutput", "AbundanceDensityPlot", function(x) {
170153
color=.panelColor(x))
171154
})
172155

173-
#' @importMethodsFrom iSEE .generateOutput
174-
#' @importFrom iSEE .processMultiSelections .textEval
175156
#' @importFrom miaViz plotRowTree
176157
setMethod(".generateOutput", "AbundanceDensityPlot",
177158
function(x, se, all_memory, all_contents) {
@@ -223,7 +204,6 @@ setMethod(".generateOutput", "AbundanceDensityPlot",
223204
list(commands=all_cmds, plot=plot_out, varname=NULL, contents=NULL)
224205
})
225206

226-
#' @importFrom iSEE .getEncodedName .retrieveOutput
227207
#' @importFrom shiny renderPlot
228208
#' @importFrom methods callNextMethod
229209
setMethod(".renderOutput", "AbundanceDensityPlot",
@@ -279,7 +259,6 @@ setMethod(".multiSelectionResponsive", "AbundanceDensityPlot",
279259
})
280260

281261
#' @importFrom methods callNextMethod
282-
#' @importFrom iSEE .getEncodedName .addTourStep
283262
setMethod(".definePanelTour", "AbundanceDensityPlot", function(x) {
284263
rbind(c(paste0("#", .getEncodedName(x)), sprintf(
285264
"The <font color=\"%s\">Abundance Density Plot</font> panel
@@ -296,8 +275,6 @@ setMethod(".definePanelTour", "AbundanceDensityPlot", function(x) {
296275
callNextMethod())
297276
})
298277

299-
#' @importFrom iSEE .getEncodedName collapseBox .selectInput.iSEE
300-
#' .radioButtons.iSEE .conditionalOnRadio .checkboxInput.iSEE
301278
#' @importFrom methods slot
302279
#' @importFrom SummarizedExperiment colData
303280
.create_visual_box_for_abunddens_plot <- function(x, se) {

0 commit comments

Comments
 (0)