library(agricolae)
## Registered S3 methods overwritten by 'tibble':
##   method     from  
##   format.tbl pillar
##   print.tbl  pillar
library(lattice)
library(Rmpfr)
## Loading required package: gmp
## 
## Attaching package: 'gmp'
## The following objects are masked from 'package:base':
## 
##     %*%, apply, crossprod, matrix, tcrossprod
## C code of R package 'Rmpfr': GMP using 64 bits per limb
## 
## Attaching package: 'Rmpfr'
## The following object is masked from 'package:gmp':
## 
##     outer
## The following objects are masked from 'package:stats':
## 
##     dbinom, dgamma, dnbinom, dnorm, dpois, pnorm
## The following objects are masked from 'package:base':
## 
##     cbind, pmax, pmin, rbind
library(HH)
## Loading required package: grid
## Loading required package: latticeExtra
## Loading required package: multcomp
## Loading required package: mvtnorm
## Loading required package: survival
## Loading required package: TH.data
## Loading required package: MASS
## 
## Attaching package: 'TH.data'
## The following object is masked from 'package:MASS':
## 
##     geyser
## Loading required package: gridExtra
library(lawstat)
library(readxl)
library(mvnormtest)
library(ggplot2)
## 
## Attaching package: 'ggplot2'
## The following object is masked from 'package:latticeExtra':
## 
##     layer
library(ggdendro)
library(ape)
## 
## Attaching package: 'ape'
## The following object is masked from 'package:agricolae':
## 
##     consensus
library(RColorBrewer)
library(gplots)
## 
## Attaching package: 'gplots'
## The following object is masked from 'package:HH':
## 
##     residplot
## The following object is masked from 'package:stats':
## 
##     lowess
library(graphics)
library(DescTools)
## Registered S3 method overwritten by 'DescTools':
##   method         from  
##   reorder.factor gplots
## 
## Attaching package: 'DescTools'
## The following object is masked from 'package:gplots':
## 
##     reorder.factor
## The following object is masked from 'package:HH':
## 
##     OddsRatio
library(pcr)
library(viridis)
## Loading required package: viridisLite
library(hrbrthemes)
## NOTE: Either Arial Narrow or Roboto Condensed fonts are required to use these themes.
##       Please use hrbrthemes::import_roboto_condensed() to install Roboto Condensed and
##       if Arial Narrow is not on your system, please see https://bit.ly/arialnarrow
library(readr)

#MPO

table1 <- read_delim("C:/Users/tsever/Documents/HL60qPCR/20210223_lgmn_mpo_epx_pd_kappa.txt", 
    "\t", escape_double = FALSE, trim_ws = TRUE)
## 
## -- Column specification --------------------------------------------------------
## cols(
##   Well = col_character(),
##   Group = col_character(),
##   WellName = col_character(),
##   Ct = col_logical(),
##   LGMN = col_double(),
##   MPO = col_double(),
##   EPX = col_double(),
##   GUSB = col_double(),
##   HPRT1 = col_double()
## )
#View(table1)
table2<- read_excel("C:/Users/tsever/Documents/HL60qPCR/20210223_lgmn_mpo_epx_pd_kappa.xlsx", 
     sheet = "Sheet2")
# default mode delta_delta_ct
## locate and read raw ct data
fl <- system.file('extdata', "C:/Users/tsever/Documents/HL60qPCR/20210223_lgmn_mpo_epx_pd_kappa.txt", package = 'pcr')
ct1 <- read.delim("C:/Users/tsever/Documents/HL60qPCR/20210223_lgmn_mpo_epx_pd_kappa.txt")


table2$LGMN_Ct <- as.numeric(table2$LGMN_Ct)
table2$MPO_Ct <- as.numeric(table2$MPO_Ct)
table2$EPX_Ct <- as.numeric(table2$EPX_Ct)
table2$HPRT1_Ct <- as.numeric(table2$HPRT1_Ct)
table2$GUSB_Ct <- as.numeric(table2$GUSB_Ct)

table2<-as.data.frame(table2)


## add grouping variable
group_var <- rep(c('wt','sc', 'lgmn'), each = 3)

# calculate all values and errors in one step
## mode == 'separate_tube' default
res <- pcr_analyze(table2,
                   group_var = group_var,
                   reference_gene = 'GUSB_Ct',
                   reference_group = 'sc')
