Skip to content

Commit

Permalink
Merge branch 'master' of github.com:lindsayrutter/bigPint
Browse files Browse the repository at this point in the history
Version 1.0.3 rebase
  • Loading branch information
lindsayrutter committed Nov 23, 2023
2 parents cb8bf99 + 876f1ba commit 5d1631f
Show file tree
Hide file tree
Showing 601 changed files with 13,919 additions and 77,893 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/no-response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Configuration for probot-no-response - https://github.com/probot/no-response

# Number of days of inactivity before an Issue is closed for lack of response
daysUntilClose: 14
# Label requiring a response
responseRequiredLabel: more-information-needed
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
closeComment: >
This issue has been automatically closed because there has been no response
to our request for more information from the original author. With only the
information that is currently in the issue, we don't have enough information
to take action. Please reach out if you have or find the answers we need so
that we can investigate further.
67 changes: 46 additions & 21 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,31 +1,56 @@
Package: bigPint
Version: 1.3.1
Title: Big multivariate data plotted interactively
Description: Methods for visualizing large multivariate datasets using static and interactive scatterplot matrices, parallel coordinate plots, volcano plots, and litre plots. Includes examples for visualizing RNA-sequencing datasets and differentially expressed genes.
Authors@R: c(person("Lindsay", "Rutter", email = "lindsayannerutter@gmail.com", role = c("aut","cre")),
Version: 1.19.1
Title: BIG multivariate data Plotted INTeractively
Description: Make big data pint-sized. Methods for visualizing large multivariate datasets using static and interactive scatterplot matrices, parallel coordinate plots, volcano plots, and litre plots. Includes examples for visualizing RNA-sequencing datasets and differentially expressed genes.
Authors@R: c(person("Lindsay", "Rutter", email = "bigpintpackage@gmail.com", role = c("aut","cre")),
person("Dianne", "Cook", email = "dicook@monash.edu", role = c("aut")))
License: GPL-3
Depends: R (>= 3.6.0)
Imports: DelayedArray (>= 0.12.2), dplyr (>= 0.7.2), GGally (>= 1.3.2),
ggplot2 (>= 2.2.1), graphics (>= 3.5.0), grDevices (>= 3.5.0),
grid (>= 3.5.0), gridExtra (>= 2.3), hexbin (>= 1.27.1),
Hmisc (>= 4.0.3), htmlwidgets (>= 0.9), methods (>= 3.5.2),
plotly (>= 4.7.1), plyr (>= 1.8.4), RColorBrewer (>= 1.1.2),
reshape (>= 0.8.7), shiny (>= 1.0.5), shinycssloaders (>= 0.2.0),
shinydashboard (>= 0.6.1), stats (>= 3.5.0), stringr (>= 1.3.1),
SummarizedExperiment (>= 1.16.1), tidyr (>= 0.7.0), utils (>= 3.5.0)
biocViews:
Imports:
DelayedArray (>= 0.12.2),
dplyr (>= 0.7.2),
GGally (>= 1.3.2),
ggplot2 (>= 2.2.1),
graphics (>= 3.5.0),
grDevices (>= 3.5.0),
grid (>= 3.5.0),
gridExtra (>= 2.3),
hexbin (>= 1.27.1),
Hmisc (>= 4.0.3),
htmlwidgets (>= 0.9),
methods (>= 3.5.2),
plotly (>= 4.7.1),
plyr (>= 1.8.4),
RColorBrewer (>= 1.1.2),
reshape (>= 0.8.7),
shiny (>= 1.0.5),
shinycssloaders (>= 0.2.0),
shinydashboard (>= 0.6.1),
stats (>= 3.5.0),
stringr (>= 1.3.1),
SummarizedExperiment (>= 1.16.1),
tidyr (>= 0.7.0),
utils (>= 3.5.0)
VignetteBuilder: knitr
Suggests: BiocGenerics (>= 0.29.1), data.table (>= 1.11.8), EDASeq (>=
2.14.0), edgeR (>= 3.22.2), gtools (>= 3.5.0), knitr (>= 1.13),
matrixStats (>= 0.53.1), rmarkdown (>= 1.10), roxygen2 (>=
3.0.0), RUnit (>= 0.4.32), tibble (>= 1.4.2),
biocViews: Clustering, DataImport, DifferentialExpression,
GeneExpression, MultipleComparison, Normalization,
Preprocessing, QualityControl, RNASeq, Sequencing, Software,
Transcription, Visualization
RoxygenNote: 7.0.2
Suggests:
BiocStyle (>= 3.18),
BiocGenerics (>= 0.29.1),
data.table (>= 1.11.8),
EDASeq (>= 2.14.0),
edgeR (>= 3.22.2),
gtools (>= 3.5.0),
knitr (>= 1.13),
matrixStats (>= 0.53.1),
rmarkdown (>= 1.10),
roxygen2 (>= 3.0.0),
RUnit (>= 0.4.32),
tibble (>= 1.4.2)
RoxygenNote: 7.2.3
BugReports: https://github.com/lindsayrutter/bigPint/issues
URL: https://github.com/lindsayrutter/bigPint
NeedsCompilation: no
Packaged: 2018-11-30 04:06:13 UTC; suzu
LazyData: true
Encoding: UTF-8
PackageStatus: Deprecated
Binary file removed LitrePlots/N_P_Glyma.05G188700.Wm82.a2.v1_litre.jpg
Binary file not shown.
Binary file removed LitrePlots/N_P_Glyma.10G118100.Wm82.a2.v1_litre.jpg
Binary file not shown.
Binary file removed LitrePlots/N_P_Glyma.11G044800.Wm82.a2.v1_litre.jpg
Binary file not shown.
Binary file removed LitrePlots/N_P_Glyma.11G141800.Wm82.a2.v1_litre.jpg
Binary file not shown.
Binary file removed LitrePlots/N_P_Glyma.11G178200.Wm82.a2.v1_litre.jpg
Binary file not shown.
Binary file removed LitrePlots/N_P_Glyma.13G173100.Wm82.a2.v1_litre.jpg
Binary file not shown.
Binary file removed LitrePlots/N_P_Glyma.13G293500.Wm82.a2.v1_litre.jpg
Binary file not shown.
Binary file removed LitrePlots/N_P_Glyma.19G168700.Wm82.a2.v1_litre.jpg
Binary file not shown.
Binary file removed LitrePlots/N_P_Glyma.20G083800.Wm82.a2.v1_litre.jpg
Binary file not shown.
Binary file removed LitrePlots/N_P_Glyma.U033600.Wm82.a2.v1_litre.jpg
Binary file not shown.
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## bigPint 1.5.1 (2020-08-23)
plotClusters() function now has option for superimposing pairs or whole data using the showPairs parameter.

## bigPint 1.3.3 (2020-06-15)
[Our software paper](https://doi.org/10.1371/journal.pcbi.1007912) was published in PLoS Computational Biology. In this paper, we describe how our package created independent layers of interactivity using Plotly in R. Pseudocode and source code are provided. Computational scientists can leverage our open-source code to expand upon our layered interactive technology and apply it in new ways toward other computational biology tasks.

## bigPint 1.3.2 (2020-03-04)
Users can now input SummarizedExperiment data type to create any bigPint plot.

## bigPint 1.3.2 (2020-03-04)
Users can now input SummarizedExperiment data type to create any bigPint plot.

Expand Down
2 changes: 1 addition & 1 deletion R/convertSEPair.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ convertSEPair <- function(dataSE, group1, group2){
setNames(x, sub(".*\\.", "", names(x)))))

oldData <- as.data.frame(assay(dataSE))
keepDataCol <- which(vapply(colnames(oldData), function(x)
keepDataCol <- which(lapply(colnames(oldData), function(x)
strsplit(x, "[.]")[[1]][1]) %in% c(group1, group2))
keepOldData <- oldData[, keepDataCol]

Expand Down
70 changes: 45 additions & 25 deletions R/helperCadFALSE.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
helperCadFALSE <- function(cData, dataMetrics, metricPair, aggMethod, nC,
helperCadFALSE <- function(data, cData, dataMetrics, metricPair, aggMethod, nC,
threshVar, threshVal, verbose, vxAxis, saveFile, boxDat, xAxisLabel,
yAxisLabel, lineAlpha, lineSize, plotName, outDir, colList) {

# Convert to data.frame in case tibble
data <- as.data.frame(data)
dataMetrics <- as.data.frame(dataMetrics)

dendo = cData
rownames(dendo) = NULL
d = suppressWarnings(dist(as.matrix(dendo)))
Expand All @@ -21,8 +26,8 @@ yAxisLabel, lineAlpha, lineSize, plotName, outDir, colList) {
xNames),]
sigID = metricFDR[which(metricFDR[[threshVar]]<=threshVal),]$ID
xSig = x[which(xNames %in% sigID),]
xSigNames = rownames(xSig)
nGenes = nrow(xSig)
xSigNames = xNames
nGenes = nrow(xSig)
}
else{
xSig = x
Expand All @@ -31,34 +36,47 @@ yAxisLabel, lineAlpha, lineSize, plotName, outDir, colList) {
}

if (verbose==TRUE){
IDs = as.character(xNames)
saveRDS(IDs, file = paste(outDir, "/", plotName, "_", nC, "_",
IDs = as.character(sigID)
saveRDS(IDs, file = paste(outDir, "/", plotName, "_", nC, "_",
j, ".rds", sep=""))
}

xSig$ID = xSigNames
lastTwoIndices = c(ncol(xSig) -1, ncol(xSig))
xSig = xSig[, -lastTwoIndices]

pcpDat <- melt(xSig, id.vars="ID")
colnames(pcpDat) <- c("ID", "Sample", "Count")
pcpDat$Sample <- as.character(pcpDat$Sample)
pcpDat$ID <- as.factor(pcpDat$ID)

p <- ggplot(boxDat, aes_string(x = 'Sample', y = 'Count')) +
geom_boxplot() + geom_line(data=pcpDat, aes_string(x = 'Sample',
y = 'Count', group = 'ID'), colour = colList[j], alpha=lineAlpha,
size = lineSize) + ylab(yAxisLabel) + xlab(xAxisLabel) +
ggtitle(paste("Cluster ", j, " Genes (n=", format(nGenes,
big.mark=",", scientific=FALSE), ")",sep="")) +
theme(plot.title = element_text(hjust = 0.5, size=14,
face="plain"), axis.text=element_text(size=11),
axis.title=element_text(size=14))

if (nrow(xSig)>0){
lastTwoIndices = c(ncol(xSig) -1, ncol(xSig))
xSig = xSig[, -lastTwoIndices]
############################## here!
nonPairIndex = which(data$ID %in% xSig$ID)
fullDat = data[nonPairIndex,]
fullDat$ID = as.factor(fullDat$ID)

pcpDat <- melt(fullDat, id.vars="ID")
colnames(pcpDat) <- c("ID", "Sample", "Count")
pcpDat$Sample <- as.character(pcpDat$Sample)
pcpDat$ID <- as.factor(pcpDat$ID)

p <- ggplot(boxDat, aes_string(x = 'Sample', y = 'Count')) +
geom_boxplot() + geom_line(data=pcpDat,
aes_string(x = 'Sample', y = 'Count', group = 'ID'),
colour = colList[j], alpha=lineAlpha, size = lineSize) +
ylab(yAxisLabel) + xlab(xAxisLabel) + ggtitle(paste("Cluster ", j,
" Genes (n=", format(nGenes, big.mark=",", scientific=FALSE), ")",
sep="")) + theme(plot.title = element_text(hjust = 0.5, size=14,
face="plain"), axis.text=element_text(size=11),
axis.title=element_text(size=14))
}
else{
p <- ggplot(boxDat, aes_string(x = 'Sample', y = 'Count')) +
geom_boxplot() + ylab(yAxisLabel) + xlab(xAxisLabel) +
ggtitle(paste("Cluster ", j, " Genes (n=", format(nGenes,
big.mark = ",", scientific=FALSE), ")", sep="")) +
theme(plot.title = element_text(hjust = 0.5, size=14,
face="plain"), axis.text=element_text(size=11),
axis.title=element_text(size=14))
}
if (vxAxis == TRUE){
p <- p + theme(axis.text.x = element_text(angle=90, hjust=1))
}

if (verbose==TRUE){
fileName = paste(outDir, "/", plotName, "_", nC, "_", j, ".jpg",
sep="")
Expand All @@ -68,6 +86,7 @@ yAxisLabel, lineAlpha, lineSize, plotName, outDir, colList) {
}
p
})

p = arrangeGrob(grobs=plot_clusters, ncol=2)

if (saveFile == TRUE || verbose == TRUE){
Expand All @@ -77,4 +96,5 @@ yAxisLabel, lineAlpha, lineSize, plotName, outDir, colList) {
invisible(dev.off())
}
return(p)
}
}

