## ----style, echo=FALSE, results="asis", message=FALSE-------------------------
knitr::opts_chunk$set(tidy = FALSE,
                      warning = FALSE,
                      message = FALSE)

## ----install, eval=FALSE, warning=FALSE---------------------------------------
#  if (!require("BiocManager")) {
#      install.packages("BiocManager")
#  }
#  BiocManager::install("RNASeqRData")

## ----fig.width=10,  echo=FALSE------------------------------------------------
library(png)
library(grid)
img <- readPNG("figure/whole_file_structure.png")
grid.raster(img, just = "center")

## ----fig.width=10, echo=FALSE-------------------------------------------------
img <- readPNG("figure/input_files_structure.png")
grid.raster(img, just = "center")

## ----fig.width=10, echo=FALSE-------------------------------------------------
img <- readPNG("figure/phenodata_csv.png")
grid.raster(img, just = "center")

## ---- warning=FALSE-----------------------------------------------------------
library(RNASeqR)
library(RNASeqRData)

## -----------------------------------------------------------------------------
input_files.path <- system.file("extdata/", package = "RNASeqRData")
#rnaseq_result.path <- "/Users/chaokuan-hao/Documents/ANU_2019_Semester_2/Lanfear_Lab/HI"
rnaseq_result.path <- "/tmp/RNASeqR/"
dir.create(rnaseq_result.path, recursive = TRUE)
list.files(input_files.path, recursive = TRUE)

## ---- warning=FALSE-----------------------------------------------------------
exp <- RNASeqRParam(path.prefix = rnaseq_result.path, 
                    input.path.prefix = input_files.path, 
                    genome.name = "Saccharomyces_cerevisiae_XV_Ensembl", 
                    sample.pattern = "SRR[0-9]*_XV",
                    independent.variable = "state", 
                    case.group = "60mins_ID20_amphotericin_B", 
                    control.group = "60mins_ID20_control",
                    fastq.gz.type = "PE")

## ---- warning=FALSE, eval=FALSE-----------------------------------------------
#  exp <- RNASeqRParam(path.prefix = rnaseq_result.path,
#                      input.path.prefix = input_files.path,
#                      genome.name = "Saccharomyces_cerevisiae_XV_Ensembl",
#                      sample.pattern = "SRR[0-9]*_XV",
#                      independent.variable = "state",
#                      case.group = "60mins_ID20_amphotericin_B",
#                      control.group = "60mins_ID20_control",
#                      fastq.gz.type = "SE")

## ---- warning=FALSE-----------------------------------------------------------
show(exp)

## ---- eval=FALSE--------------------------------------------------------------
#  RNASeqEnvironmentSet_CMD(exp)

## ---- warning=FALSE-----------------------------------------------------------
RNASeqEnvironmentSet(exp)

## ----fig.width=20, echo=FALSE-------------------------------------------------
img <- readPNG("figure/fastqReport.png")
grid.raster(img, just = "center")

## ---- eval=FALSE--------------------------------------------------------------
#  RNASeqQualityAssessment_CMD(exp)

## ---- warning=FALSE-----------------------------------------------------------
RNASeqQualityAssessment(exp)

## ---- warning=FALSE, eval=FALSE-----------------------------------------------
#  Update_Fastq_gz (RNASeqRParam       = exp,
#                   prepared_fastq_gz  = paste0(input_files.path,
#                                               "/input_files/raw_fastq.gz/"),
#                   target_samples     = "ALL")

## ----fig.width=6,fig.height=6, echo=FALSE-------------------------------------
img <- readPNG("figure/Alignment_Report/Alignment_Result_ggplot2.png")
grid.raster(img, just = "center")

## ----fig.width=6,fig.height=6, echo=FALSE-------------------------------------
img <- readPNG("figure/Alignment_Report/Overall_Mapping_rate_ggplot2.png")
grid.raster(img, just = "center")

## ---- eval=FALSE--------------------------------------------------------------
#  RNASeqReadProcess_CMD(exp)

## ---- eval=FALSE--------------------------------------------------------------
#  RNASeqReadProcess_CMD(exp, STAR.Alignment.run=TRUE,
#                        Hisat2.Index.run=FALSE,
#                        Hisat2.Alignment.run = FALSE)

## ---- warning=FALSE, eval=FALSE-----------------------------------------------
#  RNASeqReadProcess(exp)

## ---- eval=FALSE--------------------------------------------------------------
#  RNASeqReadProcess(exp, STAR.Alignment.run=TRUE,
#                    Hisat2.Index.run=FALSE,
#                    Hisat2.Alignment.run = FALSE)

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/DE/Statistical_Results.png")
 grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/preDE/Frequency/Frequency_Plot_normalized_count_ggplot2.png")
 grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/preDE/Frequency/Frequency_Plot_log_normalized_count_ggplot2.png")
 grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/preDE/Distribution/Box_Plot_ggplot2.png")
 grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/preDE/Distribution/Violin_Plot_ggplot2.png")
 grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/preDE/PCA/Dimension_PCA_Plot_factoextra.png")
 grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/preDE/PCA/PCA_Plot_factoextra.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/preDE/PCA/PCA_Plot_ggplot2.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/preDE/Correlation/Correlation_Heat_Plot_ggplot2.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/preDE/Correlation/Correlation_Dot_Plot_corrplot.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/preDE/Correlation/Correlation_Bar_Plot_PerformanceAnalytics.png")
