Commit c0dfc6fb authored by Antonio Politi's avatar Antonio Politi
Browse files

Comments update

parent 2b74e546
# ----
# Script to plot live cell data from Joe Padgett
# subtract automatically bg and use Segementation results from J.Hossain
# Antonio Politi, EMBL September 2016
library('ggplot2')
library('readxl')
library('reshape')
library('plyr')
# ----
concatResultsNew <- function (files, bgSub, coeff) {
# fuction concatResultsNew ----
concatResultsNew <- function (files, bgSub = 1, coeff = 0.6) {
# concatenate different files generated by segmentation algorithm of J. Hossain for inner-core, outer-core surface intensity estimation
# and subtract background
# INPUT:
# files: a list of files
# bgSub: 0, subtract background computed at anaphase; 1: subtract background from file located in BGcomp/bg/cellname_bg.txt
# coeff: fraction of nuclear/cytoplasm signal used for background subtraction
# OUTPUT:
# totalNuc; concatenated result file with continuous number nuclei and subtracted background
totalNuc <- data.frame()
id =0
......@@ -95,13 +105,19 @@ concatResultsNew <- function (files, bgSub, coeff) {
return(totalNuc)
}
# ----
# fuction computeMeansMax --------
computeMeansMax <- function(tot, sirna=0) {
# Aggregate data and compute means and max
# INPUT:
# tot: concatenated files from concatResultsNew
# sirna: 0 or 1 to specify if siRNA has been used
# OUTPUT:
# mval: maximal value of different variables
colNames = c('AvgIntOuterCore_ss', 'AvgIntInnerCore_ss', 'AvgIntNonCore_ss', 'AvgIntNuc_ss',
'AvgIntOuterCore_ms', 'AvgIntInnerCore_ms', 'AvgIntNonCore_ms', 'AvgIntNuc_ms','TotIntOuterCore_ss', 'TotIntInnerCore_ss', 'TotIntNonCore_ss', 'TotIntNuc_ss',
'TotIntOuterCore_ms', 'TotIntInnerCore_ms', 'TotIntNonCore_ms', 'TotIntNuc_ms', 'Area', 'bg')
if (sirna > 0) {
tot<-subset(tot, siRNA == sirna)
tot<-subset(tot, siRNA == sirna)
}
mVal = data.frame()
for (coln in colNames ){
......@@ -123,8 +139,9 @@ computeMeansMax <- function(tot, sirna=0) {
}
# -----
# function plotfun -----
plotfun <- function(totalNuc, varName, siRNAname, varAxisName, xl, yl) {
# function to plot data
siR <- unique(totalNuc$siRNA)
for (si in siR) {
p <- ggplot(data = subset(totalNuc, siRNA == si), aes_string(x='time', y = varName))+
......@@ -150,8 +167,9 @@ plotfun <- function(totalNuc, varName, siRNAname, varAxisName, xl, yl) {
p
}
# ----
# function plotfunmul ----
plotfunmul <- function(totalNuc, varName, siRNAname, varAxisName, xl, yl) {
# plot multiple dataset in one graph
siR <- unique(totalNuc$siRNA)
col = c('green', 'red', 'blue')
colName <- c("WholeNuc","InnerCore","NonCore")
......@@ -183,7 +201,7 @@ plotfunmul <- function(totalNuc, varName, siRNAname, varAxisName, xl, yl) {
ggsave(filename=paste('regions_siRNA', paste(siR, collapse = '') , '.png', sep=''), plot=p, width = 151, height = 80, units = 'mm')
}
# -----
# function plotmeans ----
plotMeans <- function(mean1, mean2, colname, regionname, ylabT, filenameT) {
pdata <- rbind(subset(mean1,Region %in% colname),
subset(mean2,Region %in% colname))
......@@ -197,13 +215,12 @@ plotMeans <- function(mean1, mean2, colname, regionname, ylabT, filenameT) {
return(p)
}
# -----
# READ DATA in-----
# Scrambled ELYSKD
if (Sys.info()['sysname'] == 'Darwin'){
setwd('/Users/toni/Dropbox/NPCMaturation/expdata/livecell_siRNA/images/ELYSKD/ScrambledsiRNA')
} else {
setwd('C:\\Users\\toni\\Dropbox\\NPCMaturation\\expdata\\livecell_siRNA\\images\\ELYSKD\\ScrambledsiRNA')
}
files = c('ScrambledsiRNA_subset1', 'ScrambledsiRNA_subset2', 'ScrambledsiRNA_subset3', 'ScrambledsiRNA_subset4', 'ScrambledsiRNA_subset5',
......
# script to plot live cell data acquired for
# Shotaro et al. 2016 eLife paper
library("Hmisc")
library("ggplot2")
# -----
......
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