Commit 454513e0 authored by Midoux Cedric's avatar Midoux Cedric

library(phyloseq.extended)

parent 5e8f1b63
......@@ -21,7 +21,7 @@ output$richnessBScript <- renderText({
scriptHead,
"# Plot heatmap of beta diversity",
glue(
"beta <- melt(as(distance(data, method = \"{input$richnessBDist}\"), \"matrix\"))"
"beta <- data.table::melt(as(distance(data, method = \"{input$richnessBDist}\"), \"matrix\"))"
),
"colnames(beta) <- c(\"x\", \"y\", \"distance\")"
)
......@@ -37,8 +37,8 @@ output$richnessBScript <- renderText({
"L = levels(reorder(sample_names(data), as.numeric(new_factor)))",
"beta$x <- factor(beta$x, levels = L)",
"beta$y <- factor(beta$y, levels = L)",
"palette <- hue_pal()(length(levels(new_factor)))",
"tipColor <- col_factor(palette, levels = levels(new_factor))(variable_sort)"
"palette <- scales::hue_pal()(length(levels(new_factor)))",
"tipColor <- scales::col_factor(palette, levels = levels(new_factor))(variable_sort)"
)
} else {
script <- c(script, "tipColor <- NULL")
......@@ -75,7 +75,7 @@ output$richnessB <- renderPlot({
validate(need(data16S(),
"Requires an abundance dataset"))
beta <-
melt(as(distance(data16S(), method = input$richnessBDist), "matrix"))
data.table::melt(as(distance(data16S(), method = input$richnessBDist), "matrix"))
colnames(beta) <- c("x", "y", "distance")
if (!is.null(checkNull(input$richnessBOrder)))
{
......@@ -85,9 +85,9 @@ output$richnessB <- renderPlot({
L = levels(reorder(sample_names(data16S()), as.numeric(new_factor)))
beta$x <- factor(beta$x, levels = L)
beta$y <- factor(beta$y, levels = L)
palette <- hue_pal()(length(levels(new_factor)))
palette <- scales::hue_pal()(length(levels(new_factor)))
tipColor <-
col_factor(palette, levels = levels(new_factor))(variable_sort)
scales::col_factor(palette, levels = levels(new_factor))(variable_sort)
}
p <-
ggplot(beta, aes(x = x, y = y, fill = distance)) + geom_tile()
......
options(shiny.maxRequestSize = 30 * 1024 ^ 2)
library(shinydashboard)
library(phyloseq)
library(phyloseq.extended)
library(ggplot2)
library(dplyr)
library(glue)
library(factoextra)
......@@ -74,10 +77,6 @@ shinyServer
)
}
source({
"https://raw.githubusercontent.com/mahendra-mariadassou/phyloseq-extended/master/R/load-extra-functions.R"
})
source("internals.R")
data16S <- reactive({
......@@ -143,7 +142,7 @@ shinyServer
scriptHead <- c(
"# Loading packages",
"source(\"https://raw.githubusercontent.com/mahendra-mariadassou/phyloseq-extended/master/R/load-extra-functions.R\")",
"library(phyloseq.extended)",
"",
"# Loading data",
glue(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment