#+LaTeX_HEADER: \usepackage[T1]{fontenc}
#+LaTeX_HEADER: \usepackage{mathpazo}
#+LaTeX_HEADER: \linespread{1.05}
#+LaTeX_HEADER: \usepackage[scaled]{helvet}
#+LaTeX_HEADER: \usepackage{courier}
#+LATEX_HEADER:  
#+LATEX_HEADER: %%% 
#+LATEX_HEADER: %%% for multiple plots per .pdf 
#+LATEX_HEADER: \usepackage{pdfpages} 
#+LATEX_HEADER: %%% recommended for Org mode export 
#+LATEX_HEADER: \definecolor{mygrey}{gray}{0.97} 
#+LATEX_HEADER: \definecolor{darkblue}{rgb}{0, 0, 0.5} 
#+LATEX_HEADER: \lstloadlanguages{[Auto]Lisp} 
#+LATEX_HEADER: \lstloadlanguages{R} 
#+LATEX_HEADER: \lstloadlanguages{[LaTeX]TeX} 
#+LATEX_HEADER: \lstset{frame=single} 
#+LATEX_HEADER: \lstset{framerule=0pt} 
#+LATEX_HEADER: \lstset{backgroundcolor=\color{mygrey}}  
#+LATEX_HEADER: \lstset{basicstyle=\small} 
#+LATEX_HEADER: \lstset{columns=fullflexible} 
#+LATEX_HEADER: \lstset{commentstyle=\color{cyan}} 
#+LATEX_HEADER: \lstset{stringstyle=\ttfamily} 
#+LATEX_HEADER: \lstset{showstringspaces=false} 
#+LATEX_HEADER: \lstset{breaklines=true} 
#+LATEX_HEADER: \lstset{texcl=true} 
#+LATEX_HEADER: \hypersetup{colorlinks=true} 
#+LATEX_HEADER: \hypersetup{linkcolor=darkblue} 
#+LATEX_HEADER: %%% 
#+LATEX_HEADER: %%% other useful additions 
#+LATEX_HEADER: %%% 
#+LATEX_HEADER: %%% for rerunfilecheck: 
#+LATEX_HEADER: %%% no need to rerun to get outlines right 
#+LATEX_HEADER: \usepackage{bookmark} 
#+LATEX_HEADER: %%% for nice tables 
#+LATEX_HEADER: \usepackage{booktabs} 
#+LATEX_HEADER: %%% for e.g. \formatdate  
#+LATEX_HEADER: \usepackage{datetime} 
#+LATEX_HEADER: %%% for SI units 
#+LATEX_HEADER: \usepackage{siunitx} 
#+LATEX_HEADER: %%% for chemical symbols 
#+LATEX_HEADER: \usepackage[version=3]{mhchem} 
#+LATEX_HEADER: %%% to use forced 'here'  
#+LATEX_HEADER: %%% e.g. \begin{figure}[H] 
#+LATEX_HEADER: \usepackage{float} 
#+LATEX_HEADER: %%% for large numbers of floats 
#+LATEX_HEADER: \usepackage{morefloats} 
#+LATEX_HEADER: %%% to keep floats in same section 
#+LATEX_HEADER: \usepackage[section]{placeins} 
#+LATEX_HEADER: %%% for tables > 1 page 
#+LATEX_HEADER: \usepackage{longtable} 

#+TITLE: 32k
#+AUTHOR: Chris Dardis
#+DATE: \formatdate{24}{2}{2014}

* Aim

Investigate whether growth of a mouse melanoma cell line is impaired in the
presence of Beta-Hydroxy Butyrate (BHB).

* Materials

- *B16-F1-Luc2-BR2* cells.\\
  These were generated as follows:
  - B16 cells are available from ATCC \textregistered.
  - These were were transfected in our lab with luciferase (to allow luminescence to be used a measure of cell numbers) along with a promotor.
  - They were then injected into the right ventricle of a mouse.\\
    These animals were sacraficed when they became symptommatic due to metastatic disease.
  - Cells metastatic to the brain were recovered and grown again in the same medium.
  These cells are the subject of this study.
- $2 \times$ 12-well plastic culture plates (Falcon \textregistered)
- 12-well plastic culture plate (Falcon \textregistered)
- Media: *DMEM* (Gibco \textregistered) +10% FCS +
  \SI{600}{\ug\per\ml} G418 + 1x glutamine. pH \num{7.4}.\\
  FCS = Fetal calf serum.