## Warning in mean.default(X[[i]], ...): argument is not numeric or logical:
## returning NA

## Warning in mean.default(X[[i]], ...): argument is not numeric or logical:
## returning NA

## Warning in mean.default(X[[i]], ...): argument is not numeric or logical:
## returning NA
## Warning in var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm =
## na.rm): NAs introduced by coercion

## Warning in var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm =
## na.rm): NAs introduced by coercion

## Warning in var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm =
## na.rm): NAs introduced by coercion
## Warning in mean.default(X[[i]], ...): argument is not numeric or logical:
## returning NA

## Warning in mean.default(X[[i]], ...): argument is not numeric or logical:
## returning NA

## Warning in mean.default(X[[i]], ...): argument is not numeric or logical:
## returning NA

## Warning in mean.default(X[[i]], ...): argument is not numeric or logical:
## returning NA

## Warning in mean.default(X[[i]], ...): argument is not numeric or logical:
## returning NA

## Warning in mean.default(X[[i]], ...): argument is not numeric or logical:
## returning NA

## Warning in mean.default(X[[i]], ...): argument is not numeric or logical:
## returning NA

## Warning in mean.default(X[[i]], ...): argument is not numeric or logical:
## returning NA

## Warning in mean.default(X[[i]], ...): argument is not numeric or logical:
## returning NA

## Warning in mean.default(X[[i]], ...): argument is not numeric or logical:
## returning NA

## Warning in mean.default(X[[i]], ...): argument is not numeric or logical:
## returning NA

## Warning in mean.default(X[[i]], ...): argument is not numeric or logical:
## returning NA
res
##    group     gene normalized calibrated relative_expression      error lower
## 1   lgmn    Group         NA         NA                  NA         NA    NA
## 2     sc    Group         NA         NA                  NA         NA    NA
## 3     wt    Group         NA         NA                  NA         NA    NA
## 4   lgmn  LGMN_Ct         NA         NA                  NA 0.13316656    NA
## 5     sc  LGMN_Ct         NA         NA                  NA 0.05567764    NA
## 6     wt  LGMN_Ct         NA         NA                  NA 0.07637626    NA
## 7   lgmn   MPO_Ct         NA         NA                  NA 0.10519823    NA
## 8     sc   MPO_Ct         NA         NA                  NA 0.07831560    NA
## 9     wt   MPO_Ct         NA         NA                  NA 0.23395156    NA
## 10  lgmn   EPX_Ct         NA         NA                  NA 0.22509257    NA
## 11    sc   EPX_Ct         NA         NA                  NA 0.23480488    NA
## 12    wt   EPX_Ct         NA         NA                  NA 0.26166136    NA
## 13  lgmn HPRT1_Ct         NA         NA                  NA 0.13699148    NA
## 14    sc HPRT1_Ct         NA         NA                  NA 0.07302967    NA
## 15    wt HPRT1_Ct         NA         NA                  NA 0.10708252    NA
##    upper
## 1     NA
## 2     NA
## 3     NA
## 4     NA
## 5     NA
## 6     NA
## 7     NA
## 8     NA
## 9     NA
## 10    NA
## 11    NA
## 12    NA
## 13    NA
## 14    NA
## 15    NA
HL60 <- read_excel("C:/Users/tsever/Desktop/HL60qPCR.xlsx", 
    sheet = "Sheet2")
View(HL60)
HL60<- as.data.frame(HL60)
ggplot(HL60, aes(x=gene, y=Ct, fill=treatment))+
  geom_boxplot()+
  facet_wrap(~gene, scale="free")

ggplot(HL60, aes(x=gene, y=Ct, fill=treatment))+
  geom_boxplot()+
  facet_wrap(~treatment)

ggplot(HL60, aes(x=gene, y=Ct, fill=treatment))+
geom_violin() +
    scale_fill_viridis(discrete = TRUE, alpha=0.6, option="A") +
    theme_ipsum() +
    theme(
      legend.position="none",
      plot.title = element_text(size=11)
    ) +
    ggtitle("Violin chart") +
    xlab("")
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family not
## found in Windows font database

## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family not
## found in Windows font database

## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family not
## found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

