Skip to content

Instantly share code, notes, and snippets.

View aaiezza's full-sized avatar

Alessandro Aiezza aaiezza

View GitHub Profile
@aaiezza
aaiezza / RNA-Seq_templateAnalysis.R
Created June 29, 2017 17:14
Template Analysis of RNA-Seq Data.
#!/usr/bin/Rscript
## Properties
FRM_GENE_FILE <- 'frm_gene_exp.diff.txt'
FAV_COLS <- c( 'gene', 'sample_1', 'sample_2', 'value_1', 'value_2', 'log2(fold_change)', 'q_value' )
GENE_ID_FILTER <- '^((Mir([\\d]|let)+.*)|---|LOC\\d+|(.*Rik.*))$'
HEATMAPS_DIR <- 'heatmaps'
VOLCANO_WIDGET_DIR <- 'interactiveVolcanoPlots'
## Package Dependencies
@aaiezza
aaiezza / RNA-Seq_plotUtils.R
Created June 29, 2017 17:06
Miscellaneous functions used for plotting gene data.
#!/usr/bin/Rscript
suppressMessages( library( calibrate ) )
suppressMessages( library( ggplot2 ) )
suppressMessages( library( ggrepel ) )
suppressMessages( library( ggdendro ) )
suppressMessages( library( dendextend ) )
suppressMessages( require( htmlwidgets ) )
suppressMessages( require( gridExtra ) )
suppressMessages( require( plotly ) )
@aaiezza
aaiezza / plotNorm.R
Created June 27, 2017 14:15
ggplot2 plotting function for a Normal Distribution with lightly shaded and labeled standard deviations from the mean. User may also give lower and upper bounds, which adds shading under the curve between those points and a label with the area under the curve. (Made to accommodate for Mathematical Statistics with Applications 7th Ed. - WMS 2008)
##
# Standard function for printing Normal Distribution in ggplot2
# # # #
plotNormCurve <- function( mean = 0, sd = 1, variance = sd ^ 2,
lowerBound = NULL, upperBound = NULL,
sdRange = 3.5,
from = mean - (sdRange * sd),
to = mean + (sdRange * sd),
plotTitle = 'Normal Curve', xlab = 'x', ylab = 'density'
)