Skip to content

Commit

Permalink
Solve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
RiboRings committed Aug 31, 2023
2 parents b6718ae + f6827c4 commit 2553844
Show file tree
Hide file tree
Showing 17 changed files with 60 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
.RData
.pdf
inst/extras/
^doc$
^Meta$
2 changes: 1 addition & 1 deletion .github/workflows/check-bioc-devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ jobs:
BiocManager::install("HDF5Array")
BiocManager::install("fionarhuang/TreeSummarizedExperiment")
BiocManager::install("microbiome/mia")
devtools::install_github("microbiome/miaTime")
devtools::install_github("microbiome/miaTime")
# rspm is out of date
install.packages("matrixStats", repos = "https://cran.rstudio.com/")
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ inst/doc
docs
.Rhistory
*.RData
<<<<<<< HEAD
.DS_Store
=======
/doc/
/Meta/
>>>>>>> origin/plotRDA
10 changes: 6 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: miaViz
Title: Microbiome Analysis Plotting and Visualization
Version: 1.9.1
Version: 1.9.2
Authors@R:
c(person(given = "Tuomas", family = "Borman", role = c("aut", "cre"),
email = "[email protected]",
Expand All @@ -10,7 +10,8 @@ Authors@R:
comment = c(ORCID = "0000-0001-5064-0928")),
person(given = "Leo", family = "Lahti", role = c("aut"),
email = "[email protected]",
comment = c(ORCID = "0000-0001-5537-637X"))
comment = c(ORCID = "0000-0001-5537-637X")),
person(given = "Basil", family = "Courbayre", role = c("ctb"))
)
Description: The miaViz package implements functions to visualize
TreeSummarizedExperiment objects especially in the context of microbiome
Expand All @@ -30,7 +31,6 @@ Imports:
methods,
stats,
S4Vectors,
miaTime,
BiocGenerics,
BiocParallel,
DelayedArray,
Expand All @@ -55,7 +55,9 @@ Suggests:
testthat,
patchwork,
vegan,
microbiomeDataSets
microbiomeDataSets,
bluster,
miaTime
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
VignetteBuilder: knitr
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import(ggplot2)
import(ggraph)
import(methods)
import(mia)
import(miaTime)
importFrom(BiocGenerics,ncol)
importFrom(BiocGenerics,nrow)
importFrom(BiocParallel,SerialParam)
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ Changes in version 1.5.x

Changes in version 1.7.x
+ Fixed plotGraph* that was broked due changes in dependencies

