Skip to content

Commit

Permalink
Merge pull request #20 from LUMC/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tomkuipers1402 authored Jun 14, 2021
2 parents 250333b + d377a95 commit 1e6c7ac
Show file tree
Hide file tree
Showing 51 changed files with 983 additions and 1,531 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ Changelog
<!--
Newest changes should be on top.
-->
version 1.4.4
---------------------------
+ Add file names and md5 to markdown
+ Add new CPM filter for number of samples (percentage)
+ Add dendrogram to dimension reduction
+ Change export file name and remove quotes from exported dataframe
+ Small infobox update
+ Add tSNE plot to dimension reduction
+ Move normalized MDS to Dimension reduction
+ Change PCA tab to dimension reduction
+ Remove MDS 3D and PCA 3D
+ Fix false warning: Contrast are the same error

version 1.4.3
---------------------------
+ Add prior count to CPM calculation
Expand Down
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Package: dgeAnalysis
Type: Package
Title: dgeAnalysis
Version: 1.4.3
Version: 1.4.4
Author@R:
person("Tom", "Kuipers", email = "t.b.kuipers@outlook.com", role = c("aut", "cre"))
person("Tom", "Kuipers", email = "t.b.kuipers@lumc.nl", role = c("aut", "cre"))
Description:
R shiny tool to perform differential gene expression and view the results interactively.
Depends: R (>= 3.6.1)
Expand All @@ -27,12 +27,12 @@ Imports:
scales (>= 1.1.1),
broom (>= 0.7.1),
plotly (>= 4.9.2),
Rtsne (>= 0.15),
rmarkdown (>= 2.4),
gprofiler2 (>= 0.2.0),
igraph (>= 1.2.5),
WGCNA (>= 1.69)
igraph (>= 1.2.5)
biocViews: Annotation, Clustering, GeneSetEnrichment, GO, KEGG,
MultipleComparison, Pathways, Reactome, Visualization,
Sequencing, RNASeq, GeneExpression, Transcription,
Normalization, DifferentialExpression, Bayesian, Regression,
PrincipalComponent, WGCNA
PrincipalComponent, gProfiler, DGE, dgeAnalysis
Binary file modified MANUAL.pdf
Binary file not shown.
13 changes: 3 additions & 10 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,17 @@ export(informationBox)
export(list2df)
export(list2graph)
export(ma_plot)
export(multidimensionalScaling2dPlot)
export(multidimensionalScaling3dPlot)
export(multidimensionalScalingPlot)
export(pValuePlot)
export(plot_module_trait_relation_heat)
export(plot_modules)
export(plot_power)
export(plot_soft)
export(plot_trait_heat)
export(pcaPlot)
export(plotlyGraph)
export(plotly_dendro_heat)
export(plotly_dendrogram)
export(readCountsFromTable)
export(relevelSamples)
export(samplePca2dPlot)
export(samplePca3dPlot)
export(stackDge)
export(startApp)
export(topDgeHeatmapPlot)
export(tsnePlot)
export(variableHeatmapPlot)
export(variancePcaPlot)
export(volcanoPlot)
Expand Down
112 changes: 112 additions & 0 deletions R/de.R
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,115 @@ gamConfidenceFit <- function(deTab, biasColumn) {
}

## --------------------------------------------------------------------------

## ----- TREE PLOTS -----


#' Get heigth information from tree object.
#' Get labels/names from tree ends.
#' Calculate start and end positions of tree branches
#' Save line coordinates in dataframe
#'
#' @param tree Hclust object, tree object
#'
#' @return new, (Dataframe) dataframe with all dendrogram line coordinates
#'
#' @export

get_dendrogram_data <- function(tree,
labels = NULL,
horiz = FALSE,
reverseDirection = FALSE,
hang = 0.1,
xlab = "",
ylab = "",
axes = TRUE,
cex.labels = 1,
...,
adjustRange = FALSE) {
hang.gr = hang
if (hang < 0)
hang.gr = 0.1
n = length(tree$order)
heights = tree$height
range = range(heights)
hang.scaled = hang.gr * (max(heights) - min(heights))
range[1] = range[1] - hang.scaled

indexLim = c(0.5, n + 0.5)
if (adjustRange)
{
ctr = mean(indexLim)
indexLim = ctr + (indexLim - ctr) / 1.08
}

nMerge = n - 1
if (is.null(labels))
labels = tree$labels
if (is.null(labels))
labels = rep("", n)
if (is.na(labels[1]))
labels = rep("", n)
if (is.logical(labels) && labels[1] == "FALSE")
labels = rep("", n)

singleton.x = rep(NA, n)
singleton.x[tree$order] = c(1:n)
cluster.x = rep(NA, n)

new <- data.frame(matrix(
ncol = 5,
nrow = 0,
dimnames = list(NULL, c("label", "x", "y", "xend", "yend"))
))
for (m in 1:nMerge) {
o1 = tree$merge[m, 1]
o2 = tree$merge[m, 2]
h = heights[m]
hh = if (hang > 0)
h - hang.scaled
else
range[1]
h1 = if (o1 < 0)
hh
else
heights[o1]
h2 = if (o2 < 0)
hh
else
heights[o2]

x1 = if (o1 < 0)
singleton.x[-o1]
else
cluster.x[o1]
x2 = if (o2 < 0)
singleton.x[-o2]
else
cluster.x[o2]

cluster.x[m] = mean(c(x1, x2))

label1 <- labels[-o1]
label2 <- labels[-o2]
if (length(label1) > 1) {
label1 <- ""
}
if (length(label2) > 1) {
label2 <- ""
}

if (!is.na(x1)) {
new[nrow(new) + 1, ] <- c(label1, x1, h1, x1, h)
if (!is.na(x2)) {
new[nrow(new) + 1, ] <- c("", x1, h, x2, h)
new[nrow(new) + 1, ] <- c(label2, x2, h2, x2, h)
}
}
}
new[2:5] <- sapply(new[2:5], as.double)
new <- new[order(new$x), ]
return(new)
}

## --------------------------------------------------------------------------
Loading

0 comments on commit 1e6c7ac

Please sign in to comment.