Tuesday 21 October 2014

Analysing cell data for Jim 20141021

Ok, so I have been developing some R-scripts to play with Jim’s cellular data.

The basic data is made up of 57,290 observations of 18 variables.

It is currently imported as a data.frame called “cells”.

I reduced the number of columns in the dataframe to those I believed are the key.

CODE:
#reduce the number of columns in the dataframe
#I have selected these as the Key variables
keyvar <- c('Section','Target','WC.area','WC.488_Int', 'WC.546_Int', 'Nuc.647_Int' )
# This command creates a dataframe that is a subset with fewer columns
subset <- cells[,keyvar]

This reduces the data to just six columns.


Next step is to split the data into individual treatments.
I did this using a map of the plate, prepared in Excel and saved as a csv file.
N.B. Need to be careful to have a space after “A - 1 “ - otherwise first sample includes “A - 10”, “A - 11” and “A - 12”

There should be a way to do this automatically for all of the conditions but I currently have to do some of this by hand.

Arghh - There has to be a loop or some kind of control structure to do this!!!

Next
I need to remove missing values from each of the data sets…

Then draw the density curves and plot them so that they can be output as a nice looking PDF.

Script Name: AllDensityPlots20141021.R

USING ggplot
So the next step is to do the dot plots.
I can get this to work well with the ppErk and the HA staining.
However, the EdU staining is more awkward and I am going to have to ask Jim how he did that.
Script Name: DotPlots20141021.R



No comments:

Post a Comment