view rsem_calculate_expression.xml @ 5:14267d364365 default tip

Update for dataset files_path - use model from BB pull request 532
author Jim Johnson <jj@umn.edu>
date Thu, 04 Feb 2016 06:50:26 -0600
parents 30a8343fb0e7
children
line wrap: on
line source

<tool id="rsem_calculate_expression" name="RSEM calculate expression" version="1.1.17">
  <description>RNA-Seq by Expectation-Maximization</description>
  <requirements>
    <requirement type="package" version="1.1.17">rsem</requirement>
    <requirement type="package" version="1.0.0">bowtie</requirement>
  </requirements>
  <command>
    rsem-calculate-expression 
    ## --tag string
    #if $seedlength:
      --seed-length $seedlength 
    #end if
    --forward-prob $forward_prob
    #if $rsem_options.fullparams == 'fullset':
      ## Fragment info
      #if $rsem_options.fragment_length_mean:
        --fragment-length-mean $rsem_options.fragment_length_mean
      #end if
      #if $rsem_options.fragment_length_min:
        --fragment-length-min $rsem_options.fragment_length_min
      #end if
      #if $rsem_options.fragment_length_sd:
        --fragment-length-sd $rsem_options.fragment_length_sd
      #end if
      #if $rsem_options.fragment_length_max:
        --fragment-length-max $rsem_options.fragment_length_max
      #end if
      ## RSPD
      #if $rsem_options.rspd.estimate == 'yes':
        --estimate-rspd
        #if $rsem_options.rspd.num_rspd_bins:
          --num-rspd-bins $rsem_options.rspd.num_rspd_bins
        #end if
      #end if
      ## Calculate 95% credibility intervals and posterior mean estimates. 
      #if $rsem_options.useci.ci == 'yes':
        --calc-ci
        #if $rsem_options.useci.cimem:
          --ci-memory $rsem_options.useci.cimem
        #end if
      #end if
    #end if
    ## --num-threads $GALAXY_SLOTS
    #if $input.format != 'bam' and $input.bowtie_options.fullparams == 'fullset':
      ## Bowtie params
      #if $bowtie_options.bowtie_e:
      --bowtie-e $bowtie_options.bowtie_e
      #end if
      #if $bowtie_options.bowtie_m:
      --bowtie-m $bowtie_options.bowtie_m
      #end if
      #if $bowtie_options.bowtie_n:
      --bowtie-n $bowtie_options.bowtie_n
      #end if
    #end if
    ## Outputs
    #if $rsem_outputs.result_bams == 'none':
      --no-bam-output
    #else
      #if $rsem_outputs.result_bams == 'both':
        --output-genome-bam
      #end if
      $rsem_outputs.sampling_for_bam
    #end if
    ## Input data
    #if $input.format=="fastq"
      $input.fastq_select
      #if $input.fastq.matepair=="single": 
        $input.fastq.singlefastq
      #elif $input.fastq.matepair=="paired":
        --paired-end
        $input.fastq.fastq1
        $input.fastq.fastq2
      #end if
    #elif $input.format=="fasta"
      --no-qualities
      #if $input.fasta.matepair=="single": 
        $input.fasta.singlefasta
      #elif $input.fasta.matepair=="paired":
        --paired-end
        $input.fasta.fasta1
        $input.fasta.fasta2
      #end if
    #elif $input.format=="sam"
      #if $input.matepair=="paired":
        --paired-end
      #end if
      #if $input.rsem_sam._extension == 'sam':
        --sam
      #elif $input.rsem_sam._extension == 'bam':
        --bam
      #end if
      $input.rsem_sam
    #end if
    ## RSEM reference
    #if $reference.refSrc == 'history':
      ${reference.rsem_ref.extra_files_path}/${reference.rsem_ref.metadata.reference_name}
    #elif $reference.refSrc == 'cached':
      ${reference.index.fields.path}
    #end if
    ## sample_name: use a hard coded name so we can pull out galaxy outputs
    rsem_output
    ## direct output into logfile
    > $log
  </command>
  <macros>
    <macro name="rsem_options">
        <param name="seedlength" type="integer" value="25" optional="true" label="Seed length used by the read aligner" help="Providing the correct value for this parameter is important for RSEM's accuracy if the data are single-end reads. RSEM uses this value for Bowtie's seed length parameter. The minimum value is 25. (Default:25)">
        </param>
        <param name="forward_prob" type="select" label="Is the library strand specific?">
          <option value="0.5" selected="true">No</option>
          <option value="1">Yes, the reads (or first reads from paired-end libraries) are only in the forward orientation</option>
          <option value="0">Yes, the reads (or first reads from paired-end libraries) are only in the reverse orientation</option>
        </param>
        <conditional name="rsem_options">
          <param name="fullparams" type="select" label="Additional RSEM options">
            <option value="default">Use RSEM Defaults</option>
            <option value="fullset">Set Additional RSEM Options</option>
          </param>
          <when value="default"/>
          <when value="fullset">
            <param name="fragment_length_min" type="integer" value="1" optional="true" label="Minimum read/insert length." help=" This is also the value for the bowtie -I option">
              <validator type="in_range" message="0 or greater" min="0" />
            </param>
            <param name="fragment_length_max" type="integer" value="1000" optional="true" label="Maximum read/insert length." help=" This is also the value for the bowtie -X option">
              <validator type="in_range" message="0 or greater" min="0" max="1000000"/>
            </param>
            <param name="fragment_length_mean" type="float" value="" optional="true" label="Fragment length mean (single-end data only)" help="The mean of the fragment length distribution, which is assumed to be a Gaussian. (Default: -1, which disables use of the fragment length distribution)">
            </param>
            <param name="fragment_length_sd" type="float" value="" optional="true" label="The standard deviation of the fragment length distribution (single-end data only)" help="Default 0, which assumes that all fragments are of the same length, given by the rounded value of fragment length mean. ">
            </param>
            <conditional name="rspd">
              <param name="estimate" type="select" lanel="Read Start Position Distribution (RSPD)" 
                  help="Set this option if you want to estimate the read start position distribution (RSPD) from data. Otherwise, RSEM will use a uniform RSPD.">
                <option value="no" selected="true">Use a uniform RSPD</option>
                <option value="yes">Estimate and correct for a non-uniform RSPD</option>
              </param>
              <when value="no"/>
              <when value="yes"> 
                <param name="num_rspd_bins" type="integer" value="20" optional="true" label="Number of bins in the RSPD." help="Use of the default setting of 20 is recommended.">
                   <validator type="in_range" message="" min="0" max="100"/>
                </param>
              </when>
            </conditional>
            <conditional name="useci">
              <param name="ci" type="select" label="Calculate 95% Credibility Intervals">
                <option value="no" selected="true">no</option>
                <option value="yes">yes</option>
              </param>
              <when value="no"/>
              <when value="yes">
                <param name="cimem" size="4" type="text" value="1024" label="Amount of memory in (MB) for computing CI" />
              </when>
            </conditional>
          </when>
        </conditional>
    </macro>
    <macro name="bowtie_options">
        <conditional name="bowtie_options">
          <param name="fullparams" type="select" label="bowtie settings">
            <option value="default">use bowtie defaults</option>
            <option value="fullset">set bowtie options</option>
          </param>
          <when value="default"/>
          <when value="fullset">
            <param name="bowtie_n" type="integer" value="2" optional="true" label="Bowtie mismatches" help="Bowtie parameter max # of mismatches in the seed. (Range: 0-3, Default: 2) ">
              <validator type="in_range" message="max # of mismatches in the seed between 0 and 3" min="0" max="3"/>
            </param>
            <param name="bowtie_e" type="integer" value="99999999" label="Maximum sum of quality scores at mismatched positions in read alignments.  This is also the value for the Bowtie -e option">
            </param>
            <param name="bowtie_m" type="integer" value="200" label="Discard alignments for reads with number of alignments greater than">
            </param>
          </when>
        </conditional>
    </macro>
    <macro name="sampling_for_bam">
        <param name="sampling_for_bam" type="boolean" truevalue="--sampling-for-bam" falsevalue="" checked="false" label="Use sampling for BAM">
          <help> When RSEM generates a BAM file, instead of outputing all alignments a read has with their posterior probabilities, one alignment is sampled according to the posterior probabilities. The sampling procedure includes the alignment to the "noise" transcript, which does not appear in the BAM file. Only the sampled alignment has a weight of 1. All other alignments have weight 0. If the "noise" transcript is sampled, all alignments appeared in the BAM file should have weight 0. (Default: off)
          </help>
        </param>
    </macro>
  </macros>

  <inputs>
    <param name="sample" type="text" value="rsem_sample" label="Sample name" />
    <conditional name="reference">
      <param name="refSrc" type="select" label="RSEM Reference Source">
        <option value="cached">Locally cached</option>
        <option value="history">From your history</option>
      </param>
      <when value="cached">
        <param name="index" type="select" label="Select RSEM reference" help="Select from a list of pre-indexed references. If you don't see anything consult the wrapper's documentation on how to create or download a reference">
          <options from_data_table="rsem_indexes">
            <filter type="sort_by" column="2" />
            <validator type="no_options" message="No indexes are available" />
          </options>
        </param>
      </when>
      <when value="history">
        <param name="rsem_ref" type="data" format="rsem_ref" label="RSEM reference" />
      </when>
    </conditional>
    <conditional name="input">
      <param name="format" type="select" label="RSEM Input file type">
        <option value="fastq">FASTQ</option>
        <option value="fasta">FASTA</option>
        <option value="sam">SAM/BAM</option>
      </param>
      <when value="fastq">
        <param name="fastq_select" size="15" type="select" label="FASTQ type" >
          <option value="--phred33-quals" selected="true">phred33 qualities (default for sanger)</option>
          <option value="--solexa-quals">solexa qualities</option>
          <option value="--phred64-quals">phred64 qualities</option>
        </param>
        <conditional name="fastq">
          <param name="matepair" type="select" label="Library type">
            <option value="single">Single End Reads</option>
            <option value="paired">Paired End Reads</option>
          </param>
          <when value="single">
            <param name="singlefastq" type="data" format="fastq" label="FASTQ file" />
          </when>
          <when value="paired">
            <param name="fastq1" type="data" format="fastq" label="Read 1 fastq file" />
            <param name="fastq2" type="data" format="fastq" label="Read 2 fastq file" />
          </when>
        </conditional>
        <expand macro="bowtie_options"/>
      </when>
      <when value="fasta">
        <conditional name="fasta">
          <param name="matepair" type="select" label="Library Type">
            <option value="single">Single End Reads</option>
            <option value="paired">Paired End Reads</option>
          </param>
          <when value="single">
            <param name="singlefasta" type="data" format="fasta" label="fasta file" />
          </when>
          <when value="paired">
            <param name="fasta1" type="data" format="fasta" label="Read 1 fasta file" />
            <param name="fasta2" type="data" format="fasta" label="Read 2 fasta file" />
          </when>
        </conditional>
        <expand macro="bowtie_options"/>
      </when>
      <when value="sam">
          <!-- convert-sam-for-rsem /ref/mouse_125 input.sam -o input_for_rsem.sam -->
          <param name="matepair" type="select" label="Library Type">
            <option value="single">Single End Reads</option>
            <option value="paired">Paired End Reads</option>
          </param>
          <param name="rsem_sam" type="data" format="rsem_sam" label="RSEM formatted SAM file" />
      </when>
    </conditional>
    <expand macro="rsem_options"/>
    <conditional name="rsem_outputs">
      <param name="result_bams" type="select" label="Create bam results files" 
             help="In addition to the transcript-coordinate-based BAM file output, also output a BAM file with the read alignments in genomic coordinates" >
        <option value="none">No BAM results files</option>
        <option value="default" selected="true">Transcript BAM results file</option>
        <option value="both">Transcript and genome BAM results files</option>
      </param>
      <when value="none"/>
      <when value="default">
        <expand macro="sampling_for_bam"/>
      </when>
      <when value="both">
        <expand macro="sampling_for_bam"/>
      </when>
    </conditional>
  </inputs>
  <stdio>
    <exit_code range="1:"  level="fatal" description="Error Running RSEM" />
  </stdio>
  <outputs>
    <data format="tabular" name="gene_abundances" label="${sample}.gene_abundances" from_work_dir="rsem_output.genes.results"/>
    <data format="tabular" name="isoform_abundances" label="${sample}.isoform_abundances" from_work_dir="rsem_output.isoforms.results"/>
    <data format="bam" name="transcript_bam" label="${sample}.transcript.bam" from_work_dir="rsem_output.transcript.bam" >
      <filter>rsem_outputs['result_bams'] != "none"</filter>
    </data>
    <data format="bam" name="transcript_sorted_bam" label="${sample}.transcript.bam" from_work_dir="rsem_output.transcript.sorted.bam" >
      <filter>rsem_outputs['result_bams'] != "none"</filter>
    </data>
    <data format="bam" name="genome_bam" label="${sample}.genome.bam" from_work_dir="rsem_output.genome.bam">
      <filter>rsem_outputs['result_bams'] == "both"</filter>
    </data>
    <data format="bam" name="genome_sorted_bam" label="${sample}.genome.sorted.bam" from_work_dir="rsem_output.genome.sorted.bam">
      <filter>rsem_outputs['result_bams'] == "both"</filter>
    </data>
    <data format="txt" name="log" label="${sample}.rsem_log"/>
  </outputs>
  <tests>
    <test>
      <param name="sample" value="rsem_sample"/>
      <param name="refSrc" value="history"/>
      <param name="rsem_ref" value="RSEM_ref_reference.rsem_ref" ftype="rsem_ref"/>
      <param name="format" value="fastq"/>
      <param name="matepair" value="single"/>
      <param name="singlefastq" value="test.fastq" ftype="fastqsanger"/>
      <param name="result_bams" value="none"/>
      <output name="gene_abundances"> 
        <assert_contents>
          <has_text text="ENST00000423562,ENST00000438504,ENST00000488147,ENST00000538476,ENST00000541675" />
        </assert_contents>
      </output>
      <output name="isoform_abundances"> 
        <assert_contents>
          <has_text text="ENST00000332831" />
        </assert_contents>
      </output>
      <output name="log"> 
        <assert_contents>
          <has_text text="Expression Results are written" />
        </assert_contents>
      </output>
    </test>
  </tests>
  <help>
  

