Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/sh | |
# script to update R | |
sudo add-apt-repository "deb http://cran.rstudio.com/bin/linux/ubuntu $(lsb_release -cs)/" | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9 | |
sudo add-apt-repository -y "ppa:marutter/rrutter" | |
sudo add-apt-repository -y "ppa:marutter/c2d4u" | |
sudo apt-get update -qq | |
sudo apt-get install -y --no-install-recommends r-base-dev r-recommended qpdf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ggplot(data = df_molten, | |
aes(x = variable, y = MouseID, fill = value)) + | |
geom_raster() + | |
xlab("Protein") + | |
scale_fill_distiller(palette = "RdYlBu", trans = "log10") + # better colourmap | |
theme(axis.text.x = element_text(angle = 90, hjust = 1), | |
axis.text.y = element_blank()) + | |
ggtitle("ggplot heatmap") + | |
facet_wrap(~class, scales = "free", ncol = 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dat <- df_expression[,2:78] # numerical columns | |
rownames(dat) <- df_expression[,1] | |
row.order <- hclust(dist(dat))$order # clustering | |
col.order <- hclust(dist(t(dat)))$order | |
dat_new <- dat[row.order, col.order] # re-order matrix accoring to clustering | |
df_molten_dat <- melt(as.matrix(dat_new)) # reshape into dataframe | |
names(df_molten_dat)[c(1:2)] <- c("MouseID", "Protein") | |
ggplot(data = df_molten_dat, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(reshape2) | |
df_expression <- read.csv("expression.csv") | |
df_molten <- melt(df_expression) | |
ggplot(data = df_molten, | |
aes(x = variable, y = MouseID, fill = value)) + | |
geom_raster() + | |
xlab("Protein") + | |
scale_fill_distiller(palette = "RdYlBu", trans = "log10") + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# change colours of channels | |
plotRGB(image_stack, stretch = 'lin' g = 2, b = 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# merge channels | |
image_stack <- brick(image_DNA, image_actin) | |
# display merged image | |
plotRGB(image_stack, stretch = 'lin') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# display images | |
plot(image_DNA, col = gray.colors(max(values(image_DNA)))) | |
plot(image_actin, col = gray.colors(max(values(image_actin)))) |