Changes in version 1.9.x
+ Updated plotDMN to work with newest mia version
1 change: 0 additions & 1 deletion R/miaViz.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ NULL
#' @import methods
#' @import TreeSummarizedExperiment
#' @import mia
#' @import miaTime
#' @import ggplot2
#' @import ggraph
#' @importFrom rlang sym !! :=
Expand Down
2 changes: 1 addition & 1 deletion R/plotAbundance.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
#' ## Compositional barplot with top 5 taxa and samples sorted by "Bacteroidetes"
#'
#' # Getting top taxa on a Phylum level
#' se <- transformCounts(se, method="relabundance")
#' se <- transformAssay(se, method="relabundance")
#' se_phylum <- agglomerateByRank(se, rank ="Phylum", onRankOnly=TRUE)
#' top_taxa <- getTopTaxa(se_phylum,top = 5, assay.type = "relabundance")
#'
Expand Down
2 changes: 1 addition & 1 deletion R/plotAbundanceDensity.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
#' plotAbundanceDensity(tse, assay.type = "counts")
#'
#' # Counts relative abundances
#' tse <- transformCounts(tse, method = "relabundance")
#' tse <- transformAssay(tse, method = "relabundance")
#'
#' # Plots the relative abundance of 10 most abundant taxa.
#' # "nationality" information is used to color the points. X-axis is log-scaled.
Expand Down
8 changes: 4 additions & 4 deletions R/plotCCA.R
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ setMethod("plotRDA", signature = c(object = "SingleCellExperiment"),
vector_label <- rownames(vector_data)
# Make labels more tidy
if( all_var_found ){
vector_label <- .tidy_vector_labels(vector_label, coldata)
vector_label <- .tidy_vector_labels(vector_label, coldata, ...)
}
# Add to df
vector_data$vector_label <- vector_label
Expand Down Expand Up @@ -252,7 +252,7 @@ setMethod("plotRDA", signature = c(object = "SingleCellExperiment"),
# Get vector labels
vector_label <- vector_data[["vector_label"]]
# Add significance to vector labels
vector_label <- .add_signif_to_vector_labels(vector_label, variable_names, signif_data)
vector_label <- .add_signif_to_vector_labels(vector_label, variable_names, signif_data, ...)
vector_data[["vector_label"]] <- vector_label
} else{
# If it cannot be found, give warning
Expand Down Expand Up @@ -297,7 +297,7 @@ setMethod("plotRDA", signature = c(object = "SingleCellExperiment"),
# Make vector labels more tidy, i.e, separate variable and group names.
# Replace also underscores with space
.tidy_vector_labels <- function(
vector_label, coldata, sep_group = "\U2012", sep_underscore = " "){
vector_label, coldata, sep_group = "\U2012", sep_underscore = " ", ...){
# Get variable names from sample metadata
var_names <- colnames(coldata)
# Loop through vector labels
Expand All @@ -322,7 +322,7 @@ setMethod("plotRDA", signature = c(object = "SingleCellExperiment"),
}

# This function adds significance info to vector labels
.add_signif_to_vector_labels <- function(vector_label, var_names, signif_data, sep_underscore = " "){
.add_signif_to_vector_labels <- function(vector_label, var_names, signif_data, sep_underscore = " ", ...){
# Replace underscores from significance data and variable names to match labels
rownames(signif_data) <- sapply(rownames(signif_data), function(x) gsub("_", sep_underscore, x))
var_names <- sapply(var_names, function(x) gsub("_", sep_underscore, x))
Expand Down
26 changes: 20 additions & 6 deletions R/plotDMN.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,19 @@
#' @name plotDMN
#'
#' @examples
#' data(dmn_se, package = "mia")
#' names(metadata(dmn_se))
#'
#' # plot the fit
#' plotDMNFit(dmn_se, type = "laplace")
#' library(mia)
#' library(bluster)
#'
#' # Get dataset
#' data("peerj13075", package = "mia")
#' tse <- peerj13075
#'
#' # Cluster the samples
#' tse <- cluster(tse, DmmParam(k = 1:4), name = "DMM", full = TRUE)
#'
#' # Plot the fit
#' plotDMNFit(tse, name = "DMM", type = "laplace")
#'
NULL

#' @rdname plotDMN
Expand All @@ -43,7 +51,13 @@ setGeneric("plotDMNFit", signature = "x",
setMethod("plotDMNFit", signature = c(x = "SummarizedExperiment"),
function(x, name = "DMN", type = c("laplace","AIC","BIC")){
#
dmn <- getDMN(x, name)
if (!is.null(metadata(x)[[name]]$dmm)) {
dmn <- metadata(x)[[name]]$dmm
} else {
.Deprecated(old="getDMN", new="cluster",
"Now runDMN and calculateDMN are deprecated. Use cluster with DMMParam parameter and full parameter set as true instead.")
dmn <- metadata(x)[[name]]
}
fit_FUN <- mia:::.get_dmn_fit_FUN(type)
#
k <- vapply(dmn, function(d){ncol(mixture(d))}, numeric(1))
Expand Down
2 changes: 1 addition & 1 deletion R/plotSeries.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
#' colour_by = "Family")
#'
#' # Counts relative abundances
#' object <- transformCounts(object, method = "relabundance")
#' object <- transformAssay(object, method = "relabundance")
#'
#' # Selects taxa
#' taxa <- c("seq_1", "seq_2", "seq_3", "seq_4", "seq_5")
Expand Down
2 changes: 1 addition & 1 deletion man/plotAbundance.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/plotAbundanceDensity.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions man/plotDMN.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/plotSeries.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/miaViz.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ if(!requireNamespace("devtools", quietly = TRUE)){
BiocManager::install("devtools")
}
if(!requireNamespace("miaTime", quietly = TRUE)){
devtools::install_github("microbiome/miaTime")
devtools::install_github("microbiome/miaTime", upgrade = "never")
}
```

Expand Down

0 comments on commit 2553844

Please sign in to comment.