Showing posts with label qPCR. Show all posts
Showing posts with label qPCR. Show all posts

Thursday, July 9, 2015

7 8 2015 CARM rep rerun 2

Today I ran another qPCR targeting the CARM gene.  This is to hopefully improve the replicates similarly to what I was doing with the CRAF gene yesterday. To better optimize this time I made a master mix for two plates worth of samples and created both plates back to back. This is the second of the two plates. You can read about the first plate here.  

Primers:


1642CARM1_FWDTGGTTATCAACAGCCCCGACJH5/21/20152055O.luridaHistone-arginine methyltransferase CARM1 (EC 2.1.1.-) (EC 2.1.1.125) (Coactivator-associated arginine methyltransferase 1) (Protein arginine N-methyltransferase 4)Q6DC04
1641CARM1_REVGTTGTTGACCCCAGGAGGAGJH5/21/20152055O.luridaHistone-arginine methyltransferase CARM1 (EC 2.1.1.-) (EC 2.1.1.125) (Coactivator-associated arginine methyltransferase 1) (Protein arginine N-methyltransferase 4)Q6DC04

Reagent Table:
VolumeReactions X116
Ssofast Evagreen MM101160
FWD Primer0.558
REV Primer0.558
1:9 cDNA9
  1. Added reagents from greatest to least volume
  2. Vortexed
  3. Centrifuged briefly
  4. Pipetted 11 ul Master Mix to each tube
  5. Pipetted 9 ul of 1:9 cDNA each column using a channel pipetter
  6. Centrifuged plate at 2000 rpm for 1 minute
  7. Ran Program Below
Program:
StepTemperatureTime
Initiation95 C10 min
Elongation95 C30 sec
60 C1 min
Read
72 C30 sec
Read
Repeat Elongation 39 times
Termination95 C1 min
55 C1 sec
Melt Curve Manual ramp 0.2C per sec Read 0.5 C55 - 95 C30 sec
21 C10 min
End
Plate Layout:
1234567
DNased 42215 HC1DNased 42215 NC1DNased 42215 SC1DNased 42215 HT1 1DNased 42215 NT1 1DNased 42215 ST1 1NTC
DNased 42215 HC2DNased 42215 NC2DNased 42215 SC2DNased 42215 HT1 2DNased 42215 NT1 2DNased 42215 ST1 2NTC
DNased 42215 HC3DNased 42215 NC3DNased 42215 SC3DNased 42215 HT1 3DNased 42215 NT1 3DNased 42215 ST1 3NTC
DNased 42215 HC4DNased 42215 NC4DNased 42215 SC4DNased 42215 HT1 4DNased 42215 NT1 4DNased 42215 ST1 4NTC
DNased 42215 HC5DNased 42215 NC5DNased 42215 SC5DNased 42215 HT1 5DNased 42215 NT1 5DNased 42215 ST1 5
DNased 42215 HC6DNased 42215 NC6DNased 42215 SC6DNased 42215 HT1 6DNased 42215 NT1 6DNased 42215 ST1 6
DNased 42215 HC7DNased 42215 NC7DNased 42215 SC7DNased 42215 HT1 7DNased 42215 NT1 7DNased 42215 ST1 7
DNased 42215 HC8DNased 42215 NC8DNased 42215 SC8DNased 42215 HT1 8DNased 42215 NT1 8DNased 42215 ST1 8
Results:

All samples

NTCs


There was amplification in all 4 NTCs just like there was in the previous plate. The products are larger than the target. I'm going to run these data through the script to see the differences between the reps. I'll post about that when its finished. 

You can see the raw data here.

Wednesday, July 8, 2015

7 8 2015 CARM rep rerun

Today I ran another qPCR targeting the CARM gene.  This is to hopefully improve the replicates similarly to what I was doing with the CRAF gene yesterday. To better optimize this time I made a master mix for two plates worth of samples and created both plates back to back. This is the first of the two plates. I'll post the data from the second plate tomorrow.  