aov1=aov(Ct~ gene + treatment  , HL60)
summary(aov1)
##             Df Sum Sq Mean Sq F value  Pr(>F)   
## gene         5 23.094   4.619   5.522 0.00108 **
## treatment    1  6.071   6.071   7.259 0.01161 * 
## Residuals   29 24.255   0.836                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
aov2=aov(Ct~ gene * treatment  , HL60)
summary(aov2)
##                Df Sum Sq Mean Sq F value   Pr(>F)    
## gene            5 23.094   4.619   41.77 4.49e-11 ***
## treatment       1  6.071   6.071   54.90 1.19e-07 ***
## gene:treatment  5 21.600   4.320   39.06 9.11e-11 ***
## Residuals      24  2.654   0.111                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
aov3=aov(Ct ~ gene, HL60)
summary(aov3)
##             Df Sum Sq Mean Sq F value  Pr(>F)   
## gene         5  23.09   4.619   4.569 0.00324 **
## Residuals   30  30.33   1.011                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(aov2)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = Ct ~ gene * treatment, data = HL60)
## 
## $gene
##                     diff        lwr          upr     p adj
## CHID1-CHI3L1 -0.95251249 -1.5461471 -0.358877895 0.0005867
## CHIT1-CHI3L1 -0.49514844 -1.0887830  0.098486156 0.1413859
## EPX-CHI3L1   -0.51806636 -1.1117010  0.075568233 0.1124468
## LGMN-CHI3L1   1.31607005  0.7224355  1.909704641 0.0000059
## MPO-CHI3L1   -1.09769542 -1.6913300 -0.504060832 0.0000910
## CHIT1-CHID1   0.45736405 -0.1362705  1.050998644 0.2020797
## EPX-CHID1     0.43444613 -0.1591885  1.028080721 0.2475435
## LGMN-CHID1    2.26858254  1.6749479  2.862217128 0.0000000
## MPO-CHID1    -0.14518294 -0.7388175  0.448451655 0.9722533
## EPX-CHIT1    -0.02291792 -0.6165525  0.570716669 0.9999961
## LGMN-CHIT1    1.81121848  1.2175839  2.404853077 0.0000000
## MPO-CHIT1    -0.60254699 -1.1961816 -0.008912396 0.0452246
## LGMN-EPX      1.83413641  1.2405018  2.427771000 0.0000000
## MPO-EPX      -0.57962907 -1.1732637  0.014005527 0.0584347
## MPO-LGMN     -2.41376547 -3.0074001 -1.820130881 0.0000000
## 
## $treatment
##                diff      lwr      upr p adj
## lgmn-ctrl 0.8213415 0.592562 1.050121 1e-07
## 
## $`gene:treatment`
##                                 diff        lwr         upr     p adj
## CHID1:ctrl-CHI3L1:ctrl   0.004870924 -0.9741353  0.98387717 1.0000000
## CHIT1:ctrl-CHI3L1:ctrl   0.044331801 -0.9346744  1.02333805 1.0000000
## EPX:ctrl-CHI3L1:ctrl     0.008401050 -0.9706052  0.98740730 1.0000000
## LGMN:ctrl-CHI3L1:ctrl    0.090025361 -0.8889809  1.06903161 0.9999999
## MPO:ctrl-CHI3L1:ctrl     0.003610631 -0.9753956  0.98261688 1.0000000
## CHI3L1:lgmn-CHI3L1:ctrl  1.454205599  0.4751993  2.43321185 0.0008322
## CHID1:lgmn-CHI3L1:ctrl  -0.455690301 -1.4346966  0.52331595 0.8611237
## CHIT1:lgmn-CHI3L1:ctrl   0.419576925 -0.5594293  1.39858318 0.9122415
## EPX:lgmn-CHI3L1:ctrl     0.409671831 -0.5693344  1.38867808 0.9238516
## LGMN:lgmn-CHI3L1:ctrl    3.996320334  3.0173141  4.97532658 0.0000000
## MPO:lgmn-CHI3L1:ctrl    -0.744795882 -1.7238021  0.23421037 0.2646556
## CHIT1:ctrl-CHID1:ctrl    0.039460877 -0.9395454  1.01846713 1.0000000
## EPX:ctrl-CHID1:ctrl      0.003530125 -0.9754761  0.98253638 1.0000000
## LGMN:ctrl-CHID1:ctrl     0.085154437 -0.8938518  1.06416069 1.0000000
## MPO:ctrl-CHID1:ctrl     -0.001260293 -0.9802665  0.97774596 1.0000000
## CHI3L1:lgmn-CHID1:ctrl   1.449334674  0.4703284  2.42834092 0.0008690
## CHID1:lgmn-CHID1:ctrl   -0.460561225 -1.4395675  0.51844503 0.8532015
## CHIT1:lgmn-CHID1:ctrl    0.414706001 -0.5643002  1.39371225 0.9180812
## EPX:lgmn-CHID1:ctrl      0.404800907 -0.5742053  1.38380716 0.9291797
## LGMN:lgmn-CHID1:ctrl     3.991449410  3.0124432  4.97045566 0.0000000
## MPO:lgmn-CHID1:ctrl     -0.749666806 -1.7286731  0.22933944 0.2569161
## EPX:ctrl-CHIT1:ctrl     -0.035930752 -1.0149370  0.94307550 1.0000000
## LGMN:ctrl-CHIT1:ctrl     0.045693560 -0.9333127  1.02469981 1.0000000
## MPO:ctrl-CHIT1:ctrl     -0.040721170 -1.0197274  0.93828508 1.0000000
## CHI3L1:lgmn-CHIT1:ctrl   1.409873797  0.4308675  2.38888005 0.0012343
## CHID1:lgmn-CHIT1:ctrl   -0.500022102 -1.4790284  0.47898415 0.7809682
## CHIT1:lgmn-CHIT1:ctrl    0.375245124 -0.6037611  1.35425137 0.9562775
## EPX:lgmn-CHIT1:ctrl      0.365340030 -0.6136662  1.34434628 0.9634487
## LGMN:lgmn-CHIT1:ctrl     3.951988533  2.9729823  4.93099478 0.0000000
## MPO:lgmn-CHIT1:ctrl     -0.789127683 -1.7681339  0.18987857 0.2001348
## LGMN:ctrl-EPX:ctrl       0.081624312 -0.8973819  1.06063056 1.0000000
## MPO:ctrl-EPX:ctrl       -0.004790418 -0.9837967  0.97421583 1.0000000
## CHI3L1:lgmn-EPX:ctrl     1.445804549  0.4667983  2.42481080 0.0008967
## CHID1:lgmn-EPX:ctrl     -0.464091350 -1.4430976  0.51491490 0.8473144
## CHIT1:lgmn-EPX:ctrl      0.411175876 -0.5678304  1.39018213 0.9221557
## EPX:lgmn-EPX:ctrl        0.401270782 -0.5777355  1.38027703 0.9328853
## LGMN:lgmn-EPX:ctrl       3.987919285  3.0089130  4.96692553 0.0000000
## MPO:lgmn-EPX:ctrl       -0.753196931 -1.7322032  0.22580932 0.2514078
## MPO:ctrl-LGMN:ctrl      -0.086414730 -1.0654210  0.89259152 1.0000000
## CHI3L1:lgmn-LGMN:ctrl    1.364180237  0.3851740  2.34318649 0.0018525
## CHID1:lgmn-LGMN:ctrl    -0.545715662 -1.5247219  0.43329059 0.6833308
## CHIT1:lgmn-LGMN:ctrl     0.329551564 -0.6494547  1.30855781 0.9824112
## EPX:lgmn-LGMN:ctrl       0.319646470 -0.6593598  1.29865272 0.9860019
## LGMN:lgmn-LGMN:ctrl      3.906294973  2.9272887  4.88530122 0.0000000
## MPO:lgmn-LGMN:ctrl      -0.834821243 -1.8138275  0.14418501 0.1470489
## CHI3L1:lgmn-MPO:ctrl     1.450594967  0.4715887  2.42960122 0.0008593
## CHID1:lgmn-MPO:ctrl     -0.459300932 -1.4383072  0.51970532 0.8552738
## CHIT1:lgmn-MPO:ctrl      0.415966294 -0.5630400  1.39497254 0.9165945
## EPX:lgmn-MPO:ctrl        0.406061200 -0.5729451  1.38506745 0.9278251
## LGMN:lgmn-MPO:ctrl       3.992709703  3.0137035  4.97171595 0.0000000
## MPO:lgmn-MPO:ctrl       -0.748406513 -1.7274128  0.23059974 0.2589031
## CHID1:lgmn-CHI3L1:lgmn  -1.909895899 -2.8889021 -0.93088965 0.0000156
## CHIT1:lgmn-CHI3L1:lgmn  -1.034628673 -2.0136349 -0.05562242 0.0319200
## EPX:lgmn-CHI3L1:lgmn    -1.044533768 -2.0235400 -0.06552752 0.0294254
## LGMN:lgmn-CHI3L1:lgmn    2.542114735  1.5631085  3.52112099 0.0000001
## MPO:lgmn-CHI3L1:lgmn    -2.199001480 -3.1780077 -1.21999523 0.0000014
## CHIT1:lgmn-CHID1:lgmn    0.875267226 -0.1037390  1.85427348 0.1102693
## EPX:lgmn-CHID1:lgmn      0.865362132 -0.1136441  1.84436838 0.1184651
## LGMN:lgmn-CHID1:lgmn     4.452010635  3.4730044  5.43101689 0.0000000
## MPO:lgmn-CHID1:lgmn     -0.289105581 -1.2681118  0.68990067 0.9936233
## EPX:lgmn-CHIT1:lgmn     -0.009905094 -0.9889113  0.96910116 1.0000000
## LGMN:lgmn-CHIT1:lgmn     3.576743409  2.5977372  4.55574966 0.0000000
## MPO:lgmn-CHIT1:lgmn     -1.164372807 -2.1433791 -0.18536656 0.0106995
## LGMN:lgmn-EPX:lgmn       3.586648503  2.6076423  4.56565475 0.0000000
## MPO:lgmn-EPX:lgmn       -1.154467713 -2.1334740 -0.17546146 0.0116510
## MPO:lgmn-LGMN:lgmn      -4.741116216 -5.7201225 -3.76210997 0.0000000
CHI3L1 <- read_excel("C:/Users/tsever/Desktop/HL60qPCR.xlsx", 
    sheet = "CHI3L1")


