Commit caecad18 authored by Gervaise Henry's avatar Gervaise Henry 🤠
Browse files

Merge branch 'develop' into 'master'

Develop

See merge request !57
parents 4b102a5e bedc0841
Pipeline #4732 passed with stages
in 10 minutes and 54 seconds
......@@ -36,16 +36,19 @@ simple_1:
- branches
- tags
except:
- develop
- master
refs:
- develop
- master
script:
- nextflow run workflow/main.nf --fastq "$CI_PROJECT_DIR/test_data/hu.v3s1r500/*.fastq.gz" --designFile "$CI_PROJECT_DIR/test_data/hu.v3s1r500/design.csv" --genome 'GRCh38-3.0.0' --kitVersion 'three' --version '3.0.2'
- pytest -m count302
- nextflow run workflow/main.nf --fastq "$CI_PROJECT_DIR/test_data/hu.v3s1r500/*.fastq.gz" --designFile "$CI_PROJECT_DIR/test_data/hu.v3s1r500/design.csv" --genome 'GRCh38-3.0.0' --kitVersion 'three' --version '3.1.0'
- pytest -m count310
artifacts:
name: "$CI_JOB_NAME"
when: always
paths:
- .nextflow.log
- workflow/output/count310/sample1/outs/web_summary.html
- workflow/output/multiqc/run/multiqc_report.html
expire_in: 2 days
retry:
max: 1
......@@ -57,17 +60,20 @@ simple_2:
only:
- branches
except:
- develop
- master
- tags
refs:
- develop
- master
- tags
script:
- nextflow run workflow/main.nf --fastq "$CI_PROJECT_DIR/test_data/mu.v3s1r500/*.fastq.gz" --designFile "$CI_PROJECT_DIR/test_data/mu.v3s1r500/design.csv" --genome 'mm10-3.0.0' --kitVersion 'three' --version '3.0.1'
- pytest -m count301
- nextflow run workflow/main.nf --fastq "$CI_PROJECT_DIR/test_data/mu.v3s1r500/*.fastq.gz" --designFile "$CI_PROJECT_DIR/test_data/mu.v3s1r500/design.csv" --genome 'mm10-3.0.0' --kitVersion 'three' --version '3.1.0'
- pytest -m count310
artifacts:
name: "$CI_JOB_NAME"
when: always
paths:
- .nextflow.log
- workflow/output/count310/sample1/outs/web_summary.html
- workflow/output/multiqc/run/multiqc_report.html
expire_in: 2 days
retry:
max: 1
......@@ -80,36 +86,43 @@ detailed_1:
- develop
- master
except:
- tags
refs:
- tags
script:
- nextflow run workflow/main.nf --fastq "$CI_PROJECT_DIR/test_data/hu.v3s2r10k/*.fastq.gz" --designFile "$CI_PROJECT_DIR/test_data/hu.v3s2r10k/design.csv" --genome 'GRCh38-3.0.0' --kitVersion 'auto' --version '3.0.2'
- pytest -m count302
- nextflow run workflow/main.nf --fastq "$CI_PROJECT_DIR/test_data/hu.v3s2r10k/*.fastq.gz" --designFile "$CI_PROJECT_DIR/test_data/hu.v3s2r10k/design.csv" --genome 'GRCh38-3.0.0' --kitVersion 'auto' --version '3.1.0'
- pytest -m count310
artifacts:
name: "$CI_JOB_NAME"
when: always
paths:
- .nextflow.log
- workflow/output/count310/sample1/outs/web_summary.html
- workflow/output/multiqc/run/multiqc_report.html
expire_in: 2 days
retry:
max: 1
when:
- always
detailed_2:
stage: detailed
only:
- develop
- master
except:
- tags
refs:
- tags
script:
- nextflow run workflow/main.nf --fastq "$CI_PROJECT_DIR/test_data/mu.v3s2r10k/*.fastq.gz" --designFile "$CI_PROJECT_DIR/test_data/mu.v3s2r10k/design.csv" --genome 'mm10-3.0.0' --kitVersion 'three' --version '3.0.2'
- nextflow run workflow/main.nf --fastq "$CI_PROJECT_DIR/test_data/hu.v3s2r10k/*.fastq.gz" --designFile "$CI_PROJECT_DIR/test_data/hu.v3s2r10k/design.csv" --genome 'GRCh38-3.0.0' --kitVersion 'auto' --version '3.0.2'
- pytest -m count302
artifacts:
name: "$CI_JOB_NAME"
when: always
paths:
- .nextflow.log
- workflow/output/count302/sample1/outs/web_summary.html
- workflow/output/multiqc/run/multiqc_report.html
expire_in: 2 days
retry:
max: 1
......@@ -122,7 +135,32 @@ detailed_3:
- develop
- master
except:
- tags
refs:
- tags
script:
- nextflow run workflow/main.nf --fastq "$CI_PROJECT_DIR/test_data/mu.v3s2r10k/*.fastq.gz" --designFile "$CI_PROJECT_DIR/test_data/mu.v3s2r10k/design.csv" --genome 'mm10-3.0.0' --kitVersion 'three' --version '3.0.1'
- pytest -m count301
artifacts:
name: "$CI_JOB_NAME"
when: always
paths:
- .nextflow.log
- workflow/output/count301/sample1/outs/web_summary.html
- workflow/output/multiqc/run/multiqc_report.html
expire_in: 2 days
retry:
max: 1
when:
- always
detailed_4:
stage: detailed
only:
- develop
- master
except:
refs:
- tags
script:
- nextflow run workflow/main.nf --fastq "$CI_PROJECT_DIR/test_data/hu.v2s2r10k/*.fastq.gz" --designFile "$CI_PROJECT_DIR/test_data/hu.v2s2r10k/design.csv" --genome 'GRCh38-1.2.0' --kitVersion 'two' --version '2.1.1'
- pytest -m count211
......@@ -131,6 +169,8 @@ detailed_3:
when: always
paths:
- .nextflow.log
- workflow/output/count211/sample1/outs/web_summary.html
- workflow/output/multiqc/run/multiqc_report.html
expire_in: 2 days
retry:
max: 1
......
# v1.1.0 (in development)
# v1.2.0
**User Facing**
* Add Cellranger Version 3.1.0
* Add human/mouse farmyard reference Version 3.1.0 from 10x
* Add Vizapp (shiny)
* Fix mutiqc error
* Add MIT License
**Background**
* Add CI Artifacts
*Known Bugs*
* Vizapp does not yet work for Astrocyte
# v1.1.0
**User Facing**
* Make report (multiqc) for cellranger qc output, version, references
......
MIT License
Copyright (c) 2019 University of Texas Southwestern Medical Center.
Contributors: Gervaise H. Henry, Jeremy Mathews, and Venkat Malladi
Department: Bioinformatic Core Facility, Department of Bioinformatics
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
......@@ -27,7 +27,7 @@ To Run:
* path to the fastq location
* R1 and R2 only necessary but can include I2
* only fastq's in designFile (see below) are used, not present will be ignored
* eg: **--fastq '/project/shared/bicf_workflow_ref/workflow_testdata/cellranger/cellranger_count/hu.v3s2r100k/\*.fastq.gz'**
* eg: **--fastq '/project/shared/bicf_workflow_ref/workflow_testdata/cellranger/cellranger_count/hu.v3s2r10k/\*.fastq.gz'**
* **--designFile**
* path to design file (csv format) location
* column 1 = "Sample"
......@@ -35,7 +35,7 @@ To Run:
* column 3 = "fastq_R2"
* can have repeated "Sample" if there are multiple fastq R1/R2 pairs for the samples
* can be downloaded [HERE](https://git.biohpc.swmed.edu/BICF/Astrocyte/cellranger_count/blob/master/docs/design.csv)
* eg: **--designFile '/project/shared/bicf_workflow_ref/workflow_testdata/cellranger/cellranger_count/hu.v3s2r100k/design.csv'**
* eg: **--designFile '/project/shared/bicf_workflow_ref/workflow_testdata/cellranger/cellranger_count/hu.v3s2r10k/design.csv'**
* **--genome**
* reference genome
* requires workflow/conf/biohpc.config to work
......@@ -46,8 +46,9 @@ To Run:
* *'hg19-1.2.0'* = Human GRCh37 (hg19) release 84
* *'mm10-3.0.0'* = Mouse GRCm38 (mm10) release 93
* *'mm10-3.0.0'* = Mouse GRCm38 (mm10) release 84
* *'hg19_and_mm10-3.0.0'* = Human GRCh37 (hg19) + Mouse GRCm38 (mm19) release 93
* *'hg19_and_mm10-1.2.0'* = Human GRCh37 (hg19) + Mouse GRCm38 (mm19) release 84
* *'GRCh38_and_mm10-3.1.0'* = Human GRCh38 + Mouse GRCm38 (mm10) release 93
* *'hg19_and_mm10-3.0.0'* = Human GRCh37 (hg19) + Mouse GRCm38 (mm10) release 93
* *'hg19_and_mm10-1.2.0'* = Human GRCh37 (hg19) + Mouse GRCm38 (mm10) release 84
* *'ercc92-1.2.0'* = ERCC.92 Spike-In
* if --genome is used then --genomeLocationFull is not necessary
* eg: **--genome 'GRCh38-3.0.0'**
......@@ -83,16 +84,17 @@ To Run:
* cellranger version
* --version (cellranger version) 2.1.1 can only read --kitVersion of two (2)
* options:
* *'3.1.0'*
* *'3.0.2'*
* *'3.0.1'*
* *'2.1.1'*
* eg: **--version '3.0.2'**
* eg: **--version '3.1.0'**
* **--outDir**
* optional output directory for run
* eg: **--outDir 'test'**
* FULL EXAMPLE:
```
nextflow run workflow/main.nf --fastq '/project/shared/bicf_workflow_ref/workflow_testdata/cellranger/cellranger_count/hu.v3s2r100k/*.fastq.gz' --designFile '/project/shared/bicf_workflow_ref/workflow_testdata/cellranger/cellranger_count/hu.v3s2r100k/design.csv' --genome 'GRCh38-3.0.0' --kitVersion 'three' --version '3.0.2' --outDir 'test'
nextflow run workflow/main.nf --fastq '/project/shared/bicf_workflow_ref/workflow_testdata/cellranger/cellranger_count/hu.v3s2r10k/*.fastq.gz' --designFile '/project/shared/bicf_workflow_ref/workflow_testdata/cellranger/cellranger_count/hu.v3s2r10k/design.csv' --genome 'GRCh38-3.0.0' --kitVersion 'three' --version '3.1.0' --outDir 'test'
```
* Design example:
......
......@@ -43,6 +43,7 @@ workflow_modules:
- 'cellranger/2.1.1'
- 'cellranger/3.0.1'
- 'cellranger/3.0.2'
- 'cellranger/3.1.0'
- 'bcl2fastq/2.17.1.14'
- 'multiqc/1.7'
......@@ -104,8 +105,9 @@ workflow_parameters:
- ['hg19-1.2.0', 'Human GRCh37 (hg19) release 84']
- ['mm10-3.0.0', 'Mouse GRCm38 (mm10) release 93']
- ['mm10-1.2.0', 'Mouse GRCm38 (mm10) release 84']
- ['hg19_and_mm10-3.0.0', 'Human GRCh37 (hg19) + Mouse GRCm38 (mm19) release 93']
- ['hg19_and_mm10-1.2.0', 'Human GRCh37 (hg19) + Mouse GRCm38 (mm19) release 84']
- ['GRCh38_and_mm10-3.1.0', 'Human GRCh38 + Mouse GRCm38 (mm10) release 93']
- ['hg19_and_mm10-3.0.0', 'Human GRCh37 (hg19) + Mouse GRCm38 (mm10) release 93']
- ['hg19_and_mm10-1.2.0', 'Human GRCh37 (hg19) + Mouse GRCm38 (mm10) release 84']
- ['ercc92-1.2.0', 'ERCC.92 Spike-In']
required: true
description: |
......@@ -142,8 +144,9 @@ workflow_parameters:
- id: version
type: select
default: '3.0.2'
default: '3.1.0'
choices:
- ['3.1.0', '3.1.0']
- ['3.0.2', '3.0.2']
- ['3.0.1', '3.0.1']
- ['2.1.1', '2.1.1']
......
......@@ -36,8 +36,9 @@ To Run:
* *'hg19-1.2.0'* = Human GRCh37 (hg19) release 84
* *'mm10-3.0.0'* = Human GRCm38 (mm10) release 93
* *'mm10-3.0.0'* = Human GRCm38 (mm10) release 84
* *'hg19_and_mm10-3.0.0'* = Human GRCh37 (hg19) + Mouse GRCm38 (mm19) release 93
* *'hg19_and_mm10-1.2.0'* = Human GRCh37 (hg19) + Mouse GRCm38 (mm19) release 84
* *'GRCh38-and-mm10-3.1.0'* = Human GRCh38 + Mouse GRCm38 (mm10) release 93
* *'hg19_and_mm10-3.0.0'* = Human GRCh37 (hg19) + Mouse GRCm38 (mm10) release 93
* *'hg19_and_mm10-1.2.0'* = Human GRCh37 (hg19) + Mouse GRCm38 (mm10) release 84
* *'ercc92-1.2.0'* = ERCC.92 Spike-In
* **expect cells**
* Expected number of recovered cells.
......
......@@ -4,7 +4,7 @@
* Anaconda (Anaconda Software Distribution, [https://anaconda.com](https://anaconda.com))
2. **cellranger**
* Cellranger mkfastq [https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/mkfastq](https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/mkfastq)
* Cellranger count [https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/count](https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/count)
3. **MultiQc**:
* Ewels P., Magnusson M., Lundin S. and Käller M. 2016. MultiQC: Summarize analysis results for multiple tools and samples in a single report. Bioinformatics 32(19): 3047–3048. doi:[10.1093/bioinformatics/btw354](https://dx.doi.org/10.1093/bioinformatics/btw354)
......
LoadData <- function(dim=c("pca","tsne","umap"),dir,samp){
exp <- readMM(paste0(dir,samp,"/outs/filtered_feature_bc_matrix/matrix.mtx.gz"))
features <- read.table(paste0(dir,samp,"/outs/filtered_feature_bc_matrix/features.tsv.gz"),quote="\t")
barcodes <- read.table(paste0(dir,samp,"/outs/filtered_feature_bc_matrix/barcodes.tsv.gz"),quote="\t")
exp.raw <- readMM(paste0(dir,samp,"/outs/raw_feature_bc_matrix/matrix.mtx.gz"))
features.raw <- read.table(paste0(dir,samp,"/outs/filtered_feature_bc_matrix/features.tsv.gz"),quote="\t")
barcodes.raw <- read.table(paste0(dir,samp,"/outs/raw_feature_bc_matrix/barcodes.tsv.gz"),quote="\t")
dr <- list()
for (i in dim){
if (i=="pca"){
dr[[i]] <- read.csv(paste0(dir,samp,"/outs/analysis/",i,"/10_components/projection.csv"))
dr[[i]] <- dr[[i]][,1:3]
} else {
dr[[i]] <- read.csv(paste0(dir,samp,"/outs/analysis/",i,"/2_components/projection.csv"))
}
}
rm(i)
cl <- c("graphclust",paste0("kmeans_",2:10,"_clusters"))
cluster <- list()
deg <- list()
for (i in cl){
cluster[[i]] <- read.csv(paste0(dir,samp,"/outs/analysis/clustering/",i,"/clusters.csv"))
deg[[i]] <- read.csv(paste0(dir,samp,"/outs/analysis/diffexp/",i,"/differential_expression.csv"))
}
rm(i)
qc <- read.csv(paste0(dir,samp,"/outs/metrics_summary.csv"))
qc <- data.frame(t(qc))
qc[,2] <- qc[,1]
qc[,1] <- rownames(qc)
qc <- qc[-1,]
colnames(qc) <- c("Metric","Value")
results <- list(
sample=samp,
exp=exp,
features=features,
barcodes=barcodes,
exp.raw=exp.raw,
features.raw=features.raw,
barcodes.raw=barcodes.raw,
dr=dr,
cluster=cluster,
deg=deg,
qc=qc
)
return(results)
}
Plot.cluster <- function(dr,cluster){
pl <-merge(dr,cluster,by="Barcode",all.x=TRUE)
axis.labs <- colnames(pl)[2:3]
colnames(pl)[2:3] <- c("dim1","dim2")
plot.out <- ggplot(pl,aes(x=dim1,y=dim2,col=factor(Cluster)))+geom_point()+scale_color_viridis(discrete=TRUE)+xlab(axis.labs[1])+ylab(axis.labs[2])+labs(col="Cluster")+theme_cowplot()
return(plot.out)
}
Plot.feature <- function(dr,ft){
dr$exp <- ft
axis.labs <- colnames(dr)[2:3]
colnames(dr)[2:3] <- c("dim1","dim2")
if (sum(dr$exp) != 0){
plot.out <- ggplot(dr,aes(x=dim1,y=dim2,col=exp))+geom_point()+scale_color_viridis(option="inferno")+xlab(axis.labs[1])+ylab(axis.labs[2])+labs(col="Expression")+theme_cowplot()
} else {
plot.out <- ggplot(dr,aes(x=dim1,y=dim2,col=exp))+geom_point()+scale_color_gradient(low="black",high="black")+xlab(axis.labs[1])+ylab(axis.labs[2])+labs(col="Expression")+theme_cowplot()
}
return(plot.out)
}
Plot.violinbox <- function(ft,cluster){
cluster$exp <- ft
cluster$Cluster <- factor(cluster$Cluster)
plot.out <- ggplot(cluster,aes(x=Cluster,y=exp,fill=Cluster))+geom_violin(scale="width",trim=TRUE)+geom_boxplot(width=0.25,fill="white",outlier.shape=NA)+scale_fill_viridis(discrete=TRUE)+ylab("Expression")+theme_cowplot()+theme(axis.text.x=element_text(angle=45))
return(plot.out)
}
Plot.cliffknee <- function(barcodes.raw,exp.raw,barcodes){
umi <- matrix(nrow=length(barcodes.raw[,1]),ncol=4)
umi[,1] <- t(colSums(exp.raw))
umi[,2] <- as.character(barcodes.raw[,1])
umi <- as.data.frame(umi)
umi[,1] <- as.numeric(levels(umi[,1]))[umi[,1]]
colnames(umi) <- c("nUMI","barcodes","rank","Cell")
umi <- umi[order(umi$nUMI,decreasing=TRUE),]
umi$rank <- 1:nrow(umi)
umi$Cell <- factor(as.character(umi$barcodes %in% barcodes[,1]))
umi$Cell <- factor(umi$Cell,levels(umi$Cell)[c(2,1)])
plot.out <- ggplot(umi,aes(x=rank,y=nUMI,col=Cell))+geom_point()+scale_color_manual(values=c("darkgreen","darkred"))+
scale_x_log10(breaks=trans_breaks("log10",function(x) 10^x),labels=trans_format("log10",math_format(10^.x)))+
scale_y_log10(breaks=trans_breaks("log10",function(x) 10^x),labels=trans_format("log10",math_format(10^.x)))+
annotation_logticks()+xlab("Barcode Rank")+ylab("nUMI")+theme_cowplot()
return(plot.out)
}
library(shiny)
library(shinythemes)
library(Matrix)
library(ggplot2)
library(RColorBrewer)
library(viridis)
library(cowplot)
library(scales)
setwd("../")
source("./vizapp/functions.R")
#load data
dir.shared <- "/work/BICF/s189701/cellranger_count/workflow/output/count310/"
samples <- list.dirs(dir.shared,full.names=FALSE,recursive=FALSE)
results <- LoadData(dim=c("umap","tsne","pca"),dir=dir.shared,samp=samples[1])
# This example implements a simple file browser for accessing results.
library(shiny)
library(shinyFiles)
# Results are available in the directory specified by the outputDir environment
# variable, red by Sys.getenv
rootdir <- Sys.getenv('outputDir')
shinyServer(function(input, output, session) {
# The backend for a simple file chooser, restricted to the
# rootdir we obtained above.
# See https://github.com/thomasp85/shinyFiles
shinyFileChoose(input, 'files', roots=c('workflow'=rootdir), filetypes=c('', 'bed', 'xls','wig'), session=session)
library(shinythemes)
library(Matrix)
library(ggplot2)
library(RColorBrewer)
library(viridis)
library(cowplot)
library(scales)
shinyServer(function(input,output,session){
#reactive inputs
values <- reactiveValues(
results=results,
dr.c="",cluster.c="",
dr.f="",feature.f="",
cluster.vb="",feature.vb="",
cluster.deg="",cluster.1.deg="",alpha.deg="",fc.deg="",direction.deg=""
)
values$results <- eventReactive(input$go.d,{
LoadData(dim=c("umap","tsne","pca"),dir=dir.shared,samp=input$sample)
})
output$loaded <- eventReactive(input$go.d,{
paste0("Sample ",values$results()$sample)
})
output$nav.analysis <- renderUI({
req(values$results()$sample)
tabsetPanel(type="tabs",
tabPanel("Cluster Plot",
sidebarPanel(
h3(textOutput("lab.sample.c")),
uiOutput("dr.c"),
uiOutput("cluster.c"),
actionButton("go.c","Submit")
),
mainPanel(
h3(textOutput("lab.dr.c")),
h4(textOutput("lab.cluster.c")),
plotOutput("plot.cluster.c"),
tags$br(),
uiOutput("button.download.c")
)
),
tabPanel("Feature Plot",
sidebarPanel(
h3(textOutput("lab.sample.f")),
uiOutput("dr.f"),
uiOutput("feature.f"),
actionButton("go.f","Submit")
),
mainPanel(
h3(textOutput("lab.feature.f")),
h4(textOutput("lab.dr.f")),
plotOutput("plot.feature"),
tags$br(),
uiOutput("button.download.f")
)
),
tabPanel("ViolinBox Plot",
sidebarPanel(
h3(textOutput("lab.sample.vb")),
uiOutput("cluster.vb"),
uiOutput("feature.vb"),
actionButton("go.vb","Submit"),
br(),
br(),
plotOutput("plot.cluster.vb")
),
mainPanel(
h3(textOutput("lab.feature.vb")),
h4(textOutput("lab.cluster.vb")),
plotOutput("plot.violinbox"),
tags$br(),
uiOutput("button.download.vb"),
tags$br(),
tags$br(),
tableOutput("table.expression.vb")
)
),
tabPanel("Differentially Expressed Features",
sidebarPanel(
h3(textOutput("lab.sample.deg")),
uiOutput("cluster.deg"),
uiOutput("cluster.1.deg"),
numericInput("alpha.deg","Maximum p-value",min=0,max =1,value=0.05,step=0.001),
numericInput("fc.deg","Minimum Fold Change",min=0,max =50,value=0,step=0.5),
radioButtons("direction.deg","Fold Change Direction",c("Positively Expressed"="up","Negatively Expressed"="down","Both"="both"),selected="up"),
actionButton("go.deg","Submit"),
br(),
br(),
plotOutput("plot.cluster.deg")
),
mainPanel(
h3(textOutput("lab.cluster.1.deg")),
h4(textOutput("lab.cluster.deg")),
h5(textOutput("lab.alpha.deg")),
h5(textOutput("lab.fc.deg")),
uiOutput("download.deg.button"),
tags$br(),
tags$br(),
tableOutput("table.deg")
)
)
)
})
output$nav.qc <- renderUI({
req(values$results()$sample)
tabPanel("Output",
sidebarPanel(
h3(textOutput("lab.sample.qc")),
h4(textOutput("lab.cell.count")),
br(),
tableOutput("qc")
),
mainPanel(
plotOutput("plot.cliffknee")
)
)
})
#sidebar input/outputs
output$lab.sample.c <- reactive({paste0("Sample ",values$results()$sample)})
output$dr.c <- renderUI({selectInput("dr.c","Dimentionality Reduction",names(values$results()$dr))})
output$cluster.c <- renderUI({selectInput("cluster.c","Clustering",names(values$results()$cluster))})
output$lab.sample.f <- reactive({paste0("Sample ",values$results()$sample)})
output$dr.f <- renderUI({selectInput("dr.f","Dimentionality Reduction",names(values$results()$dr))})
output$feature.f <- renderUI({textInput("feature.f","Feature",levels(values$results()$features[,2])[1])})
output$lab.sample.vb <- reactive({paste0("Sample ",values$results()$sample)})
output$cluster.vb <- renderUI({selectInput("cluster.vb","Clustering",names(values$results()$cluster))})
output$feature.vb <- renderUI({textInput("feature.vb","Feature",levels(values$results()$features[,2])[1])})
output$plot.cluster.vb <- renderPlot({
req(input$go.vb)
print(plot.cluster.vb())
})
output$lab.sample.deg <- reactive({paste0("Sample ",values$results()$sample)})
output$cluster.deg <- renderUI({selectInput("cluster.deg","Clustering",names(values$results()$cluster))})
output$cluster.1.deg <- renderUI({
clust <- levels(factor(values$results()$cluster[[req(input$cluster.deg)]]$Cluster))
selectInput("cluster.1.deg", "Specific Cluster",clust,clust[1])
})
observe({
if (!is.numeric(input$alpha.deg)) {
updateNumericInput(session,"alpha","Maximum p-value",min=0,max =1,value=0.05,step=0.001)
}
})
observe({
if (!is.numeric(input$fc.deg)) {
updateNumericInput(session,"fc","Minimum Fold Change",min=0,max =50,value=0,step=0.5)
}
})
output$lab.sample.qc <- reactive({paste0("Sample ",values$results()$sample)})
output$lab.cell.count <- renderText({paste0(nrow(values$results()$barcodes)," Cells Detected")})
output$qc <- renderTable(values$results()$qc)
#main input/outputs
output$lab.dr.c <- eventReactive(input$go.c,{
req(input$go.c)
paste0(toupper(req(input$dr.c))," Reduction")
},ignoreNULL=FALSE)
output$lab.cluster.c <- eventReactive(input$go.c,{
req(input$go.c)
paste0(toupper(req(input$cluster.c))," Clustering")
},ignoreNULL=FALSE)
output$plot.cluster.c <- renderPlot({
req(input$go.c)
print(plot.cluster.c())
})
output$lab.feature.f <- eventReactive(input$go.f,{
req(input$go.f)
if(toupper(req(input$feature.f)) %in% as.character(values$results()$features[,2])){
toupper(req(input$feature.f))
} else {
paste0(req(input$feature.f)," NOT PRESENT")
}
},ignoreNULL=FALSE)
output$lab.dr.f <- eventReactive(input$go.f,{
req(input$go.f)
paste0(toupper(req(input$dr.f))," Reduction")
},ignoreNULL=FALSE)