Primers:


1642CARM1_FWDTGGTTATCAACAGCCCCGACJH5/21/20152055O.luridaHistone-arginine methyltransferase CARM1 (EC 2.1.1.-) (EC 2.1.1.125) (Coactivator-associated arginine methyltransferase 1) (Protein arginine N-methyltransferase 4)Q6DC04
1641CARM1_REVGTTGTTGACCCCAGGAGGAGJH5/21/20152055O.luridaHistone-arginine methyltransferase CARM1 (EC 2.1.1.-) (EC 2.1.1.125) (Coactivator-associated arginine methyltransferase 1) (Protein arginine N-methyltransferase 4)Q6DC04

Reagent Table:
VolumeReactions X116
Ssofast Evagreen MM101160
FWD Primer0.558
REV Primer0.558
1:9 cDNA9
  1. Added reagents from greatest to least volume
  2. Vortexed
  3. Centrifuged briefly
  4. Pipetted 11 ul Master Mix to each tube
  5. Pipetted 9 ul of 1:9 cDNA each column using a channel pipetter
  6. Centrifuged plate at 2000 rpm for 1 minute
  7. Ran Program Below
Program:
StepTemperatureTime
Initiation95 C10 min
Elongation95 C30 sec
60 C1 min
Read
72 C30 sec
Read
Repeat Elongation 39 times
Termination95 C1 min
55 C1 sec
Melt Curve Manual ramp 0.2C per sec Read 0.5 C55 - 95 C30 sec
21 C10 min
End
Plate Layout:
1234567
DNased 42215 HC1DNased 42215 NC1DNased 42215 SC1DNased 42215 HT1 1DNased 42215 NT1 1DNased 42215 ST1 1NTC
DNased 42215 HC2DNased 42215 NC2DNased 42215 SC2DNased 42215 HT1 2DNased 42215 NT1 2DNased 42215 ST1 2NTC
DNased 42215 HC3DNased 42215 NC3DNased 42215 SC3DNased 42215 HT1 3DNased 42215 NT1 3DNased 42215 ST1 3NTC
DNased 42215 HC4DNased 42215 NC4DNased 42215 SC4DNased 42215 HT1 4DNased 42215 NT1 4DNased 42215 ST1 4NTC
DNased 42215 HC5DNased 42215 NC5DNased 42215 SC5DNased 42215 HT1 5DNased 42215 NT1 5DNased 42215 ST1 5
DNased 42215 HC6DNased 42215 NC6DNased 42215 SC6DNased 42215 HT1 6DNased 42215 NT1 6DNased 42215 ST1 6
DNased 42215 HC7DNased 42215 NC7DNased 42215 SC7DNased 42215 HT1 7DNased 42215 NT1 7DNased 42215 ST1 7
DNased 42215 HC8DNased 42215 NC8DNased 42215 SC8DNased 42215 HT1 8DNased 42215 NT1 8DNased 42215 ST1 8
Results:

All samples

NTCs

All four of the NTCs amplified but the product was larger than the target. I'm not sure how this will effect data analysis since on of the samples amplified at the same cycle as the NTCs but with the appropriate size product. I'm running the second plate and will post about it when it finishes. 

You can see the raw data file here.

7 8 2015 CRAF rep comparison

Today I compared the replicates of CRAF which I posted about here and here. The main difference in this comparison to the Actin comparison is that both CRAF plates were made at the same time with the same mastermix while the Actin plates were prepared separately. I've run the raw fluorescence data through a script I wrote to produce a graph of showing the differences between replicate 1 and 2.