CHI3L1<-as.data.frame(CHI3L1)
mod<-aov( Ct ~ treatment, data = CHI3L1)
#comparison<-duncan.test(model,'`Well Name`')
duncan.test(mod,'treatment', alpha = 0.01, console=TRUE)
## 
## Study: mod ~ "treatment"
## 
## Duncan's new multiple range test
## for Ct 
## 
## Mean Square Error:  0.01037931 
## 
## treatment,  means
## 
##            Ct        std r       Min      Max
## ctrl 1.003680 0.10596674 3 0.9075192 1.117287
## lgmn 2.457885 0.09762001 3 2.3784142 2.566852
## 
## Alpha: 0.01 ; DF Error: 4 
## 
## Critical Range
##         2 
## 0.3829974 
## 
## Means with the same letter are not significantly different.
## 
##            Ct groups
## lgmn 2.457885      a
## ctrl 1.003680      b
t.test(CHI3L1[1:3,'Ct'],CHI3L1[4:6,'Ct'], conf.level = 0.99)
## 
##  Welch Two Sample t-test
## 
## data:  CHI3L1[1:3, "Ct"] and CHI3L1[4:6, "Ct"]
## t = 17.482, df = 3.9734, p-value = 6.593e-05
## alternative hypothesis: true difference in means is not equal to 0
## 99 percent confidence interval:
##  1.069462 1.838950
## sample estimates:
## mean of x mean of y 
##  2.457885  1.003680
ggplot(CHI3L1, aes(x=gene, y=Ct, fill=treatment))+
  geom_boxplot()+
  ggtitle('Relative expression of CHI3L1 in HL-60 cells')+
  theme_classic()+
  theme(plot.title = element_text(hjust = 0.5))+
  ylim(0,3)+
  annotate("text", x=1, y=2.9, label= "p=6.593e-05") 

