Category

Gene Expression Analysis


Usage

rsem-prepare-reference [options] reference_fasta_file(s) reference_name


Manual

Arguments

  • reference_fasta_file(s): Either a comma-separated list of Multi-FASTA formatted files OR a directory name. If a directory name is specified, RSEM will read all files with suffix ".fa" or ".fasta" in this directory. The files should contain either the sequences of transcripts or an entire genome, depending on whether the --gtf option is used.
  • reference_name: The name of the reference used. RSEM will generate several reference-related files that are prefixed by this name. This name can contain path information (e.g. '/ref/mm9').

Options

  • --gtf file: If this option is on, RSEM assumes that reference_fasta_file(s) contains the sequence of a genome, and will extract transcript reference sequences using the gene annotations specified in file, which should be in GTF format.
    If this and --gff3 options are off, RSEM will assume reference_fasta_file(s) contains the reference transcripts. In this case, RSEM assumes that name of each sequence in the Multi-FASTA files is its transcript_id. (Default: off)
  • --gff3 file: The annotation file is in GFF3 format instead of GTF format. RSEM will first convert it to GTF format with the file name reference_name.gtf. Please make sure that reference_name.gtf does not exist. (Default: off)
  • --gff3-RNA-patterns patternpattern is a comma-separated list of transcript categories, e.g. "mRNA,rRNA". Only transcripts that match the pattern will be extracted. (Default: "mRNA")
  • --trusted-sources sourcessources is a comma-separated list of trusted sources, e.g. "ENSEMBL,HAVANA". Only transcripts coming from these sources will be extracted. If this option is off, all sources are accepted. (Default: off)
  • --transcript-to-gene-map file: Use information from file to map from transcript (isoform) ids to gene ids. Each line of file should be of the form: 
    gene_id    transcript_id
     with the two fields separated by a tab character.
    If you are using a GTF file for the "UCSC Genes" gene set from the UCSC Genome Browser, then the "knownIsoforms.txt" file (obtained from the "Downloads" section of the UCSC Genome Browser site) is of this format.
    If this option is off, then the mapping of isoforms to genes depends on whether the --gtf option is specified. If --gtf is specified, then RSEM uses the "gene_id" and "transcript_id" attributes in the GTF file. Otherwise, RSEM assumes that each sequence in the reference sequence files is a separate gene. (Default: off)
  • --allele-to-gene-map file: Use information from file to provide gene_id and transcript_id information for each allele-specific transcript. Each line of file should be of the form:
    gene_id    transcript_id    allele_id
    with the fields separated by a tab character.
    This option is designed for quantifying allele-specific expression. It is only valid if --gtf option is not specified. allele_id should be the sequence names presented in the Multi-FASTA-formatted files. (Default: off)
  • --polyA: Add poly(A) tails to the end of all reference isoforms. The length of poly(A) tail added is specified by --polyA-length option. STAR aligner users may not want to use this option. (Default: do not add poly(A) tail to any of the isoforms)
  • --polyA-length int: The length of the poly(A) tails to be added. (Default: 125)
  • --no-polyA-subset file: Only meaningful if --polyA is specified. Do not add poly(A) tails to those transcripts listed in file. file is a file containing a list of transcript_ids. (Default: off)
  • --bowtie: Build Bowtie indices. (Default: off)
  • --bowtie-path path: The path to the Bowtie executables. (Default: the path to Bowtie executables is assumed to be in the user's PATH environment variable)
  • --bowtie2: Build Bowtie 2 indices. (Default: off)
  • --bowtie2-path: The path to the Bowtie 2 executables. (Default: the path to Bowtie 2 executables is assumed to be in the user's PATH environment variable)
  • --star: Build STAR indices. (Default: off)
  • --star-path path: The path to STAR's executable. (Default: the path to STAR executable is assumed to be in user's PATH environment varaible)
  • --star-sjdboverhang int: Length of the genomic sequence around annotated junction. It is only used for STAT to build splice junctions database and not needed for Bowtie or Bowtie2. It will be passed as the --sjdbOverhang option to STAR. According to STAR's manual, its ideal value is max(ReadLength)-1, e.g. for 2x101 paired-end reads, the ideal value is 101-1=100. In most cases, the default value of 100 will work as well as the ideal value. (Default: 100)
  • -p/--num-threads int: Number of threads to use for building STAR's genome indices. (Default: 1)
  • -q/--quiet: Suppress the output of logging information. (Default: off)
  • -h/--help: Show help information.

Examples

Index Used by the ENCODE Project

Files used:

.
├── ENCFF159KBI.gtf
└── fas
    ├── ENCFF001RTP.fasta
    ├── ENCFF335FFV.fasta
    └── GRCh38_no_alt_analysis_set_GCA_000001405.15.fasta

Run the following command will generate index (with a reference_name rsem) in the current folder:

rsem-prepare-reference --gtf ENCFF159KBI.gtf fas ./rsem

If successful index files will be saved to the folder:

.
├── ENCFF159KBI.gtf
├── fas
│   ├── ENCFF001RTP.fasta
│   ├── ENCFF335FFV.fasta
│   └── GRCh38_no_alt_analysis_set_GCA_000001405.15.fasta
├── rsem.chrlist  # if --gtf is on
├── rsem.grp
├── rsem.idx.fa
├── rsem.n2g.idx.fa
├── rsem.seq
├── rsem.ti
└── rsem.transcripts.fa  # the extracted reference transcripts in Multi-FASTA format
Build RSEM and Aligner's Indexes

Suppose we have mouse RNA-Seq data and want to use the UCSC mm9 version of the mouse genome. We have downloaded the UCSC Genes transcript annotations in GTF format (as mm9.gtf) using the Table Browser and the knownIsoforms.txt file for mm9 from the UCSC Downloads. We also have all chromosome files for mm9 in the directory '/data/mm9'. We want to put the generated reference files under '/ref' with name 'mouse_0'. We do not add any poly(A) tails. Please note that GTF files generated from UCSC's Table Browser do not contain isoform-gene relationship information. For the UCSC Genes annotation, this information can be obtained from the knownIsoforms.txt file. Suppose we want to build Bowtie indices and Bowtie executables are found in '/sw/bowtie'.

There are two ways to write the command:

rsem-prepare-reference --gtf mm9.gtf \
                       --transcript-to-gene-map knownIsoforms.txt \
                       --bowtie \
                       --bowtie-path /sw/bowtie \
                       /data/mm9/chr1.fa,/data/mm9/chr2.fa,...,/data/mm9/chrM.fa \
                       /ref/mouse_0

Or

rsem-prepare-reference --gtf mm9.gtf \
                       --transcript-to-gene-map knownIsoforms.txt \
                       --bowtie \
                       --bowtie-path /sw/bowtie \
                       /data/mm9 \
                       /ref/mouse_0


Share your experience or ask a question