repcomparison.R
#Load in required packages for functions below
require(qpcR)
## Loading required package: qpcR
## Loading required package: MASS
## Loading required package: minpack.lm
## Loading required package: rgl
## Loading required package: robustbase
## Loading required package: Matrix
require(plyr)
## Loading required package: plyr
require(ggplot2)
## Loading required package: ggplot2
require(splitstackshape)
## Loading required package: splitstackshape
## Loading required package: data.table
#Read in raw fluorescence data from 1st Actin replicate
act3<-read.csv("CRAF4rawfluoro.csv", header = T)
#Remove blank first column entitled "X"
act3$X<-NULL
#Rename columns so that qpcR package and appropriately handle the data
act3<-rename(act3, c("Cycle" = "Cycles", "A1" = "H_C_1", "A2" = "N_C_1",
                       "A3"= "S_C_1", "A4"="H_T_1", "A5"="N_T_1","A6"="S_T_1",
                       "A7"="NT_C_1","B1" = "H_C_2", "B2" = "N_C_2","B3"= "S_C_2",
                       "B4"="H_T_2", "B5"="N_T_2", "B6"="S_T_2","B7"="NT_C_2",
                       "C1" = "H_C_3", "C2" = "N_C_3","C3"= "S_C_3","C4"="H_T_3",
                       "C5"="N_T_3", "C6"="S_T_3", "C7"="NT_C_3","D1" = "H_C_4",
                       "D2" = "N_C_4","D3"= "S_C_4", "D4"="H_T_4", "D5"="N_T_4",
                       "D6"="S_T_4", "D7"="NT_C_4","E1" = "H_C_5", "E2" = "N_C_5",
                       "E3"= "S_C_5", "E4"="H_T_5", "E5"="N_T_5", "E6"="S_T_5",
                       "F1" = "H_C_6", "F2" = "N_C_6","F3"= "S_C_6", "F4"="H_T_6",
                       "F5"="N_T_6", "F6"="S_T_6","G1" = "H_C_7", "G2" = "N_C_7",
                       "G3"= "S_C_7", "G4"="H_T_7", "G5"="N_T_7", "G6"="S_T_7",
                       "H1" = "H_C_8", "H2" = "N_C_8","H3"= "S_C_8", "H4"="H_T_8",
                       "H5"="N_T_8", "H6"="S_T_8"))