CHIT1 <- read_excel("C:/Users/tsever/Desktop/HL60qPCR.xlsx", 
    sheet = "CHIT1")
mod<-aov( Ct ~ treatment, data = CHIT1)
#comparison<-duncan.test(model,'`Well Name`')
duncan.test(mod,'treatment', alpha = 0.01, console=TRUE)
## 
## Study: mod ~ "treatment"
## 
## Duncan's new multiple range test
## for Ct 
## 
## Mean Square Error:  0.4302495 
## 
## treatment,  means
## 
##            Ct       std r       Min      Max
## ctrl 1.048011 0.3569773 3 0.6358096 1.254112
## lgmn 1.423257 0.8561928 3 0.7103819 2.372925
## 
## Alpha: 0.01 ; DF Error: 4 
## 
## Critical Range
##        2 
## 2.465879 
## 
## Means with the same letter are not significantly different.
## 
##            Ct groups
## lgmn 1.423257      a
## ctrl 1.048011      a
t.test(CHIT1[1:3,'Ct'],CHI3L1[4:6,'Ct'], conf.level = 0.99)
## 
##  Welch Two Sample t-test
## 
## data:  CHIT1[1:3, "Ct"] and CHI3L1[4:6, "Ct"]
## t = 0.84236, df = 2.0613, p-value = 0.486
## alternative hypothesis: true difference in means is not equal to 0
## 99 percent confidence interval:
##  -4.283792  5.122946
## sample estimates:
## mean of x mean of y 
##  1.423257  1.003680
ggplot(CHIT1, aes(x=gene, y=Ct, fill=treatment))+
  geom_boxplot()+
  ggtitle('Relative expression of CHIT1 in HL-60 cells')+
  theme_classic()+
  theme(plot.title = element_text(hjust = 0.5))+
  ylim(0,3)+
  annotate("text", x=1, y=2.9, label= "p=0.486") 

