Commit 822b971f authored by Miroslava Chirkova's avatar Miroslava Chirkova
Browse files

Merge branch 'dev2' into 'master'

Dev2

See merge request !10
parents 9866a1e1 5a841bcd
install.packages(c('tidyverse', 'hexbin', 'doParallel', 'ggplot2', 'ggbeeswarm', 'ggrepel', 'import', 'logging', 'amap', 'grid'), dependencies = TRUE)
install.packages(c('tidyverse', 'hexbin', 'doParallel', 'ggplot2', 'ggbeeswarm', 'ggrepel', 'import', 'logging', 'amap', 'grid', 'futile.logger'), dependencies = TRUE)
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
......
......@@ -35,7 +35,7 @@ ebseq_v <- function(ebseq_res) {
library(EnhancedVolcano)
res <- GetDEResults(ebseq_res)$PPMat
GeneFC <- PostFC(ebseq_res, SmallNum = 0.01) # Create dataframe with groups
x = log2(GeneFC$RealFC)
x = log2(GeneFC$PostFC)
y = ebseq_res$PPDE
xcond = 2 # Change group colors
......
......@@ -31,7 +31,9 @@ noiseq_v <- function(noiseq_res) {
library(SummarizedExperiment)
library(NOISeq)
library(EnhancedVolcano)
# DE.plot(noiseq_res, q = 0.8, graphic = "MD")
noiseq_res <- noiseq_res@results[[1]]
x = noiseq_res$M
y = noiseq_res$prob
......@@ -62,11 +64,10 @@ noiseq_top <- function(results, n) {
library("NOISeq")
library("biomaRt")
results <- results@results[[1]]
filtered_results <- results
# Filter results by logFC > 1 or logFC < -1
# Filter results by q threshold
filtered_results <- degenes(results, q = 0.8, M = NULL)
# Extract top-n differentially expressed genes ordered by p-value
# Extract top-n differentially expressed genes ordered by prob
top <- head(filtered_results[order(filtered_results$prob, decreasing = TRUE), ], n)
tmp <- gsub("\\..*","",row.names(top))
......@@ -79,8 +80,8 @@ noiseq_top <- function(results, n) {
noiseq_filtered <- function(results) {
library("NOISeq")
# filtering results by probability > 0.9
filtered_results <- degenes(results)
# Filter results by q threshold
filtered_results <- degenes(results, q = 0.8, M = NULL)
filtered_genes <- gsub("\\..*","",row.names(filtered_results))
return(filtered_genes)
}
\ No newline at end of file
......@@ -34,8 +34,9 @@ filtered_signature <- function(results_deseq2, results_ebseq, results_edger, res
# this function saves to file a Venn diagram based on signature of differentially expressed
# genes extracted from edgeR, DeSeq2, voom+limma & EBSeq instruments
# genes extracted from edgeR, DeSeq2, voom+limma, EBSeq & NOISeq instruments
draw_venn_diag <- function() {
library(futile.logger)
# Download results of signature making. Check on zero length subsets
sig_vis <- list()
sig_names <- c()
......@@ -80,10 +81,28 @@ draw_venn_diag <- function() {
import::here(venn.diagram, .from = VennDiagram)
import::here(brewer.pal, .from = RColorBrewer)
import::here(grid.newpage, grid.draw, .from = grid)
myCol <- brewer.pal(number_of_elem, "Pastel2")
if (number_of_elem >= 3) {
myCol <- brewer.pal(number_of_elem, "Pastel2")
} else if (number_of_elem == 2) {
myCol <- c("#B3E2CD", "#FDCDAC")
} else if (number_of_elem == 1) {
myCol <- c("#CBD5E8")
}
pdf("data/venn_diagram.pdf")
grid.newpage()
futile.logger::flog.threshold(futile.logger::ERROR, name = "VennDiagramLogger")
if (number_of_elem == 5) {
pos_ = c(0, -30, -130, 130, 30)
} else if (number_of_elem == 4) {
pos_ = c(-15, 15, 0, 0)
} else if (number_of_elem == 3) {
pos_ = c(-40, 40, 180)
} else if (number_of_elem == 2) {
pos_ = c(-50, 50)
} else {
pos_ = c(0)
}
venn_obj <- venn.diagram(
x = sig_vis,
category.names = sig_names,
......@@ -98,7 +117,7 @@ draw_venn_diag <- function() {
cat.fontface = "bold",
cat.default.pos = "outer",
cat.fontfamily = "sans",
#cat.pos = c(0, -30, -130, 150),
cat.pos = pos_,
filename = NULL
)
grid.draw(venn_obj)
......
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