RSEM HOME PAGE - http://deweylab.biostat.wisc.edu/rsem/

NAME
    rsem-calculate-expression

SYNOPSIS
         rsem-calculate-expression [options] upstream_read_file(s) reference_name sample_name
         rsem-calculate-expression [options] --paired-end upstream_read_file/s downstream_read_file/s reference_name sample_name
         rsem-calculate-expression [options] --sam/--bam [--paired-end] input reference_name sample_name

ARGUMENTS
    upstream_read_files/s
        Comma-separated list of files containing single-end reads or
        upstream reads for paired-end data. By default, these files are
        assumed to be in FASTQ format. If the --no-qualities option is
        specified, then FASTA format is expected.

    downstream_read_file/s
        Comma-separated list of files containing downstream reads which are
        paired with the upstream reads. By default, these files are assumed
        to be in FASTQ format. If the --no-qualities option is specified,
        then FASTA format is expected.

    input
        SAM/BAM formatted input file. If "-" is specified for the filename,
        SAM/BAM input is instead assumed to come from standard input. RSEM
        requires all alignments of the same read group together. For
        paired-end reads, RSEM also requires the two mates of any alignment
        be adjacent. See Description section for how to make input file obey
        RSEM's requirements.

    reference_name
        The name of the reference used. The user must have run
        'rsem-prepare-reference' with this reference_name before running
        this program.

    sample_name
        The name of the sample analyzed. All output files are prefixed by
        this name (e.g., sample_name.genes.results)