CHID1 <- read_excel("C:/Users/tsever/Desktop/HL60qPCR.xlsx", 
    sheet = "CHID1")
mod<-aov( Ct ~ treatment, data = CHID1)
#comparison<-duncan.test(model,'`Well Name`')
duncan.test(mod,'treatment', alpha = 0.01, console=TRUE)
## 
## Study: mod ~ "treatment"
## 
## Duncan's new multiple range test
## for Ct 
## 
## Mean Square Error:  0.0137281 
## 
## treatment,  means
## 
##             Ct       std r       Min       Max
## ctrl 1.0085506 0.1615745 3 0.8565840 1.1782671
## lgmn 0.5479894 0.0367410 3 0.5058097 0.5730237
## 
## Alpha: 0.01 ; DF Error: 4 
## 
## Critical Range
##         2 
## 0.4404706 
## 
## Means with the same letter are not significantly different.
## 
##             Ct groups
## ctrl 1.0085506      a
## lgmn 0.5479894      b
t.test(CHID1[1:3,'Ct'],CHI3L1[4:6,'Ct'], conf.level = 0.99)
## 
##  Welch Two Sample t-test
## 
## data:  CHID1[1:3, "Ct"] and CHI3L1[4:6, "Ct"]
## t = -7.0374, df = 2.474, p-value = 0.01077
## alternative hypothesis: true difference in means is not equal to 0
## 99 percent confidence interval:
##  -0.92574619  0.01436559
## sample estimates:
## mean of x mean of y 
## 0.5479894 1.0036797
ggplot(CHID1, aes(x=gene, y=Ct, fill=treatment))+
  geom_boxplot()+
  ggtitle('Relative expression of CHID1 in HL-60 cells')+
  theme_classic()+
  theme(plot.title = element_text(hjust = 0.5))+
  ylim(0,2)+
  annotate("text", x=1, y=1.9, label= "p=0.01077") 

MPO <- read_excel("C:/Users/tsever/Desktop/HL60qPCR.xlsx", 
    sheet = "MPO")
mod<-aov( Ct ~ treatment, data = MPO)
#comparison<-duncan.test(model,'`Well Name`')
duncan.test(mod,'treatment', alpha = 0.01, console=TRUE)
## 
## Study: mod ~ "treatment"
## 
## Duncan's new multiple range test
## for Ct 
## 
## Mean Square Error:  0.01128495 
## 
## treatment,  means
## 
##             Ct         std r       Min       Max
## ctrl 1.0072903 0.150058907 3 0.8745827 1.1701283
## lgmn 0.2588838 0.007226972 3 0.2511579 0.2654785
## 
## Alpha: 0.01 ; DF Error: 4 
## 
## Critical Range
##         2 
## 0.3993572 
## 
## Means with the same letter are not significantly different.
## 
##             Ct groups
## ctrl 1.0072903      a
## lgmn 0.2588838      b
t.test(MPO[1:3,'Ct'],CHI3L1[4:6,'Ct'], conf.level = 0.99)
## 
##  Welch Two Sample t-test
## 
## data:  MPO[1:3, "Ct"] and CHI3L1[4:6, "Ct"]
## t = -12.146, df = 2.0186, p-value = 0.006484
## alternative hypothesis: true difference in means is not equal to 0
## 99 percent confidence interval:
##  -1.3440521 -0.1455396
## sample estimates:
## mean of x mean of y 
## 0.2588838 1.0036797
ggplot(MPO, aes(x=gene, y=Ct, fill=treatment))+
  geom_boxplot()+
  ggtitle('Relative expression of MPO in HL-60 cells')+
  theme_classic()+
  theme(plot.title = element_text(hjust = 0.5))+
  ylim(0,1.9)+
  annotate("text", x=1, y=1.8, label= "p=0.006484") 