#Run data through pcrbatch in qpcR package which analyzes fluorescence and produces efficiency and cycle threshold values
act3ct<-pcrbatch(act3, fluo=NULL)
## Making model for H_C_1 (l4)
##  => Fitting passed...
## 
## Making model for N_C_1 (l4)
##  => Fitting passed...
## 
## Making model for S_C_1 (l4)
##  => Fitting passed...
## 
## Making model for H_T_1 (l4)
##  => Fitting passed...
## 
## Making model for N_T_1 (l4)
##  => Fitting passed...
## 
## Making model for S_T_1 (l4)
##  => Fitting passed...
## 
## Making model for NT_C_1 (l4)
##  => Fitting passed...
## 
## Making model for H_C_2 (l4)
##  => Fitting passed...
## 
## Making model for N_C_2 (l4)
##  => Fitting passed...
## 
## Making model for S_C_2 (l4)
##  => Fitting passed...
## 
## Making model for H_T_2 (l4)
##  => Fitting passed...
## 
## Making model for N_T_2 (l4)
##  => Fitting passed...
## 
## Making model for S_T_2 (l4)
##  => Fitting passed...
## 
## Making model for NT_C_2 (l4)
##  => Fitting passed...
## 
## Making model for H_C_3 (l4)
##  => Fitting passed...
## 
## Making model for N_C_3 (l4)
##  => Fitting passed...
## 
## Making model for S_C_3 (l4)
##  => Fitting passed...
## 
## Making model for H_T_3 (l4)
##  => Fitting passed...
## 
## Making model for N_T_3 (l4)
##  => Fitting passed...
## 
## Making model for S_T_3 (l4)
##  => Fitting passed...
## 
## Making model for NT_C_3 (l4)
##  => Fitting passed...
## 
## Making model for H_C_4 (l4)
##  => Fitting passed...
## 
## Making model for N_C_4 (l4)
##  => Fitting passed...
## 
## Making model for S_C_4 (l4)
##  => Fitting passed...
## 
## Making model for H_T_4 (l4)
##  => Fitting passed...
## 
## Making model for N_T_4 (l4)
##  => Fitting passed...
## 
## Making model for S_T_4 (l4)
##  => Fitting passed...
## 
## Making model for NT_C_4 (l4)
##  => Fitting passed...
## 
## Making model for H_C_5 (l4)
##  => Fitting passed...
## 
## Making model for N_C_5 (l4)
##  => Fitting passed...
## 
## Making model for S_C_5 (l4)
##  => Fitting passed...
## 
## Making model for H_T_5 (l4)
##  => Fitting passed...
## 
## Making model for N_T_5 (l4)
##  => Fitting passed...
## 
## Making model for S_T_5 (l4)
##  => Fitting passed...
## 
## Making model for H_C_6 (l4)
##  => Fitting passed...
## 
## Making model for N_C_6 (l4)
##  => Fitting passed...
## 
## Making model for S_C_6 (l4)
##  => Fitting passed...
## 
## Making model for H_T_6 (l4)
##  => Fitting passed...
## 
## Making model for N_T_6 (l4)
##  => Fitting passed...
## 
## Making model for S_T_6 (l4)
##  => Fitting passed...
## 
## Making model for H_C_7 (l4)
##  => Fitting passed...
## 
## Making model for N_C_7 (l4)
##  => Fitting passed...
## 
## Making model for S_C_7 (l4)
##  => Fitting passed...
## 
## Making model for H_T_7 (l4)
##  => Fitting passed...
## 
## Making model for N_T_7 (l4)
##  => Fitting passed...
## 
## Making model for S_T_7 (l4)
##  => Fitting passed...
## 
## Making model for H_C_8 (l4)
##  => Fitting passed...
## 
## Making model for N_C_8 (l4)
##  => Fitting passed...
## 
## Making model for S_C_8 (l4)
##  => Fitting passed...
## 
## Making model for H_T_8 (l4)
##  => Fitting passed...
## 
## Making model for N_T_8 (l4)
##  => Fitting passed...
## 
## Making model for S_T_8 (l4)
##  => Fitting passed...
## 
## Calculating delta of first/second derivative maxima...
## .........10.........20.........30.........40.........50
## ..
##  Found univariate outlier for NT_C_3 NT_C_4 
##  Tagging name of NT_C_3 NT_C_4 ...
## Analyzing H_C_1 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_C_1 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_C_1 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_T_1 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_T_1 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_T_1 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing NT_C_1 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_C_2 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_C_2 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_C_2 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_T_2 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_T_2 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_T_2 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing NT_C_2 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_C_3 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_C_3 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_C_3 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_T_3 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_T_3 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_T_3 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing **NT_C_3** ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_C_4 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_C_4 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_C_4 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_T_4 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_T_4 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_T_4 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing **NT_C_4** ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_C_5 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_C_5 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_C_5 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_T_5 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_T_5 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_T_5 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_C_6 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_C_6 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_C_6 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_T_6 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_T_6 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_T_6 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_C_7 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_C_7 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_C_7 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_T_7 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_T_7 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_T_7 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_C_8 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_C_8 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_C_8 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_T_8 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_T_8 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_T_8 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
#pcrbatch creates a file with each sample as an individual column in the dataframe. The problem with this is
#that I want to compare all the Ct (labelled sig.cpD2) and generate expression data for them but these values have to be
#in individual columns. To do this I must transpose the data and set the first row as the column names.
act3res<-setNames(data.frame(t(act3ct)),act3ct[,1])
#Now I must remove the first row as it is a duplicate and will cause errors with future analysis
act3res<-act3res[-1,]

#since the sample names are now in the first column the column title is row.names. This makes analys hard based on the ability to call the first column.
#to eliminate this issue, I copied the first column into a new column called "Names"
act3res$Names<-rownames(act3res)

