twoFACTORplot {rtpcr}R Documentation

Bar plot of the relative gene expression (\Delta C_T method) from the qpcrANOVARE output of a two-factorial experiment data

Description

Bar plot of the relative expression (\Delta C_T method) of a gene along with the standard error (se), 95% confidence interval (ci) and significance

Usage

twoFACTORplot(
  res,
  x.axis.factor,
  group.factor,
  width = 0.5,
  fill = "Blues",
  y.axis.adjust = 0.5,
  y.axis.by = 2,
  show.errorbars = TRUE,
  errorbar = "se",
  show.letters = TRUE,
  letter.position.adjust = 0.1,
  ylab = "Relative Expression",
  xlab = "none",
  legend.position = c(0.09, 0.8),
  fontsize = 12,
  fontsizePvalue = 5,
  axis.text.x.angle = 0,
  axis.text.x.hjust = 0.5
)

Arguments

res

the FC data frame created by qpcrANOVARE(x)$Result function on a two factor data such as data_2factor.

x.axis.factor

x-axis factor.

group.factor

grouping factor.

width

a positive number determining bar width.

fill

specify the fill color vector for the columns of the bar plot. One of the palettes in display.brewer.all (e.g. "Reds" or "Blues", ...) can be applied.

y.axis.adjust

a negative or positive number for reducing or increasing the length of the y axis.

y.axis.by

determines y axis step length.

show.errorbars

show errorbars

errorbar

Type of error bar, can be se or ci.

show.letters

a logical variable. If TRUE, mean grouping letters are added to the bars.

letter.position.adjust

adjust the distance between the grouping letters to the error bars.

ylab

the title of the y axis.

xlab

the title of the x axis.

legend.position

a two digit vector specifying the legend position.

fontsize

size of all fonts of the plot.

fontsizePvalue

font size of the pvalue labels

axis.text.x.angle

angle of x axis text

axis.text.x.hjust

horizontal justification of x axis text

Details

The twoFACTORplot function generates the bar plot of the average fold change for target genes along with the significance, standard error (se) and the 95% confidence interval (ci) as error bars.

Value

Bar plot of the average fold change for target genes along with the significance and the 95% confidence interval as error bars.

Author(s)

Ghader Mirzaghaderi

Examples


# See a sample data frame
data_2factor

# Before generating plot, the result table needs to be extracted as below:
res <- qpcrANOVARE(data_2factor, numberOfrefGenes = 1)$Result

# Plot of the 'res' data with 'Genotype' as grouping factor
twoFACTORplot(res,
   x.axis.factor = Drought,
   group.factor = Genotype,
   width = 0.5,
   fill = "Greens",
   y.axis.adjust = 1,
   y.axis.by = 2,
   ylab = "Relative Expression",
   xlab = "Drought Levels",
   letter.position.adjust = 0.2,
   legend.position = c(0.2, 0.8),
   errorbar = "se")
   

# Plotting the same data with 'Drought' as grouping factor
twoFACTORplot(res,
              x.axis.factor = Genotype,
              group.factor = Drought,
              xlab = "Genotype",
              fill = "Blues",
              fontsizePvalue = 5,
              errorbar = "ci")
              
              
              
# Combining FC results of two different genes:
a <- qpcrREPEATED(data_repeated_measure_1,
                  numberOfrefGenes = 1,
                  factor = "time")

b <- qpcrREPEATED(data_repeated_measure_2,
                  factor = "time",
                  numberOfrefGenes = 1)

a1 <- a$FC_statistics_of_the_main_factor
b1 <- b$FC_statistics_of_the_main_factor
c <- rbind(a1, b1)
c$gene <- factor(c(1,1,1,2,2,2))
c

twoFACTORplot(c, x.axis.factor = contrast, 
              group.factor = gene, fill = 'Reds',
              ylab = "FC", axis.text.x.angle = 45,
              axis.text.x.hjust = 1)



[Package rtpcr version 1.0.8 Index]