EPX <- read_excel("C:/Users/tsever/Desktop/HL60qPCR.xlsx", 
    sheet = "EPX")
mod<-aov( Ct ~ treatment, data = EPX)
#comparison<-duncan.test(model,'`Well Name`')
duncan.test(mod,'treatment', alpha = 0.01, console=TRUE)
## 
## Study: mod ~ "treatment"
## 
## Duncan's new multiple range test
## for Ct 
## 
## Mean Square Error:  0.0247299 
## 
## treatment,  means
## 
##            Ct       std r      Min      Max
## ctrl 1.012081 0.1977442 3 0.882703 1.239708
## lgmn 1.413351 0.1017694 3 1.328686 1.526259
## 
## Alpha: 0.01 ; DF Error: 4 
## 
## Critical Range
##         2 
## 0.5911842 
## 
## Means with the same letter are not significantly different.
## 
##            Ct groups
## lgmn 1.413351      a
## ctrl 1.012081      a
t.test(EPX[1:3,'Ct'],CHI3L1[4:6,'Ct'], conf.level = 0.99)
## 
##  Welch Two Sample t-test
## 
## data:  EPX[1:3, "Ct"] and CHI3L1[4:6, "Ct"]
## t = 4.8296, df = 3.9935, p-value = 0.008498
## alternative hypothesis: true difference in means is not equal to 0
## 99 percent confidence interval:
##  0.01869286 0.80065080
## sample estimates:
## mean of x mean of y 
##  1.413351  1.003680
ggplot(EPX, aes(x=gene, y=Ct, fill=treatment))+
  geom_boxplot()+
  ggtitle('Relative expression of EPX in HL-60 cells')+
  theme_classic()+
  theme(plot.title = element_text(hjust = 0.5))+
  ylim(0,1.9)+
  annotate("text", x=1, y=1.8, label= "p=0.008498") 

LGMN <- read_excel("C:/Users/tsever/Desktop/HL60qPCR.xlsx", 
    sheet = 'LGMN')
mod<-aov( Ct ~ treatment, data = LGMN)
#comparison<-duncan.test(model,'`Well Name`')
duncan.test(mod,'treatment', alpha = 0.01, console=TRUE)
## 
## Study: mod ~ "treatment"
## 
## Duncan's new multiple range test
## for Ct 
## 
## Mean Square Error:  0.1731441 
## 
## treatment,  means
## 
##            Ct       std r       Min      Max
## ctrl 1.093705 0.5884626 3 0.6689638 1.765406
## lgmn 5.000000 0.0000000 3 5.0000000 5.000000
## 
## Alpha: 0.01 ; DF Error: 4 
## 
## Critical Range
##        2 
## 1.564284 
## 
## Means with the same letter are not significantly different.
## 
##            Ct groups
## lgmn 5.000000      a
## ctrl 1.093705      b
t.test(LGMN[1:3,'Ct'],CHI3L1[4:6,'Ct'], conf.level = 0.99)
## 
##  Welch Two Sample t-test
## 
## data:  LGMN[1:3, "Ct"] and CHI3L1[4:6, "Ct"]
## t = 65.321, df = 2, p-value = 0.0002343
## alternative hypothesis: true difference in means is not equal to 0
## 99 percent confidence interval:
##  3.389119 4.603521
## sample estimates:
## mean of x mean of y 
##   5.00000   1.00368
ggplot(LGMN, aes(x=gene, y=Ct, fill=treatment))+
  geom_boxplot()+
  ggtitle('Relative expression of LGMN in HL-60 cells')+
  theme_classic()+
  theme(plot.title = element_text(hjust = 0.5))+
  ylim(0,1.9)+
  annotate("text", x=1, y=1.8, label= "p=0.00000000") 
## Warning: Removed 3 rows containing non-finite values (stat_boxplot).