#Since each sample name contains information such as Population, Treatment, and Sample Number I want to separate out these factors
#into new columns so that I can run future analysis based on population, treatment, or both. Also note the "drop = F" this is so the original names column remains.
act3res2<-cSplit_f(act3res, splitCols=c("Names"), sep="_", drop = F)

#After splitting the names column into three new columns I need to rename them appropriately. 
act3res2<-rename(act3res2, c("Names_1"="Pop", "Names_2"="Treat", "Names_3"="Sample"))

#I also create a column with the target gene name. This isn't used in this analysis but will be helpful for future work.
act3res2$Gene<-rep("CRAF", length(act3res2))

#In transposing the data frame, the column entries became factors which cannot be used for equations.
#to fix this, I set the entries for sig.eff (efficiency) and sig.cpD2 (Ct value) to numeric. Be aware, without the as.character function the factors will be transformed inappropriately.
act3res2$sig.eff<-as.numeric(as.character(act3res2$sig.eff))
act3res2$sig.cpD2<-as.numeric(as.character(act3res2$sig.cpD2))

#Now I plot the Ct values to see how they align without converting them to expression.
ggplot(act3res2, aes(x=Names,y=sig.cpD2, fill=Pop))+geom_bar(stat="identity")

#Now I want to get expression information from my data set. qpcR has a way of doing this but its complicated and I'm not comfortable using it.
#Luckily there is an equation I can use to do it. The equation is expression = 1/(1+efficiency)^Ctvalue. I tried multiple ways to get this to work in R
#but it doesn't handle the complicated equation easily.
#To work around this, I created a function in R to run the equation and produce an outcome. x = efficiency argument, y=Ctvalue argument
expr<-function(x,y){
  newVar<-(1+x)^y
  1/newVar
}

#Now I run the data through the function and produce a useful expression value
act3res2$expression<-expr(act3res2$sig.eff, act3res2$sig.cpD2)

#Graphing the expression values is a good way to examine the data quickly for errors that might have occurred. 
ggplot(act3res2, aes(x=Names,y=expression, fill=Pop))+geom_bar(stat="identity")

#Before I'm able to compare the replicates I need to process the raw fluorescence from the second Actin run.
#To do this I perform all the same steps as the previous replicate.
act4<-read.csv("CRAF5rawfluoro.csv", header = T)
act4$X<-NULL
act4<-rename(act4, c("Cycle" = "Cycles", "A1" = "H_C_1", "A2" = "N_C_1",
                     "A3"= "S_C_1", "A4"="H_T_1", "A5"="N_T_1","A6"="S_T_1",
                     "A7"="NT_C_1","B1" = "H_C_2", "B2" = "N_C_2","B3"= "S_C_2",
                     "B4"="H_T_2", "B5"="N_T_2", "B6"="S_T_2","B7"="NT_C_2",
                     "C1" = "H_C_3", "C2" = "N_C_3","C3"= "S_C_3","C4"="H_T_3",
                     "C5"="N_T_3", "C6"="S_T_3", "C7"="NT_C_3","D1" = "H_C_4",
                     "D2" = "N_C_4","D3"= "S_C_4", "D4"="H_T_4", "D5"="N_T_4",
                     "D6"="S_T_4", "D7"="NT_C_4","E1" = "H_C_5", "E2" = "N_C_5",
                     "E3"= "S_C_5", "E4"="H_T_5", "E5"="N_T_5", "E6"="S_T_5",
                     "F1" = "H_C_6", "F2" = "N_C_6","F3"= "S_C_6", "F4"="H_T_6",
                     "F5"="N_T_6", "F6"="S_T_6","G1" = "H_C_7", "G2" = "N_C_7",
                     "G3"= "S_C_7", "G4"="H_T_7", "G5"="N_T_7", "G6"="S_T_7",
                     "H1" = "H_C_8", "H2" = "N_C_8","H3"= "S_C_8", "H4"="H_T_8",
                     "H5"="N_T_8", "H6"="S_T_8"))