6 changes: 5 additions & 1 deletion bigPint/R/helperCadFALSE.R → R/helperCadFALSEPair.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
helperCadFALSE <- function(cData, dataMetrics, metricPair, aggMethod, nC,
helperCadFALSEPair <- function(cData, dataMetrics, metricPair, aggMethod, nC,
threshVar, threshVal, verbose, vxAxis, saveFile, boxDat, xAxisLabel,
yAxisLabel, lineAlpha, lineSize, plotName, outDir, colList) {

# Convert to data.frame in case tibble
dataMetrics <- as.data.frame(dataMetrics)

dendo = cData
rownames(dendo) = NULL
d = suppressWarnings(dist(as.matrix(dendo)))
Expand Down
5 changes: 5 additions & 0 deletions R/helperCadTRUE.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
helperCadTRUE <- function(data, dataMetrics, metricPair, aggMethod, nC,
threshVar, threshVal, verbose, vxAxis, saveFile, boxDat, xAxisLabel,
yAxisLabel, lineAlpha, lineSize, plotName, outDir, colList) {

# Convert to data.frame in case tibble
data <- as.data.frame(data)
dataMetrics <- as.data.frame(dataMetrics)

dendo = data
rownames(dendo) = NULL
d = suppressWarnings(dist(as.matrix(dendo)))
Expand Down
58 changes: 40 additions & 18 deletions bigPint/R/helperCadTRUE.R → R/helperCadTRUEPair.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
helperCadTRUE <- function(data, dataMetrics, metricPair, aggMethod, nC,
helperCadTRUEPair <- function(data, dataMetrics, metricPair, aggMethod, nC,
threshVar, threshVal, verbose, vxAxis, saveFile, boxDat, xAxisLabel,
yAxisLabel, lineAlpha, lineSize, plotName, outDir, colList) {

# Convert to data.frame in case tibble
data <- as.data.frame(data)
dataMetrics <- as.data.frame(dataMetrics)

dendo = data
rownames(dendo) = NULL
d = suppressWarnings(dist(as.matrix(dendo)))
hC = hclust(d, method=aggMethod)
k = cutree(hC, k=nC)

seqVec = seq(nC)
plot_clusters = lapply(seq_along(seqVec), function(j){
i = rev(order(table(k)))[j]
Expand Down Expand Up @@ -38,29 +43,46 @@ yAxisLabel, lineAlpha, lineSize, plotName, outDir, colList) {
if (nrow(xSig)>0){
lastTwoIndices = c(ncol(xSig) -1, ncol(xSig))
xSig = xSig[, -lastTwoIndices]

#New code to remove extra treatment groups
colNames = levels(boxDat$Sample)
seqVec <- seq_along(colNames)
colGroups <- vapply(seqVec, function(i){
strsplit(colNames[i],"[.]")[[1]][1]
}, character(1))
uColGroups <- unique(colGroups)

xCols = colnames(xSig[,-1])
seqVec <- seq_along(xCols)
colGroupsXSig <- vapply(seqVec, function(i){
strsplit(xCols[i],"[.]")[[1]][1]
}, character(1))
keepCol = which(colGroupsXSig %in% uColGroups) +1
xSig = xSig[,c(1,keepCol)]

pcpDat <- melt(xSig, id.vars="ID")
colnames(pcpDat) <- c("ID", "Sample", "Count")
pcpDat$Sample <- as.character(pcpDat$Sample)
pcpDat$ID <- as.factor(pcpDat$ID)

p <- ggplot(boxDat, aes_string(x = 'Sample', y = 'Count')) +
geom_boxplot() + geom_line(data=pcpDat,
aes_string(x = 'Sample', y = 'Count', group = 'ID'),
colour = colList[j], alpha=lineAlpha, size = lineSize) +
ylab(yAxisLabel) + xlab(xAxisLabel) + ggtitle(paste("Cluster ", j,
" Genes (n=", format(nGenes, big.mark=",", scientific=FALSE), ")",
sep="")) + theme(plot.title = element_text(hjust = 0.5, size=14,
face="plain"), axis.text=element_text(size=11),
axis.title=element_text(size=14))
geom_boxplot() + geom_line(data=pcpDat,
aes_string(x = 'Sample', y = 'Count', group = 'ID'),
colour = colList[j], alpha=lineAlpha, size = lineSize) +
ylab(yAxisLabel) + xlab(xAxisLabel) + ggtitle(paste("Cluster ", j,
" Genes (n=", format(nGenes, big.mark=",", scientific=FALSE), ")",
sep="")) + theme(plot.title = element_text(hjust = 0.5, size=14,
face="plain"), axis.text=element_text(size=11),
axis.title=element_text(size=14))
}
else{
p <- ggplot(boxDat, aes_string(x = 'Sample', y = 'Count')) +
geom_boxplot() + ylab(yAxisLabel) + xlab(xAxisLabel) +
ggtitle(paste("Cluster ", j, " Genes (n=", format(nGenes,
big.mark = ",", scientific=FALSE), ")", sep="")) +
theme(plot.title = element_text(hjust = 0.5, size=14,
face="plain"), axis.text=element_text(size=11),
axis.title=element_text(size=14))
geom_boxplot() + ylab(yAxisLabel) + xlab(xAxisLabel) +
ggtitle(paste("Cluster ", j, " Genes (n=", format(nGenes,
big.mark = ",", scientific=FALSE), ")", sep="")) +
theme(plot.title = element_text(hjust = 0.5, size=14,
face="plain"), axis.text=element_text(size=11),
axis.title=element_text(size=14))
}
if (vxAxis == TRUE){
p <- p + theme(axis.text.x = element_text(angle=90, hjust=1))
Expand All @@ -74,9 +96,9 @@ yAxisLabel, lineAlpha, lineSize, plotName, outDir, colList) {
}
p
})

p = arrangeGrob(grobs=plot_clusters, ncol=2)

if (saveFile == TRUE || verbose == TRUE){
fileName = paste(outDir, "/", plotName, "_", nC, ".jpg", sep="")
jpeg(fileName)
Expand Down
7 changes: 5 additions & 2 deletions R/helperTestData.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
helperTestData <- function(data){

colNames = colnames(data[,-1])
seqVec <- seq_along(colNames)

generalMessage = "For more information about formatting the data
object, see https://lrutter.github.io/bigPint/articles/data.html"
object, see https://lindsayrutter.github.io/bigPint/articles/data.html"

if (!methods::is(data, "data.frame")){
stop(paste0("Data object must be of class 'data.frame'. If you are
Expand All @@ -13,6 +13,9 @@ if (!methods::is(data, "data.frame")){
generalMessage))
}

# Convert to data.frame in case tibble
data <- as.data.frame(data)

logicClass = vapply(data[,-1], function(x) methods::is(x, "numeric") ||
methods::is(x, "integer"), logical(length=1))

Expand Down
6 changes: 4 additions & 2 deletions R/helperTestDataMetrics.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#' @importFrom methods is
helperTestDataMetrics <- function(data, dataMetrics, threshVar){

# Convert to data.frame in case tibble
data <- as.data.frame(data)

colNames = colnames(data[,-1])
seqVec <- seq_along(colNames)

generalMessage = "For more information about formatting the dataMetrics
object, see https://lrutter.github.io/bigPint/articles/dataMetrics.html"
object, see https://lindsayrutter.github.io/bigPint/articles/dataMetrics.html"

if (!methods::is(dataMetrics, "list")){
stop(paste0("Data metrics object must be of class 'list'. ",
Expand Down
2 changes: 1 addition & 1 deletion R/helperTestDataMetricsLitreApp.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
helperTestDataMetricsLitreApp <- function(data, dataMetrics){

generalMessage = "For more information about formatting the dataMetrics
object, see https://lrutter.github.io/bigPint/articles/dataMetrics.html"
object, see https://lindsayrutter.github.io/bigPint/articles/dataMetrics.html"

colNames = colnames(data[,-1])
seqVec <- seq_along(colNames)
Expand Down
2 changes: 1 addition & 1 deletion R/helperTestDataMetricsVolcano.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ colNames = colnames(data[,-1])
seqVec <- seq_along(colNames)

generalMessage = "For more information about formatting the dataMetrics
objects, see https://lrutter.github.io/bigPint/articles/dataMetrics.html.
objects, see https://lindsayrutter.github.io/bigPint/articles/dataMetrics.html.
Note that volcano plots require that each element in the dataMetrics object
has additional two columns, a PValue column and a logFC column."

Expand Down

0 comments on commit 5d1631f

Please sign in to comment.