## ----eval = FALSE, echo = TRUE, message = FALSE-------------------------------
#    library(ORFik)                        # This package
#    # Output folders:
#    # 1. where do you want the annotation ?
#    annotation.dir <- "~/Bio_data/annotations/Yeast_SacCer3/"
#    # 2. where do you want the fastq files ?
#    fastq.dir <-  "~/Bio_data/raw_data/RNA-seq/Yeast_SRP012047/"
#    # 3. where do you want the aligned bam files ?
#    bam.dir <- "~/Bio_data/processed_data/RNA-seq/Yeast_SRR453566/"
#  

## ----eval = FALSE, echo = TRUE, message = FALSE-------------------------------
#  
#  info <- download.SRA.metadata("SRP012047", fastq.dir)
#  # Let's take 2 first runs in this experiment:
#  info <- info[1:2,]
#  
#  download.SRA(info, fastq.dir, subset = 50000)

## ----eval = FALSE, echo = TRUE, message = FALSE-------------------------------
#  organism <- info$ScientificName[1]
#  is_paired_end <- all(info$LibraryLayout == "PAIRED")

## ----eval = FALSE, echo = TRUE, message = FALSE-------------------------------
#    annotation <- getGenomeAndAnnotation(
#                        organism = organism,
#                        output.dir = annotation.dir,
#                        assembly_type = "toplevel"
#                        )

## ----eval = FALSE, echo = TRUE, message = FALSE-------------------------------
#  index <- STAR.index(annotation)

## ----eval = FALSE, echo = TRUE, message = FALSE-------------------------------
#  alignment <-
#    STAR.align.folder(fastq.dir, bam.dir, index,
#                      paired.end = is_paired_end,
#                      steps = "tr-ge", # (trim needed: adapters found, then genome)
#                      adapter.sequence = "auto",
#                      max.cpus = 30, trim.front = 3, min.length = 20)

## ----eval = FALSE, echo = TRUE, message = FALSE-------------------------------
#  txdb_file <- paste0(annotation["gtf"], ".db") # Get txdb file, not raw gtf
#  fa <- annotation["genome"]
#  create.experiment(exper = "yeast_exp_RNA",
#                    dir = paste0(bam.dir, "/aligned/"),
#                    txdb = txdb_file, fa = fa,
#                    organism = organism,
#                    viewTemplate = FALSE,
#                    pairedEndBam = is_paired_end # True/False per bam file
#                    )

## ----eval = FALSE, echo = TRUE, message = FALSE-------------------------------
#  df <- read.experiment("yeast_exp_RNA")

## ----eval = FALSE, echo = TRUE, message = FALSE-------------------------------
#    remove.experiments(df)
#    convertLibs(df, type = "ofst")

## ----eval = FALSE, echo = TRUE, message = FALSE-------------------------------
#    remove.experiments(df)
#    convertLibs(df, type = "wig")

## ----eval = FALSE, echo = TRUE, message = FALSE-------------------------------
#  remove.experiments(df)
#  outputLibs(df, type = "ofst")

## ----eval = FALSE, echo = TRUE, message = FALSE-------------------------------
#    remove.experiments(df)
#    outputLibs(df, type = "wig")

## ----eval = FALSE, echo = TRUE, message = FALSE-------------------------------
#    QCreport(df)

## ----eval = FALSE, echo = TRUE, message = FALSE-------------------------------
#    mrna <- countTable(df, region = "mrna", type = "fpkm")
#    cds <- countTable(df, region = "cds", type = "fpkm")
#    ratio <- cds / mrna