OPTIONS

    --paired-end
        Input reads are paired-end reads. (Default: off)

    --no-qualities
        Input reads do not contain quality scores. (Default: off)

    --strand-specific
        The RNA-Seq protocol used to generate the reads is strand specific,
        i.e., all (upstream) reads are derived from the forward strand. This
        option is equivalent to --forward-prob=1.0. With this option set, if
        RSEM runs the Bowtie aligner, the '--norc' Bowtie option will be
        used, which disables alignment to the reverse strand of transcripts.
        (Default: off)

    --sam
        Input file is in SAM format. (Default: off)

    --bam
        Input file is in BAM format. (Default: off)

    --sam-header-info [file]
        RSEM reads header information from input by default. If this option
        is on, header information is read from the specified file. For the
        format of the file, please see SAM official website. (Default: "")

    -p/--num-threads [int]
        Number of threads to use. Both Bowtie and expression estimation will
        use this many threads. (Default: 1)

    --no-bam-output
        Do not output any BAM file. (Default: off)

    --output-genome-bam
        Generate a BAM file, 'sample_name.genome.bam', with alignments
        mapped to genomic coordinates and annotated with their posterior
        probabilities. In addition, RSEM will call samtools (included in
        RSEM package) to sort and index the bam file.
        'sample_name.genome.sorted.bam' and
        'sample_name.genome.sorted.bam.bai' will be generated. (Default:
        off)

    --sampling-for-bam
        When RSEM generates a BAM file, instead of outputing all alignments
        a read has with their posterior probabilities, one alignment is
        sampled and outputed according to the posterior probabilities. If
        the sampling result is that the read comes from the "noise"
        transcript, nothing is outputed. (Default: off)

    --calc-ci
        Calculate 95% credibility intervals and posterior mean estimates.
        (Default: off)

    --seed-length [int]
        Seed length used by the read aligner. Providing the correct value is
        important for RSEM. If RSEM runs Bowtie, it uses this value for
        Bowtie's seed length parameter. Any read with its or at least one of
        its mates' (for paired-end reads) length less than this value will
        be ignored. If the references are not added poly(A) tails, the
        minimum allowed value is 5, otherwise, the minimum allowed value is
        25. Note that this script will only check if the value less or equal than
        5 and give a warning message if the value less than 25 but greter or equal than
        5. (Default: 25)

    --tag [string]
        The name of the optional field used in the SAM input for identifying
        a read with too many valid alignments. The field should have the
        format [tagName]:i:[value], where a [value] bigger than 0 indicates
        a read with too many alignments. (Default: "")

    --bowtie-path [path]
        The path to the bowtie executables. (Default: the path to the bowtie
        executables is assumed to be in the user's PATH environment
        variable)

    --bowtie-n [int]
        (Bowtie parameter) max # of mismatches in the seed. (Range: 0-3,
        Default: 2)

    --bowtie-e [int]
        (Bowtie parameter) max sum of mismatch quality scores across the
        alignment. (Default: 99999999)

    --bowtie-m [int]
        (Bowtie parameter) suppress all alignments for a read if greater then [int]
        valid alignments exist. (Default: 200)

    --bowtie-chunkmbs [int]
        (Bowtie parameter) memory allocated for best first alignment
        calculation (Default: 0 - use bowtie's default)

    --phred33-quals
        Input quality scores are encoded as Phred+33. (Default: on)

    --phred64-quals
        Input quality scores are encoded as Phred+64 (default for GA
        Pipeline ver. less than  1.3). (Default: off)

    --solexa-quals
        Input quality scores are solexa encoded (from GA Pipeline ver. less
        than 1.3). (Default: off)

    --forward-prob [double]
        Probability of generating a read from the forward strand of a
        transcript. Set to 1 for a strand-specific protocol where all
        (upstream) reads are derived from the forward strand, 0 for a
        strand-specific protocol where all (upstream) read are derived from
        the reverse strand, or 0.5 for a non-strand-specific protocol.
        (Default: 0.5)

    --fragment-length-min [int]
        Minimum read/insert length allowed. This is also the value for the
        bowtie -I option. (Default: 1)

    --fragment-length-max [int]
        Maximum read/insert length allowed. This is also the value for the
        bowtie -X option. (Default: 1000)

    --fragment-length-mean [double]
        (single-end data only) The mean of the fragment length distribution,
        which is assumed to be a Gaussian. (Default: -1, which disables use
        of the fragment length distribution)

    --fragment-length-sd [double]
        (single-end data only) The standard deviation of the fragment length
        distribution, which is assumed to be a Gaussian. (Default: 0, which
        assumes that all fragments are of the same length, given by the
        rounded value of --fragment-length-mean)

    --estimate-rspd
        Set this option if you want to estimate the read start position
        distribution (RSPD) from data. Otherwise, RSEM will use a uniform
        RSPD. (Default: off)

    --num-rspd-bins [int]
        Number of bins in the RSPD. Only relevant when '--estimate-rspd' is
        specified. Use of the default setting is recommended. (Default: 20)

    --ci-memory [int]
        Maximum size (in memory, MB) of the auxiliary buffer used for
        computing credibility intervals (CI). Set it larger for a faster CI
        calculation. However, leaving 2 GB memory free for other usage is
        recommended. (Default: 1024)

    --keep-intermediate-files
        Keep temporary files generated by RSEM. RSEM creates a temporary
        directory, 'sample_name.temp', into which it puts all intermediate
        output files. If this directory already exists, RSEM overwrites all
        files generated by previous RSEM runs inside of it. By default,
        after RSEM finishes, the temporary directory is deleted. Set this
        option to prevent the deletion of this directory and the
        intermediate files inside of it. (Default: off)

    --time
        Output time consumed by each step of RSEM to 'sample_name.time'.
        (Default: off)

    -q/--quiet
        Suppress the output of logging information. (Default: off)

    -h/--help
        Show help information.

DESCRIPTION
    In its default mode, this program aligns input reads against a reference
    transcriptome with Bowtie and calculates expression values using the
    alignments. RSEM assumes the data are single-end reads with quality
    scores, unless the '--paired-end' or '--no-qualities' options are
    specified. Users may use an alternative aligner by specifying one of the
    --sam and --bam options, and providing an alignment file in the
    specified format. However, users should make sure that they align
    against the indices generated by 'rsem-prepare-reference' and the
    alignment file satisfies the requirements mentioned in ARGUMENTS
    section.

    One simple way to make the alignment file satisfying RSEM's requirements
    (assuming the aligner used put mates in a paired-end read adjacent) is
    to use 'convert-sam-for-rsem' script. This script only accept SAM format
    files as input. If a BAM format file is obtained, please use samtools to
    convert it to a SAM file first. For example, if '/ref/mouse_125' is the
    'reference_name' and the SAM file is named 'input.sam', you can run the
    following command:

      convert-sam-for-rsem /ref/mouse_125 input.sam -o input_for_rsem.sam

    For details, please refer to 'convert-sam-for-rsem's documentation page.

    The SAM/BAM format RSEM uses is v1.4. However, it is compatible with old
    SAM/BAM format. However, RSEM cannot recognize 0x100 in the FLAG field.
    In addition, RSEM requires SEQ and QUAL are not '*'.

    The user must run 'rsem-prepare-reference' with the appropriate
    reference before using this program.

    For single-end data, it is strongly recommended that the user provide
    the fragment length distribution parameters (--fragment-length-mean and
    --fragment-length-sd). For paired-end data, RSEM will automatically
    learn a fragment length distribution from the data.

    Please note that some of the default values for the Bowtie parameters
    are not the same as those defined for Bowtie itself.

    The temporary directory and all intermediate files will be removed when
    RSEM finishes unless '--keep-intermediate-files' is specified.

    With the '--calc-ci' option, 95% credibility intervals and posterior
    mean estimates will be calculated in addition to maximum likelihood
    estimates.

OUTPUT
    sample_name.genes.results
        File containing gene level expression estimates. The format of each
        line in this file is:

        gene_id expected_counts tau_value [pmc_value tau_pme_value
        tau_ci_lower_bound tau_ci_upper_bound] transcript_id_list

        Fields are separated by the tab character. Fields within "[]" are
        only presented if '--calc-ci' is set. pme stands for posterior mean
        estimation. pmc stands for posterior mean counts. ci_lower_bound(l)
        means the lower bound of the credibility intervals,
        ci_upper_bound(u) means the upper bound of the credibility
        intervals. So the credibility interval is [l, u].
        'transcript_id_list' is a space-separated list of transcript_ids
        belonging to the gene. If no gene information is provided, this file
        has the same content as 'sample_name.isoforms.results'.

    sample_name.isoforms.results
        File containing isoform level expression values. The format of each
        line in this file is:

        transcript_id expected_counts tau_value [pmc_value tau_pme_value
        tau_ci_lower_bound tau_ci_upper_bound] gene_id

        Fields are separated by the tab character. 'gene_id' is the gene_id
        of the gene which this transcript belongs to. If no gene information
        is provided, 'gene_id' and 'transcript_id' are the same.

    sample_name.transcript.bam, sample_name.transcript.sorted.bam and
    sample_name.transcript.sorted.bam.bai
        Only generated when --no-bam-output is not specified.

        'sample_name.transcript.bam' is a BAM-formatted file of read
        alignments in transcript coordinates. The MAPQ field of each
        alignment is set to min(100, floor(-10 * log10(1.0 - w) + 0.5)),
        where w is the posterior probability of that alignment being the
        true mapping of a read. In addition, RSEM pads a new tag ZW:f:value,
        where value is a single precision floating number representing the
        posterior probability.

        'sample_name.transcript.sorted.bam' and
        'sample_name.transcript.sorted.bam.bai' are the sorted BAM file and
        indices generated by samtools (included in RSEM package).

    sample_name.genome.bam, sample_name.genome.sorted.bam and
    sample_name.genome.sorted.bam.bai
        Only generated when --no-bam-output is not specified and
        --output-genome-bam is specified.

        'sample_name.genome.bam' is a BAM-formatted file of read alignments
        in genomic coordinates. Alignments of reads that have identical
        genomic coordinates (i.e., alignments to different isoforms that
        share the same genomic region) are collapsed into one alignment. The
        MAPQ field of each alignment is set to min(100, floor(-10 *
        log10(1.0 - w) + 0.5)), where w is the posterior probability of that
        alignment being the true mapping of a read. In addition, RSEM pads a
        new tag ZW:f:value, where value is a single precision floating
        number representing the posterior probability. If an alignment is
        spliced, a XS:A:value tag is also added, where value is either '+'
        or '-' indicating the strand of the transcript it aligns to.

        'sample_name.genome.sorted.bam' and
        'sample_name.genome.sorted.bam.bai' are the sorted BAM file and
        indices generated by samtools (included in RSEM package).

    sample_name.sam.gz
        Only generated when the input files are raw reads instead of SAM/BAM
        format files

        It is the gzipped SAM output produced by bowtie aligner.

    sample_name.time
        Only generated when --time is specified.

        It contains time (in seconds) consumed by aligning reads, estimating
        expression levels and calculating credibility intervals.

    sample_name.stat
        This is a folder instead of a file. All model related statistics are
        stored in this folder. Use 'rsem-plot-model' can generate plots
        using this folder.

EXAMPLES
    Assume the path to the bowtie executables is in the user's PATH
    environment variable. Reference files are under '/ref' with name
    'mouse_125'.

    1) '/data/mmliver.fq', single-end reads with quality scores. Quality
    scores are encoded as for 'GA pipeline version >= 1.3'. We want to use 8
    threads and generate a genome BAM file:

     rsem-calculate-expression --phred64-quals \
                               -p 8 \
                               --output-genome-bam \
                               /data/mmliver.fq \
                               /ref/mouse_125 \
                               mmliver_single_quals

    2) '/data/mmliver_1.fq' and '/data/mmliver_2.fq', paired-end reads with
    quality scores. Quality scores are in SANGER format. We want to use 8
    threads and do not generate a genome BAM file:

     rsem-calculate-expression -p 8 \
                               --paired-end \
                               /data/mmliver_1.fq \
                               /data/mmliver_2.fq \
                               /ref/mouse_125 \
                               mmliver_paired_end_quals

    3) '/data/mmliver.fa', single-end reads without quality scores. We want
    to use 8 threads:

     rsem-calculate-expression -p 8 \
                               --no-qualities \
                               /data/mmliver.fa \
                               /ref/mouse_125 \
                               mmliver_single_without_quals

    4) Data are the same as 1). We want to take a fragment length
    distribution into consideration. We set the fragment length mean to 150
    and the standard deviation to 35. In addition to a BAM file, we also
    want to generate credibility intervals. We allow RSEM to use 1GB of
    memory for CI calculation:

     rsem-calculate-expression --bowtie-path /sw/bowtie \
                               --phred64-quals \
                               --fragment-length-mean 150.0 \
                               --fragment-length-sd 35.0 \
                               -p 8 \
                               --output-genome-bam \
                               --calc-ci \
                               --ci-memory 1024 \
                               /data/mmliver.fq \
                               /ref/mouse_125 \
                               mmliver_single_quals

    5) '/data/mmliver_paired_end_quals.bam', paired-end reads with quality
    scores. We want to use 8 threads:

     rsem-calculate-expression --paired-end \
                               --bam \
                               -p 8 \
                               /data/mmliver_paired_end_quals.bam \
                               /ref/mouse_125 \
                               mmliver_paired_end_quals
  </help> 
</tool>