diff hisat.xml @ 0:e3fe061597ac draft

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/hisat commit 5a7365750648c26206f05ac7956936c243c2b980
author devteam
date Thu, 11 Jun 2015 16:35:16 -0400
parents
children 8bb3efa0dae8
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hisat.xml	Thu Jun 11 16:35:16 2015 -0400
@@ -0,0 +1,354 @@
+<tool id="hisat" name="HISAT" version="1.0.1">
+    <description>spliced aligner</description>
+    <macros>
+        <import>hisat_macros.xml</import>
+    </macros>
+    <requirements>
+        <requirement type="package" version="0.1.6">hisat</requirement>
+        <requirement type="package" version="1.2">samtools</requirement>
+    </requirements>
+    <stdio>
+        <exit_code range="1:" />
+    </stdio>
+    <version_command>hisat --version</version_command>
+    <command><![CDATA[
+        #if str($spliced_options.spliced_options_selector) == "advanced" and str($spliced_options.known_splice_gff) != 'None':
+            ln -s "${spliced_options.known_splice_gff}" splice_sites.gff &&
+            extract_splice_sites.py splice_sites.gff > splice_sites.txt &&
+        #end if
+        #if $reference_genome.reference_genome_source == "history":
+            ln -s "$reference_genome.history_item" genome.fa &&
+            hisat-build genome.fa genome && 
+            #set index_path = 'genome'
+        #else:
+            #set index_path = $reference_genome.index.fields.path
+        #end if
+        hisat -p \${GALAXY_SLOTS:-1} -x "${index_path}"
+        #if str($input_format.paired.paired_selector) == 'paired':
+            -1 "${reads_f}" -2 "${reads_r}"
+        #else if str($input_format.paired.paired_selector) == 'paired_collection':
+            -1 "${input_format.paired.reads.forward}" -2 "${input_format.paired.reads.reverse}"
+        #else if str($input_format.paired.paired_selector) == 'paired_list':
+            #set forward_reads = []
+            #set reverse_reads = []
+            #for read in $input_format.paired.reads:
+                $forward_reads.append($read.forward)
+                $reverse_reads.append($read.reverse)
+            #end for
+            -1 "${','.join([str($read) for read in $forward_reads])}"
+            -2 "${','.join([str($read) for read in $reverse_reads])}"
+        #else:
+            -U "${reads}"
+        #end if
+        #if $input_format.input_format_selector == 'fasta':
+            -f
+        #end if
+        #if str($input_options.input_options_selector) == "advanced":
+            -s ${input_options.skip} -u ${input_options.stop_after} -5 ${input_options.trim_five} -3 ${input_options.trim_three}
+        #end if
+        #if str($scoring_options.scoring_options_selector) == "advanced":
+            --ma ${scoring_options.match_bonus} --mp ${scoring_options.max_mismatch},${scoring_options.min_mismatch}
+            --np ${scoring_options.ambiguous_penalty} --rdg ${scoring_options.read_open_penalty},${scoring_options.read_extend_penalty}
+            --rfg ${scoring_options.ref_open_penalty},${scoring_options.ref_extend_penalty}
+        #end if
+        #if str($alignment_options.alignment_options_selector) == "advanced":
+            --n-ceil ${alignment_options.function_type},${alignment_options.constant_term},${alignment_options.coefficient_term}
+            ${alignment_options.skip_forward} ${alignment_options.skip_reverse}
+        #end if
+        #if str($spliced_options.spliced_options_selector) == "advanced":
+            --pen-cansplice ${spliced_options.canonical_penalty} --pen-noncansplice ${spliced_options.noncanonical_penalty}
+            --pen-intronlen ${spliced_options.function_type},${spliced_options.constant_term},${spliced_options.coefficient_term}
+            #if str($spliced_options.known_splice_gff) != 'None':
+                --known-splicesite-infile splice_sites.txt
+            #end if
+        #end if
+        | samtools view -bS - | samtools sort - -o hsbam > "${output_alignments}"
+    ]]></command>
+    <inputs>
+        <conditional name="input_format">
+            <param name="input_format_selector" label="Input data format" type="select">
+                <option value="fastq" selected="selected">FASTQ</option>
+                <option value="fasta">FASTA</option>
+            </param>
+            <when value="fasta">
+                <conditional name="paired">
+                    <expand macro="single_paired_selector" />
+                    <when value="paired_collection">
+                        <param format="fasta" name="reads" type="data_collection" collection_type="paired" label="Paired reads" />
+                    </when>
+                    <when value="paired_list">
+                        <param format="fasta" name="reads" type="data_collection" collection_type="list:paired" label="Paired reads" />
+                    </when>
+                    <when value="paired">
+                        <param label="Forward reads" type="data" name="reads_f" multiple="true" format="fasta" />
+                        <param label="Reverse reads" type="data" name="reads_r" multiple="true" format="fasta" />
+                    </when>
+                    <when value="single">
+                        <param label="Reads" type="data" name="reads" multiple="true" format="fasta" />
+                    </when>
+                </conditional>
+            </when>
+            <when value="fastq">
+                <conditional name="paired">
+                    <expand macro="single_paired_selector" />
+                    <when value="paired_collection">
+                        <param format="fastq,fastqsanger,fastqsolexa" name="reads" type="data_collection" collection_type="paired" label="Paired reads" />
+                    </when>
+                    <when value="paired_list">
+                        <param format="fastq,fastqsanger,fastqsolexa" name="reads" type="data_collection" collection_type="list:paired" label="Paired reads" />
+                    </when>
+                    <when value="paired">
+                        <param label="Forward reads" type="data" name="reads_f" multiple="true" format="fastq,fastqsanger,fastqsolexa" />
+                        <param label="Reverse reads" type="data" name="reads_r" multiple="true" format="fastq,fastqsanger,fastqsolexa" />
+                    </when>
+                    <when value="single">
+                        <param label="Reads" type="data" name="reads" multiple="true" format="fastq,fastqsanger,fastqsolexa" />
+                    </when>
+                </conditional>
+            </when>
+        </conditional>
+        <conditional name="reference_genome">
+            <param name="reference_genome_source" type="select" label="Source for the reference genome to align against" help="Built-in references were created using default options">
+                <option value="indexed" selected="True">Use a built-in genome</option>
+                <option value="history">Use a genome from history</option>
+            </param>
+            <when value="indexed">
+                <param name="index" type="select" label="Select a reference genome" help="If your genome of interest is not listed, contact the Galaxy team">
+                    <options from_data_table="hisat_indexes">
+                        <filter type="sort_by" column="2"/>
+                        <validator type="no_options" message="No genomes are available for the selected input dataset"/>
+                    </options>
+                </param>
+            </when>
+            <when value="history">
+                <param name="history_item" type="data" format="fasta" metadata_name="dbkey" label="Select the reference genome" />
+            </when>
+        </conditional>
+        <conditional name="alignment_options">
+            <param label="Alignment options" name="alignment_options_selector" type="select">
+                <option value="defaults">Use default values</option>
+                <option value="advanced">Specify alignment parameters</option>
+            </param>
+            <when value="defaults" />
+            <when value="advanced">
+                <expand macro="function">
+                    <label>Sets a function governing the maximum number of ambiguous characters</label>
+                </expand>
+                <param name="ignore_quals" label="Ignore quality values" type="boolean" truevalue="--ignore-quals" falsevalue="" help="(--ignore-quals) When calculating a mismatch penalty, always consider the quality value at the mismatched position to be the highest possible, regardless of the actual value. I.e. input is treated as though all quality values are high. This is also the default behavior when the input doesn't specify quality values." />
+                <param name="skip_forward" label="Skip forward strand of reference" type="boolean" truevalue="--nofw" falsevalue="" help="(--nofw) If --nofw is specified, hisat will not attempt to align unpaired reads to the forward (Watson) reference strand. In paired-end mode, --nofw and --norc pertain to the fragments; i.e. specifying --nofw causes hisat to explore only those paired-end configurations corresponding to fragments from the reverse-complement (Crick) strand." />
+                <param name="skip_reverse" label="Skip reference strand of reference" type="boolean" truevalue="--norc" falsevalue="" help="(--norc) If --norc is specified, hisat will not attempt to align unpaired reads against the reverse-complement (Crick) reference strand. In paired-end mode, --nofw and --norc pertain to the fragments; i.e. specifying --nofw causes hisat to explore only those paired-end configurations corresponding to fragments from the reverse-complement (Crick) strand." />
+            </when>
+        </conditional>
+        <conditional name="input_options">
+            <param label="Input options" name="input_options_selector" type="select">
+                <option value="defaults">Use default values</option>
+                <option value="advanced">Specify input parameters</option>
+            </param>
+            <when value="defaults" />
+            <when value="advanced">
+                <param name="skip" label="Skip the first N reads or pairs in the input" help="-s" type="integer" value="0" default="0" />
+                <param name="stop_after" label="Stop after aligning N reads" help="(-u) Align the first N reads or read pairs from the input (after the first N reads or pairs have been skipped), then stop." type="integer" value="0" default="0" />
+                <param name="trim_five" label="Trim 5' end" help="(-5) Trim N bases from 5' (left) end of each read before alignment" type="integer" value="0" default="0" />
+                <param name="trim_three" label="Trim 3' end" help="(-3) Trim N bases from 3' (right) end of each read before alignment" type="integer" value="0" default="0" />
+            </when>
+        </conditional>
+        <conditional name="scoring_options">
+            <param label="Scoring options" name="scoring_options_selector" type="select">
+                <option value="defaults">Use default values</option>
+                <option value="advanced">Specify scoring parameters</option>
+            </param>
+            <when value="defaults" />
+            <when value="advanced">
+                <param name="match_bonus" label="Set match bonus" help="(--ma) In local mode N is added to the alignment score for each position where a read character aligns to a reference character and the characters match. Not used in end-to-end mode" type="integer" value="2" default="2" />
+                <param name="max_mismatch" label="Maximum mismatch penalty" help="(--mp) Sets the maximum mismatch penalty. A number less than or equal to MX and greater than or equal to MN is subtracted from the alignment score for each position where a read character aligns to a reference character, the characters do not match, and neither is an N. If --ignore-quals is specified, the number subtracted quals MX. Otherwise, the number subtracted is MN + floor( (MX-MN)(MIN(Q, 40.0)/40.0) ) where Q is the Phred quality value." type="integer" value="6" default="6" />
+                <param name="min_mismatch" label="Minimum mismatch penalty" help="(--mp) Sets the minimum mismatch penalty. A number less than or equal to MX and greater than or equal to MN is subtracted from the alignment score for each position where a read character aligns to a reference character, the characters do not match, and neither is an N. If --ignore-quals is specified, the number subtracted quals MX. Otherwise, the number subtracted is MN + floor( (MX-MN)(MIN(Q, 40.0)/40.0) ) where Q is the Phred quality value." type="integer" value="2" default="2" />
+                <param name="ambiguous_penalty" label="Ambiguous read penalty" help="(--np) Sets penalty for positions where the read, reference, or both, contain an ambiguous character such as N" type="integer" value="1" default="1" />
+                <param name="read_open_penalty" label="Read gap open penalty." type="integer" help="(--rdg) A read gap of length N gets a penalty of [open_penalty] + N * [extend_penalty]" value="5" default="5" />
+                <param name="read_extend_penalty" label="Read gap extend penalty." type="integer" help="(--rdg) A read gap of length N gets a penalty of [open_penalty] + N * [extend_penalty]" value="3" default="3" />
+                <param name="ref_open_penalty" label="Reference gap open penalty." help="(--rfg) A reference gap of length N gets a penalty of [open_penalty] + N * [extend_penalty]" type="integer" value="5" default="5" />
+                <param name="ref_extend_penalty" label="Reference gap extend penalty." help="(--rfg) A reference gap of length N gets a penalty of [open_penalty] + N * [extend_penalty]" type="integer" value="3" default="3" />
+            </when>
+        </conditional>
+        <conditional name="spliced_options">
+            <param label="Spliced alignment parameters" name="spliced_options_selector" type="select">
+                <option value="defaults">Use default values</option>
+                <option value="advanced">Specify spliced alignment parameters</option>
+            </param>
+            <when value="defaults" />
+            <when value="advanced">
+                <param name="canonical_penalty" label="Penalty for canonical splice sites" type="integer" value="0" />
+                <param name="noncanonical_penalty" label="Penalty for non-canonical splice sites" type="integer" value="3" />
+                <expand macro="function">
+                    <label>Sets the penalty for long introns so that alignments with shorter introns are preferred to those with longer ones.</label>
+                </expand>
+                <param name="min_intron" label="Minimum intron length" type="integer" value="20" />
+                <param name="max_intron" label="Maximum intron length" type="integer" value="500000" />
+                <param name="known_splice_gff" label="GTF/GFF file with known splice sites" type="data" format="gff" optional="True" />
+            </when>
+        </conditional>
+    </inputs>
+    <tests>
+        <test>
+            <param name="input_format_selector" value="fastq" />
+            <param name="paired_selector" value="paired" />
+            <param name="reference_genome_source" value="history" />
+            <param name="history_item" value="phiX.fa" ftype="fasta" />
+            <param name="reads_f" ftype="fastqsanger" value="hisat_input_1_forward.fastq" /> 
+            <param name="reads_r" ftype="fastqsanger" value="hisat_input_1_reverse.fastq" /> 
+            <output name="output_alignments" ftype="bam" file="hisat_output_1.bam" />
+        </test>
+        <test>
+            <param name="input_format_selector" value="fastq" />
+            <param name="paired_selector" value="paired" />
+            <param name="reference_genome_source" value="history" />
+            <param name="history_item" value="phiX.fa" ftype="fasta" />
+            <param name="input_options_selector" value="advanced" />
+            <param name="trim_three" value="15" />
+            <param name="trim_five" value="15" />
+            <param name="reads_f" ftype="fastqsanger" value="hisat_input_2_forward.fastq" /> 
+            <param name="reads_r" ftype="fastqsanger" value="hisat_input_2_reverse.fastq" /> 
+            <output name="output_alignments" ftype="bam" file="hisat_output_2.bam" />
+        </test>
+    </tests>
+    <outputs>
+        <data name="output_alignments" format="bam" />
+    </outputs>
+    <help><![CDATA[
+Introduction
+============
+
+What is HISAT?
+--------------
+
+`HISAT <http://ccb.jhu.edu/software/hisat>`__ is a fast and sensitive
+spliced alignment program. As part of HISAT, we have developed a new
+indexing scheme based on the Burrows-Wheeler transform
+(`BWT <http://en.wikipedia.org/wiki/Burrows-Wheeler_transform>`__) and
+the `FM index <http://en.wikipedia.org/wiki/FM-index>`__, called
+hierarchical indexing, that employs two types of indexes: (1) one global
+FM index representing the whole genome, and (2) many separate local FM
+indexes for small regions collectively covering the genome. Our
+hierarchical index for the human genome (about 3 billion bp) includes
+~48,000 local FM indexes, each representing a genomic region of
+~64,000bp. As the basis for non-gapped alignment, the FM index is
+extremely fast with a low memory footprint, as demonstrated by
+`Bowtie <http://bowtie-bio.sf.net>`__. In addition, HISAT provides
+several alignment strategies specifically designed for mapping different
+types of RNA-seq reads. All these together, HISAT enables extremely fast
+and sensitive alignment of reads, in particular those spanning two exons
+or more. As a result, HISAT is much faster >50 times than
+`TopHat2 <http://ccb.jhu.edu/software/tophat>`__ with better alignment
+quality. Although it uses a large number of indexes, the memory
+requirement of HISAT is still modest, approximately 4.3 GB for human.
+HISAT uses the `Bowtie2 <http://bowtie-bio.sf.net/bowtie2>`__
+implementation to handle most of the operations on the FM index. In
+addition to spliced alignment, HISAT handles reads involving indels and
+supports a paired-end alignment mode. Multiple processors can be used
+simultaneously to achieve greater alignment speed. HISAT outputs
+alignments in `SAM <http://samtools.sourceforge.net/SAM1.pdf>`__ format,
+enabling interoperation with a large number of other tools (e.g.
+`SAMtools <http://samtools.sourceforge.net>`__,
+`GATK <http://www.broadinstitute.org/gsa/wiki/index.php/The_Genome_Analysis_Toolkit>`__)
+that use SAM. HISAT is distributed under the `GPLv3
+license <http://www.gnu.org/licenses/gpl-3.0.html>`__, and it runs on
+the command line under Linux, Mac OS X and Windows.
+
+Running HISAT
+=============
+
+Reporting
+---------
+
+The reporting mode governs how many alignments HISAT looks for, and how
+to report them.
+
+In general, when we say that a read has an alignment, we mean that it
+has a `valid
+alignment <#valid-alignments-meet-or-exceed-the-minimum-score-threshold>`__.
+When we say that a read has multiple alignments, we mean that it has
+multiple alignments that are valid and distinct from one another.
+
+Distinct alignments map a read to different places
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Two alignments for the same individual read are "distinct" if they map
+the same read to different places. Specifically, we say that two
+alignments are distinct if there are no alignment positions where a
+particular read offset is aligned opposite a particular reference offset
+in both alignments with the same orientation. E.g. if the first
+alignment is in the forward orientation and aligns the read character at
+read offset 10 to the reference character at chromosome 3, offset
+3,445,245, and the second alignment is also in the forward orientation
+and also aligns the read character at read offset 10 to the reference
+character at chromosome 3, offset 3,445,245, they are not distinct
+alignments.
+
+Two alignments for the same pair are distinct if either the mate 1s in
+the two paired-end alignments are distinct or the mate 2s in the two
+alignments are distinct or both.
+
+Default mode: search for one or more alignments, report each
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+HISAT searches for up to N distinct, primary alignments for each read,
+where N equals the integer specified with the ``-k`` parameter. Primary
+alignments mean alignments whose alignment score is equal or higher than
+any other alignments. It is possible that multiple distinct alignments
+whave the same score. That is, if ``-k 2`` is specified, HISAT will
+search for at most 2 distinct alignments. The alignment score for a
+paired-end alignment equals the sum of the alignment scores of the
+individual mates. Each reported read or pair alignment beyond the first
+has the SAM 'secondary' bit (which equals 256) set in its FLAGS field.
+See the `SAM specification <http://samtools.sourceforge.net/SAM1.pdf>`__
+for details.
+
+HISAT does not "find" alignments in any specific order, so for reads
+that have more than N distinct, valid alignments, HISAT does not
+gaurantee that the N alignments reported are the best possible in terms
+of alignment score. Still, this mode can be effective and fast in
+situations where the user cares more about whether a read aligns (or
+aligns a certain number of times) than where exactly it originated.
+
+Alignment summmary
+------------------
+
+When HISAT finishes running, it prints messages summarizing what
+happened. These messages are printed to the "standard error" ("stderr")
+filehandle. For datasets consisting of unpaired reads, the summary might
+look like this:
+
+::
+
+    20000 reads; of these:
+      20000 (100.00%) were unpaired; of these:
+        1247 (6.24%) aligned 0 times
+        18739 (93.69%) aligned exactly 1 time
+        14 (0.07%) aligned >1 times
+    93.77% overall alignment rate
+
+For datasets consisting of pairs, the summary might look like this:
+
+::
+
+    10000 reads; of these:
+      10000 (100.00%) were paired; of these:
+        650 (6.50%) aligned concordantly 0 times
+        8823 (88.23%) aligned concordantly exactly 1 time
+        527 (5.27%) aligned concordantly >1 times
+        ----
+        650 pairs aligned concordantly 0 times; of these:
+          34 (5.23%) aligned discordantly 1 time
+        ----
+        616 pairs aligned 0 times concordantly or discordantly; of these:
+          1232 mates make up the pairs; of these:
+            660 (53.57%) aligned 0 times
+            571 (46.35%) aligned exactly 1 time
+            1 (0.08%) aligned >1 times
+    96.70% overall alignment rate
+
+The indentation indicates how subtotals relate to totals.
+        ]]></help>
+    <citations>
+        <citation type="doi">10.1038/nmeth.3317</citation>
+    </citations>
+</tool>
\ No newline at end of file