act4ct<-pcrbatch(act4, fluo=NULL)

## Making model for H_C_1 (l4)
##  => Fitting passed...
## 
## Making model for N_C_1 (l4)
##  => Fitting passed...
## 
## Making model for S_C_1 (l4)
##  => Fitting passed...
## 
## Making model for H_T_1 (l4)
##  => Fitting passed...
## 
## Making model for N_T_1 (l4)
##  => Fitting passed...
## 
## Making model for S_T_1 (l4)
##  => Fitting passed...
## 
## Making model for NT_C_1 (l4)
##  => Fitting passed...
## 
## Making model for H_C_2 (l4)
##  => Fitting passed...
## 
## Making model for N_C_2 (l4)
##  => Fitting passed...
## 
## Making model for S_C_2 (l4)
##  => Fitting passed...
## 
## Making model for H_T_2 (l4)
##  => Fitting passed...
## 
## Making model for N_T_2 (l4)
##  => Fitting passed...
## 
## Making model for S_T_2 (l4)
##  => Fitting passed...
## 
## Making model for NT_C_2 (l4)
##  => Fitting passed...
## 
## Making model for H_C_3 (l4)
##  => Fitting passed...
## 
## Making model for N_C_3 (l4)
##  => Fitting passed...
## 
## Making model for S_C_3 (l4)
##  => Fitting passed...
## 
## Making model for H_T_3 (l4)
##  => Fitting passed...
## 
## Making model for N_T_3 (l4)
##  => Fitting passed...
## 
## Making model for S_T_3 (l4)
##  => Fitting passed...
## 
## Making model for NT_C_3 (l4)
##  => Fitting passed...
## 
## Making model for H_C_4 (l4)
##  => Fitting passed...
## 
## Making model for N_C_4 (l4)
##  => Fitting passed...
## 
## Making model for S_C_4 (l4)
##  => Fitting passed...
## 
## Making model for H_T_4 (l4)
##  => Fitting passed...
## 
## Making model for N_T_4 (l4)
##  => Fitting passed...
## 
## Making model for S_T_4 (l4)
##  => Fitting passed...
## 
## Making model for NT_C_4 (l4)
##  => Fitting passed...
## 
## Making model for H_C_5 (l4)
##  => Fitting passed...
## 
## Making model for N_C_5 (l4)
##  => Fitting passed...
## 
## Making model for S_C_5 (l4)
##  => Fitting passed...
## 
## Making model for H_T_5 (l4)
##  => Fitting passed...
## 
## Making model for N_T_5 (l4)
##  => Fitting passed...
## 
## Making model for S_T_5 (l4)
##  => Fitting passed...
## 
## Making model for H_C_6 (l4)
##  => Fitting passed...
## 
## Making model for N_C_6 (l4)
##  => Fitting passed...
## 
## Making model for S_C_6 (l4)
##  => Fitting passed...
## 
## Making model for H_T_6 (l4)
##  => Fitting passed...
## 
## Making model for N_T_6 (l4)
##  => Fitting passed...
## 
## Making model for S_T_6 (l4)
##  => Fitting passed...
## 
## Making model for H_C_7 (l4)
##  => Fitting passed...
## 
## Making model for N_C_7 (l4)
##  => Fitting passed...
## 
## Making model for S_C_7 (l4)
##  => Fitting passed...
## 
## Making model for H_T_7 (l4)
##  => Fitting passed...
## 
## Making model for N_T_7 (l4)
##  => Fitting passed...
## 
## Making model for S_T_7 (l4)
##  => Fitting passed...
## 
## Making model for H_C_8 (l4)
##  => Fitting passed...
## 
## Making model for N_C_8 (l4)
##  => Fitting passed...
## 
## Making model for S_C_8 (l4)
##  => Fitting passed...
## 
## Making model for H_T_8 (l4)
##  => Fitting passed...
## 
## Making model for N_T_8 (l4)
##  => Fitting passed...
## 
## Making model for S_T_8 (l4)
##  => Fitting passed...
## 
## Calculating delta of first/second derivative maxima...
## .........10.........20.........30.........40.........50
## ..
##  Found univariate outlier for NT_C_1 NT_C_3 
##  Tagging name of NT_C_1 NT_C_3 ...
## Analyzing H_C_1 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_C_1 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_C_1 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_T_1 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_T_1 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_T_1 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing **NT_C_1** ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_C_2 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_C_2 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_C_2 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_T_2 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_T_2 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_T_2 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing NT_C_2 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_C_3 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_C_3 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_C_3 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_T_3 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_T_3 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_T_3 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing **NT_C_3** ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_C_4 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_C_4 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_C_4 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_T_4 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_T_4 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_T_4 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing NT_C_4 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_C_5 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_C_5 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_C_5 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_T_5 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_T_5 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_T_5 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_C_6 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_C_6 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_C_6 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_T_6 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_T_6 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_T_6 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_C_7 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_C_7 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_C_7 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_T_7 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_T_7 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_T_7 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_C_8 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_C_8 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_C_8 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing H_T_8 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing N_T_8 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
## 
## Analyzing S_T_8 ...
##   Calculating 'eff' and 'ct' from sigmoidal model...
##   Using window-of-linearity...
##   Fitting exponential model...
##   Using linear regression of efficiency (LRE)...
act4res<-setNames(data.frame(t(act4ct)),act4ct[,1])
act4res<-act4res[-1,]