grid.raster(img, just = "center")

## ----fig.width=8, fig.height=8, echo=FALSE------------------------------------
img <- readPNG("figure/DE/Volcano_Plot_graphics.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/DE/PCA/Dimension_PCA_Plot_factoextra.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/DE/PCA/PCA_Plot_factoextra.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/DE/PCA/PCA_Plot_ggplot2.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/DE/Heatmap_Plot_pheatmap.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/transcript_related/Distribution_Transcript_Count_per_Gene_Plot.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/transcript_related/Distribution_Transcript_Length_Plot.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/ballgown_MA_Plot_ggplot2.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/preDE/Dispersion_Plot_DESeq2.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/DE/MA_Plot_DESeq2.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/edgeR_MeanVar_Plot_edgeR.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/edgeR_BCV_Plot_edgeR.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/edgeR_MDS_Plot_edgeR.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/edgeR_Smear_Plot_edgeR.png")
grid.raster(img, just = "center")

## ---- eval=FALSE--------------------------------------------------------------
#  RNASeqDifferentialAnalysis_CMD(exp)

## ---- warning=FALSE, eval=FALSE-----------------------------------------------
#  RNASeqDifferentialAnalysis(exp)

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/GO_analysis/GO_CC_Classification_Bar_Plot_clusterProfiler.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/GO_analysis/GO_MF_Overrepresentation_Bar_Plot_clusterProfiler.png")
grid.raster(img, just = "center")

## ----fig.width=6, height=6, echo=FALSE----------------------------------------
img <- readPNG("figure/GO_analysis/GO_MF_Overrepresentation_Dot_Plot_clusterProfiler.png")
grid.raster(img, just = "center")

## ---- eval = FALSE------------------------------------------------------------
#  RNASeqGoKegg_CMD(exp,
#                   OrgDb.species = "org.Sc.sgd.db",
#                   go.level = 3,
#                   input.TYPE.ID = "GENENAME",
#                   KEGG.organism = "sce")

## ---- warning=FALSE, eval=FALSE-----------------------------------------------
#  RNASeqGoKegg(exp,
#               OrgDb.species = "org.Sc.sgd.db",
#               go.level = 3,
#               input.TYPE.ID = "GENENAME",
#               KEGG.organism = "sce")

## ---- warning=FALSE, eval=FALSE-----------------------------------------------
#  exp_Sam <- RNASeqRParam_Sam(path.prefix = rnaseq_result.path,
#                              input.path.prefix = input_files.path,
#                              genome.name = "Saccharomyces_cerevisiae_XV_Ensembl",
#                              sample.pattern = "SRR[0-9]*_XV",
#                              independent.variable = "state",
#                              case.group = "60mins_ID20_amphotericin_B",
#                              control.group = "60mins_ID20_control")

## ---- warning=FALSE, eval=FALSE-----------------------------------------------
#  exp_Bam <- RNASeqRParam_Bam(path.prefix = rnaseq_result.path,
#                              input.path.prefix = input_files.path,
#                              genome.name = "Saccharomyces_cerevisiae_XV_Ensembl",
#                              sample.pattern = "SRR[0-9]*_XV",
#                              independent.variable = "state",
#                              case.group = "60mins_ID20_amphotericin_B",
#                              control.group = "60mins_ID20_control")

## ---- warning=FALSE, eval=FALSE-----------------------------------------------
#  exp <- RNASeqRParam(path.prefix          = rnaseq_result.path,
#                      input.path.prefix    = input_files.path,
#                      genome.name          = "Saccharomyces_cerevisiae_XV_Ensembl",
#                      sample.pattern       = "SRR[0-9]*_XV",
#                      independent.variable = "state",
#                      case.group           = "60mins_ID20_amphotericin_B",
#                      control.group        = "60mins_ID20_control",
#                      fastq.gz.type        = "PE")

## ---- warning=FALSE, eval=FALSE-----------------------------------------------
#  RNASeqEnvironmentSet(exp)

## ---- warning=FALSE, eval=FALSE-----------------------------------------------
#  All_Steps_Interface_CMD(exp,
#                          OrgDb.species = "org.Sc.sgd.db",
#                          go.level      = 3,
#                          input.TYPE.ID = "GENENAME",
#                          KEGG.organism = "sce")

## ---- warning=FALSE, eval=FALSE-----------------------------------------------
#  All_Steps_Interface(exp,
#                      OrgDb.species = "org.Sc.sgd.db",
#                      go.level      = 3,
#                      input.TYPE.ID = "GENENAME",
#                      KEGG.organism = "sce")

## -----------------------------------------------------------------------------
sessionInfo()