- Trypsin
- Hemocytometer (manual and automated
  (Countess\texttrademark by Invitrogen\texttrademark)
- \SI{15}{\ml} plastic centrifuge tube (VWR\texttrademark)
  * Trypan blue stain 10\%
  * Eppendorf tubes (plastic, sterile)
  * PCR tubes (for mixing cells and Trypan blue)
  * Disposable slides for Countess\texttrademark


* Methods

** Day 0 

- The cell count from the T-25 flask was \num{1104e3}.
- For the cells being grown with \SI{10}{\umol\per\liter} BHB,
  add \SI{0.01639}{\g} of (R)-(-)-3-hydroxy butyric acid sodium salt to the \SI{50}{\ml} tube before the media and cells.
- Seed $2 \times$ \num{12}-well plates with \num{16e3} cells in \SI{1}{\ml} of media.\\
  For \num{16e3} cells, this is $\frac{16}{438} = \SI{0.035}{\ml}$. \\
  Add $13 \times \SI{0.035}{\ml} = \SI{0.46}{\ml}$ to a \SI{50}{\ml} plastic tube (for mixing media with BHB) and
  top up to \SI{13}{\ml}. \\
  Mix well by pipetting up and down $\times 20$. \\
  Add \SI{1}{\ml} was to each of the \num{12} wells.
- Shake the plates gently to evenly distribute the cells.\\
  Return to the incubator at \formattime{17}{30}{00}.
- Incubate at \SI{37}{\celsius}, in 5\% \ce{CO2} for
  \SI{24}{\hour}.

** Days 1-4

- For plates which are not being counted:\\
  Aspirate the old media and replace with \SI{1}{\ml} of new media.
- For plates being grown in BHB, prepare the media was prepared by adding BHB as on day 0.\\
  The quantities of BHB required are shown in the table below.
- For plates to be counted:\\
  Add \SI{2}{\ml} of trypsin to each in the row to be counted.\\
  Rock the plates.\\
  Remove the trypsin after < \SI{30}{\s}.
- Add \SI{250}{\uL} of trypsin.
- Incubate at \SI{37}{\celsius} for \SI{3}{\minute}.
- Shake the plate to ensure all cells are dislodged from the base.\\
  Check with the microscope.
- 'Quench' the trypsin quenched with \SI{250}{\uL} of media.\\
  Pipette up and down $\times 20$ using glass Pasteur pipette to ensure the cells are thoroughly mixed.
- Return plates to incubator.
- Remove \SI{11}{\uL} of cell suspension and add \SI{11}{\uL}
  Trypan Blue in a sterile PCR tube.\\
  Mix using a pipette.
- Place \SI{10}{\uL} of the mixture into a sample well of the hemocytometer.
- Count the cells using the hemocytometer.\\
  These counts are shown in table \ref{tab:data}.

#+CAPTION: Quantities of BHB required each day
#+LABEL: tab:bhb
| Day | No. wells | Volume of media (ml) | BHB (grams) |
|-----+-----------+----------------------+-------------|
| <c> | <c>       | <c>                  | <c>         |
| 1   | 9         | 10                   | 0.01260     |
| 2   | 6         | 7                    | 0.00882     |
| 3   | 3         | 4                    | 0.00504     |

** Notes on methods

On day 3 observations were unable to be completed for reasons
unrelated to the experiment.

This experiment was previously tried using initial seeding
densitities of \num{16e3} cells per ml. Using the same manual counting
method, these cells appeared /much smaller/ (< 0.5 diameter) and
typically the fine-focus of the microscope was required to determine
whether the cells were viable (i.e. had a visible halo and no sign of Trypan blue uptake).

* Results

** Results

#+NAME: Results
#+begin_src R :session *session* :exports results :results output :results verbatim :results latex 
df1 <- data.frame(Day = rep(rep(0:4, each=3), 2),
                  Tx = rep(c("Control", "BHB"), each=15),
                  Count = c(rep(32e3, 3),
                  20e3, 36e3, 36e3,
                  42e3, 8e3, 6e3,
                  128e3, NA, NA,
                  492e3, 66e3, 176e3,
                  rep(16e3, 3),
                  12e3, 6e3, 4e3,
                  8e3, 14e3, 4e3,
                  NA, NA, NA,
                  32e3, 46e3, 46e3))
library(xtable)
print(xtable(df1,
             caption="Cells per ml, day 0 - 4",
             align=c("l", rep("c", 3)),
             display=c("d", "d", "s", "fg"),
             label="tab:data"),
      booktabs=TRUE)
#+end_src
   
** Standard error

#+NAME: Standard error
#+begin_src R :session *session* :exports code :results output :results verbatim :results code 
##  $SE_{\bar{x}} = \frac{\displaystyle\sigma}{\displaystyle\sqrt{x}}$
stdErr <- function(x) sqrt(var(x)) / sqrt(length(x))
library(plyr)
(df2 <- ddply(df1, c("Day", "Tx"), summarise,
             mean = mean(Count),
             SE = stdErr(Count)))
#+end_src

** Plot

#+NAME: Plot
#+begin_src R :session *session* :exports results :results output :results graphics :file "f1.png" 
library(ggplot2)
### plot with position dodge
pd <- position_dodge(.1)
ggplot(df2[!is.na(df2$mean), ],
       aes(x=Day, y=mean, color=Tx)) +
    geom_errorbar(
        aes(ymin=mean-SE, ymax=mean+SE), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd, size=3) +
    ggtitle("Effect of BHB (10 mmol/lt) on growth of B16 cells") +
    ylab("No. cells / ml")
#+end_src
   
** Day 4: t-test

#+NAME: Day 4: t-test
#+begin_src R :session *session* :exports both :results output :results verbatim :results pp
with(df1[df1$Day==4, ], t.test(Count ~ Tx))
#+end_src

** Linear models: anova

#+NAME: Linear models: anova
#+begin_src R :session *session* :exports both :results output :results verbatim :results latex 
l1 <- lm(Count ~ Day, data=df1)
l2 <- lm(Count ~ Day + Tx, data=df1)
print(xtable(anova(l1, l2),
        caption="Analysis of variance on linear models",
             align=c("l", rep("c", 6)),
             display=c("d", "d", "fg", "d", rep("fg", 3)),
             label="tab:data"),
      booktabs=TRUE)
#+end_src
   
* Conclusions

The cells grown with BHB seem to show impaired growth over time visually, although we could not confirm this formally on statistic testing ($p \approx 0.07$).

* Appendix

** Help on anova

Below, we give a printout from the standard R help for ANOVA for linear models.

#+NAME: Help on anova
#+begin_src R :session *session* :exports both :results output :results verbatim :results pp
print(help(anova.lm))

#+end_src