act4res$Names<-rownames(act4res)

act4res2<-cSplit_f(act4res, splitCols=c("Names"), sep="_", drop = F)

act4res2<-rename(act4res2, c("Names_1"="Pop", "Names_2"="Treat", "Names_3"="Sample"))

act4res2$Gene<-rep("CRAF", length(act4res2))

act4res2$sig.eff<-as.numeric(as.character(act4res2$sig.eff))
act4res2$sig.cpD2<-as.numeric(as.character(act4res2$sig.cpD2))

ggplot(act4res2, aes(x=Names,y=sig.cpD2, fill=Pop))+geom_bar(stat="identity")

expr<-function(x,y){
  newVar<-(1+x)^y
  1/newVar
}

act4res2$expression<-expr(act4res2$sig.eff, act4res2$sig.cpD2)

ggplot(act4res2, aes(x=Names,y=expression, fill=Pop))+geom_bar(stat="identity")

#Now that I have Ct values, efficiencies and expression values for both replicates I can create a table of the differences between reps.
#To do this I create a data frame with a single formula that creates a column of values generated by subtracting the first run from the second.
repcomp<-as.data.frame(act3res2$sig.cpD2-act4res2$sig.cpD2)

#Now I need to add some Names for the samples to use with ggplot.Since the names column contains all the relevant information
#I copy only that column and run the split function on it again as well as the rename function. 
repcomp$Names<-act3res2$Names
repcomp<-cSplit_f(repcomp, splitCols=c("Names"), sep="_", drop = F)

#To better address the difference column in ggplot I need to rename it something simple and short. 
repcomp<-rename(repcomp, c("act3res2$sig.cpD2 - act4res2$sig.cpD2"="rep.diff", "Names_1"="Pop", "Names_2"="Treat", "Names_3"="Sample"))


repcomp<-repcomp[which(repcomp$Pop!=c("NT","**NT")),]
#Now I just run the data through ggplot to generate a bar graph exploring the differences between the two replicate in terms of Ct values.
ggplot(repcomp, aes(x=Names, y=rep.diff, fill=Pop))+geom_bar(stat="identity")


The results look good. The maximum difference between samples is less than 2 Ct which is more in line with what I want from replicates. This means producing both plates at the same time reduces human error on my part and creates much cleaner replicates. I'm going to rerun the CARM target today using this same method to verify that producing both plates at once is preferable.