RNA-Seq is a revolutionary approach for discovering and investigating the transcriptome using next-generation sequencing technologies (Wang et al. 2009). Typically, this transcriptome analysis aims to identify genes differentially expressed across different conditions, treatments or tissues, resulting in an understanding of the important pathways that are associated with the conditions (Wang et al. 2009). Following are the overview steps of RNA-Seq technique.
RNASeqR is an user-friendly R-based tool for running a six-step automation RNA-Seq analysis pipeline including quality assessment, read alignment and transcript quantification, differential expression analysis, and functional analysis. The main features of this package are an automated workflow and comprehensive reports with data visualization. In this package, the new tuxedo pipeline published in Nature Protocols in 2016 can be fully implemented in the R environment, including extra functions such as reads quality assessment and functional analysis. RNASeqR is beneficial for clinical researchers without significant computational background. There are only six lines of code that users need to execute in order to finish an end-to-end RNA-Seq analysis.
The central concept behind this package is that each step involved in RNA-Seq data analysis is a function call in R. For the subsequent parts of this documentation, inputs, outputs as well as detail implementation for these six steps will be elaborated upon in order. Following are the six steps and the each corresponding function that users need to execute.
RNASeqRParamS4 Object Creation
RNASeqRParamS4 object by running the
RNASeqRParam()constructor function for all variables being checked. This object will be used as input for the following steps.
Functions with the
CMD suffix create an R script and run
nohup R CMD BATCH script.R in the background. Functions with no
CMD suffix process in the R shell. After running the above functions, the whole RNA-Seq analysis is done and the files generated in each step are stored in an organized file directory. The
RNASeqR package makes two-group comparative RNA-Seq analysis more efficient and easier for users.
The following are the main tools that are used in this package: ‘HISAT2’ (Kim et al. 2015) and ‘STAR’ (Dobin et al. 2013) for read alignment; ‘StringTie’ (Pertea et al. 2015) for alignment assembly and transcripts quantification; ‘Rsamtools’ (Morgan et al. 2018) for converting
SAM files to
BAM files; ‘Gffcompare’ for comparing merged
GTF files with reference
GTF files; ‘systemPipeR’ (Backman et al. 2016) for quality assessment; ‘ballgown’ (Fu et al. 2018), ‘DESeq2’ (Love et al. 2014) and ‘edgeR’ (Robinson et al. 2010;McCarthy et al. 2012) for finding potential differentially expressed genes; and ‘clusterProfiler’ (Yu et al. 2012) for Gene Ontology(GO) functional analysis and Kyoto Encyclopedia of Genes and Genomes(KEGG) pathway analysis.
Sample data used in this vignette can be downloaded from the
RNASeqRData experiment package. It originated from NCBI’s Sequence Read Archive for the entries SRR3396381, SRR3396382, SRR3396384, SRR3396385, SRR3396386, and SRR3396387. These samples are from Saccharomyces cerevisiae. Suitable reference genome and gene annotation files for this species can be further downloaded from iGenomes, Ensembl, R64-1-1. To create a mini dataset for demonstration purposes, reads aligned to the region from 0 to 100000 on chromosome XV were extracted. The analysis of this mini dataset will be shown in this vignette. The experimental data package is located here.
For more real case-control data and RNA-Seq analysis results from this package, please go to this website: https://github.com/HowardChao/RNASeqR_analysis_result.
R version >= 3.5.0
Operating System: Linux and macOS are supported in the
RNASeqR package. Windows is not supported. (because StringTie and HISAT2 are not available for Windows).
Third-party software used in this package includes HISAT2, StringTie and Gffcompare. The availability of these commands will be checked by
system2() through the R shell at the end of the ‘Environment Setup’ step. The environment must successfully built before running the following RNA-Seq analysis. By default, binaries will be installed based on the operating system of the workstation; therefore there is no additional compiling required. Alternatively, users can still decide to skip certain software binary installation. For more details, please refer to the ‘Environment Setup’ chapter.
Python: Python2 or Python3.
2to3: If the Python version on the workstation is 3, this command will be used. Generally,
2to3is available if Python3 is available.
If one of these conditions is met, the raw read count will be created and DESeq2 and edgeR will be run automatically in the ‘Gene-level Differential Analyses’ step. If not, DESeq2 and edgeR will be skipped during ‘Gene-level Differential Analysis’ step. Checking the Python version and
2to3 command on the workstation beforehand is highly recommended but not necessary.
HISAT2 indexex: Users are advised to provide an ‘indices/’ directory in ‘inputfiles/’. HISAT2 requires at least 160 GB of RAM and several hours to index the entire human genome.
This is the first step of the RNA-Seq analysis workﬂow in this package. Prior to conducting RNA-Seq analysis, it is necessary to implement a constructor function, called
RNASeqRParam() and to create a
RNASeqRParam S4 object which stores parameters not only for pre-checking but also for utilizing as input the parameters in the subsequent steps.
There are 11 slots in
os.type : The operating system type. Value is
osx. This package only supports ‘Linux’ and ‘macOS’ (not ‘Windows’). If another operating system is detected, ERROR will be reported.
python.variable : A Python-related variable. The value is a list of whether Python is available and the Python version (
python.2to3 : Availability of the
2to3 command. THe value is
path.prefix : Path prefix of the ‘gene_data/’, ‘RNASeq_bin/’, ‘RNASeq_results/’, ‘Rscript/’ and ‘Rscript_out/’ directories. It is recommended that you create a new, empty directory in which all the subsequent RNA-Seq results can be saved.
input.path.prefix: Path prefix of the ‘input_files/’ directory. Users should prepare an ‘input_file/’ directory with the following rules:
genome.name.fa: Reference genome in FASTA file formation.
genome.name.gtf: Gene annotation in GTF file formation.
raw_fastq.gz/: Directory storing
Supports both paired-end and single-end reads files.
FASTQ files : ’
sample.pattern_1.fastq.gz’ and ’
sample.pattern must be distinct for each sample.
phenodata.csv: Information about the RNA-Seq experiment design.
First column : Distinct ids for each sample. The value of each sample of this column must match
FASTQ files in ‘raw_fastq.gz/’. The column name must be ids.
control.group. The column name is the parameter
independent.variablewhich can be any string defined by users.
Third column : The color coding for
control.group. Samples in the same group must have same color coding and their values are HEX color code. The column name must be color.
indices/ : The directory storing
HT2 index files for the HISAT2 alignment tool.
This directory is optional.
HT2 index files corresponding to the reference genome can be installed at HISAT2 official website. Providing
HT2 files can accelerate the subsequent analysis steps. It is highly advised that you install
HT2 index files are not provided, the ‘input_files/indices/’ directory should be deleted.
An example ‘phenodata.csv’ file. File is stored in ‘CSV’ format.