Skip to content

Instantly share code, notes, and snippets.

@CnrLwlss
Created August 19, 2015 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CnrLwlss/bc9781a453de6ffd8c0b to your computer and use it in GitHub Desktop.
Save CnrLwlss/bc9781a453de6ffd8c0b to your computer and use it in GitHub Desktop.
count_DDY835=c(10,13,9,7,0,15,7,0,7,0,0,10,9,5,0,10,12,6,9,8,0,10,10,0,11,0,0,9,0,0,0,0)
count_DDY836=c(15,11,8,17,0,10,7,0,7,0,0,12,8,8,0,9,12,13,10,12,0,13,10,0,8,0,0,10,0,0,0,0)
gtype=c("wt","nmd2D","exo1D","rad24D","cdc13D","nmd2_exo1D","nmd2D_rad24D","nmd2D_cdc13D",
"exo1D_rad24D","exo1D_cdc13D","rad24D_cdc13D","nmd2D_exo1D_rad24D","nmd2D_exo1D_cdc13D","nmd2D_rad24D_cdc13D",
"exo1D_rad24D_cdc13D","nmd2D_exo1D_rad24D_cdc13D","rif1_wt","rif1_nmd2D","rif1_exo1D","rif1_rad24D","rif1_cdc13D",
"rif1_nmd2_exo1D","rif1_nmd2D_rad24D","rif1_nmd2D_cdc13D","rif1_exo1D_rad24D","rif1_exo1D_cdc13D","rif1_rad24D_cdc13D","rif1_nmd2D_exo1D_rad24D",
"rif1_nmd2D_exo1D_cdc13D","rif1_nmd2D_rad24D_cdc13D","rif1_exo1D_rad24D_cdc13D","rif1_nmd2D_exo1D_rad24D_cdc13D")
df=data.frame(gene=gtype,count_DDY835=count_DDY835,count_DDY836=count_DDY836,stringsAsFactors=FALSE)
op=par(mfrow=c(1,2))
hist(df$count_DDY835,breaks=16,xlab="Observed count",main="Number of colonies formed by random\nsamples of 32 possible genotypes (DDY835)")
hist(df$count_DDY836,breaks=16,xlab="Observed count",main="Number of colonies formed by random\nsamples of 32 possible genotypes (DDY836)")
par(op)
# Assume that the number of cells of each genotype inocultated onto YEPD plate equal max number of colonies observed
# What is the probability that the expected number of counts is zero?
inoc=max(df$count)
for(i in seq_along(df$count)){
print(df$gene[i])
print(binom.test(df$count_DDY835[i],inoc,0)$p.value)
print(binom.test(df$count_DDY836[i],inoc,0)$p.value)
}
# Alternatively, do one sample t-test:
# Is the mean of the counts in the non-zero observations significantly greater than zero?
nonz_DDY835=df$count_DDY835[df$count_DDY835>0]
nonz_DDY836=df$count_DDY836[df$count_DDY836>0]
t.test(nonz_DDY835)
t.test(nonz_DDY836)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment