Description Usage Arguments Details Value Author(s) Examples
Create single column heatmap of log2 fold change across two conditions Needs plotly
1 2 3 4 |
exprDataFrame |
Data frame - Gene x sample expression values (counts, tpm, whatever) |
sampleGroups |
List - Two elements, each containing indices of samples in exprDataFrame |
genes |
Character? - |
yticklabSize |
Numeric - Font size for gene symbols |
figHeightPerGene |
Numeric - |
figWidth |
Numeric - |
colorsPlot |
Color ramp - |
ncolors |
Numeric - |
plotTitle |
String - |
minVal |
Numeric - |
maxVal |
Numeric - |
fileOut |
String - If given, save png to with this filename |
Given a gene-by-sample dataframe with expression values, a list with two vectors indicating samples in each of two groups, and (optionally) a list of the genes you want included, make a one-column heatmap of log fold change across the group means for each gene, using plotly. Note that, probably because I'm not set up to do the paying thing, some stuff doesn't get incorporated into the output png. Fold change will be group2 / group1 (so if you put a control condition in group 1, the sign will be positive if expression increased in the treatment condition, not that that changes anything in the heatmap since we'll show abs(LFC)). A pseudocount of 1 is added to all values before taking the means of the two conditions. This means that genes with an original count of 0 get a log2(count) of 0 rather than an infinite value.
Plotly object
Emma Myers
1 2 3 4 5 6 7 | exprData = read.table("Rorb_p2_TPM.csv", header=TRUE, row.names=1, sep=",")
colnames(exprDataFrame) = gsub("BF_RORb", "", colnames(exprDataFrame))
geneList = c("Rorb", "Plxnd1", "Has2", "Sparcl1", "Pde1a", "Has3")
groups = vector("list", 2)
groups[[1]] = colnames(exprDataFrame)[1:4]
groups[[2]] = colnames(exprDataFrame)[5:8]
exprLFC(exprData, genes=geneList, sampleGroups=groups, fileOut="exprLFC.png")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.