annotate picard_ReorderSam.xml @ 69:b7a87af26eaf draft

Uploaded
author devteam
date Wed, 19 Feb 2014 17:58:16 -0500
parents d7d33c0d98be
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
65
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
1 <tool name="Reorder SAM/BAM" id="picard_ReorderSam" version="1.106.0">
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
2 <!-- taken from Inserthttps://github.com/najoshi/ucd-biocore-galaxy/tree/master/tools/picard -->
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
3 <description>Reorders reads in a SAM/BAM file</description>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
4 <requirements><requirement type="package" version="1.106.0">picard</requirement></requirements>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
5 <command interpreter="python">
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
6 picard_wrapper.py
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
7 --input=$inputFile
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
8 #if $source.indexSource == "built-in"
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
9 --ref="${source.ref.fields.path}"
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
10 #else
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
11 --ref-file=$refFile
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
12 --species-name=$source.speciesName
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
13 --build-name=$source.buildName
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
14 --trunc-names=$source.truncateSeqNames
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
15 #end if
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
16 --allow-inc-dict-concord=$allowIncDictConcord
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
17 --allow-contig-len-discord=$allowContigLenDiscord
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
18 --output-format=$outputFormat
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
19 --output=$outFile
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
20 --tmpdir "${__new_file_path__}"
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
21 -j "\$JAVA_JAR_PATH/ReorderSam.jar"
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
22 </command>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
23 <inputs>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
24 <param format="bam,sam" name="inputFile" type="data" label="SAM/BAM dataset to be reordered"
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
25 help="If empty, upload or import a SAM/BAM dataset." />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
26 <conditional name="source">
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
27 <param name="indexSource" type="select" label="Select Reference Genome" help="This tool will re-order SAM/BAM in the same order as reference selected below.">
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
28 <option value="built-in">Locally cached</option>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
29 <option value="history">History</option>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
30 </param>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
31 <when value="built-in">
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
32 <param name="ref" type="select" label="Select a reference genome">
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
33 <options from_data_table="picard_indexes" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
34 </param>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
35 </when>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
36 <when value="history">
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
37 <param name="refFile" type="data" format="fasta" metadata_name="dbkey" label="Using reference file" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
38 <param name="speciesName" type="text" value="" label="Species name" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
39 <param name="buildName" type="text" value="" label="Build name" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
40 <param name="truncateSeqNames" type="boolean" checked="False" truevalue="true" falsevalue="false" label="Truncate sequence names after first whitespace" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
41 </when>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
42 </conditional>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
43 <param name="allowIncDictConcord" type="boolean" checked="False" truevalue="true" falsevalue="false" label="Allow incomplete dict concordance?" help="Allows a partial overlap of the BAM contigs with the new reference sequence contigs." />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
44 <param name="allowContigLenDiscord" type="boolean" checked="False" truevalue="true" falsevalue="false" label="Allow contig length discordance?" help="This is dangerous--don't check it unless you know exactly what you're doing!" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
45 <param name="outputFormat" type="boolean" checked="True" truevalue="bam" falsevalue="sam" label="Output BAM instead of SAM" help="Uncheck for SAM output" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
46 </inputs>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
47 <outputs>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
48 <data name="outFile" format="bam" label="${tool.name} on ${on_string}: reordered ${outputFormat}">
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
49 <change_format>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
50 <when input="outputFormat" value="sam" format="sam" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
51 </change_format>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
52 </data>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
53 </outputs>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
54 <tests>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
55 <test>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
56 <!-- Commands:
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
57 cp test-data/phiX.fasta .
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
58 samtools faidx phiX.fasta
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
59 java -jar CreateSequenceDictionary.jar R=phiX.fasta O=phiX.dict URI=phiX.fasta TRUNCATE_NAMES_AT_WHITESPACE=false SPECIES=phiX174
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
60 java -jar ReorderSam.jar VALIDATION_STRINGENCY=LENIENT I=test-data/picard_RS_input1.bam O=picard_RS_output1.bam REFERENCE=phiX.fasta ALLOW_INCOMPLETE_DICT_CONCORDANCE=false ALLOW_CONTIG_LENGTH_DISCORDANCE=false
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
61 -->
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
62 <param name="inputFile" value="picard_RS_input1.bam" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
63 <param name="indexSource" value="history" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
64 <param name="refFile" value="phiX.fasta" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
65 <param name="speciesName" value="phiX174" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
66 <param name="buildName" value="" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
67 <param name="truncateSeqNames" value="false" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
68 <param name="allowIncDictConcord" value="false" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
69 <param name="allowContigLenDiscord" value="false" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
70 <param name="outputFormat" value="True" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
71 <output name="outFile" file="picard_RS_output1.bam" ftype="bam" lines_diff="4" compare="contains" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
72 </test>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
73 <test>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
74 <!-- Command:
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
75 java -jar ReorderSam.jar VALIDATION_STRINGENCY=LENIENT I=test-data/picard_RS_input2.sam O=picard_RS_output2.sam REFERENCE=/path/to/phiX/picard_index/phiX.fa ALLOW_INCOMPLETE_DICT_CONCORDANCE=false ALLOW_CONTIG_LENGTH_DISCORDANCE=false
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
76 /path/to/phiX/srma_index/phiX.fa is path to phiX.fa, phiX.fa.fai, and phiX.dict
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
77 -->
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
78 <param name="inputFile" value="picard_RS_input2.sam" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
79 <param name="indexSource" value="built-in" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
80 <param name="ref" value="phiX" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
81 <param name="allowIncDictConcord" value="false" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
82 <param name="allowContigLenDiscord" value="false" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
83 <param name="outputFormat" value="False" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
84 <output name="outFile" file="picard_RS_output2.sam" ftype="sam" lines_diff="4" sort="True" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
85 </test>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
86 <test>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
87 <!-- Commands:
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
88 cp test-data/picard_RS_input4.fasta .
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
89 samtools faidx picard_RS_input4.fasta
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
90 java -jar CreateSequenceDictionary.jar R=picard_RS_input4.fasta O=picard_RS_input4.dict URI=picard_RS_input4.fasta TRUNCATE_NAMES_AT_WHITESPACE=true SPECIES=phiX174 GENOME_ASSEMBLY=phiX_buildBlah1.1
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
91 java -jar ReorderSam.jar VALIDATION_STRINGENCY=LENIENT I=test-data/picard_RS_input3.bam O=picard_RS_output3.sam REFERENCE=picard_RS_input4.fasta ALLOW_INCOMPLETE_DICT_CONCORDANCE=true ALLOW_CONTIG_LENGTH_DISCORDANCE=false
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
92 picard_RS_input3.bam can be made from picard_RS_input3.sam
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
93 -->
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
94 <param name="inputFile" value="picard_RS_input3.bam" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
95 <param name="indexSource" value="history" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
96 <param name="refFile" value="picard_RS_input4.fasta" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
97 <param name="speciesName" value="phiX174" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
98 <param name="buildName" value="phiX_buildBlah1.1" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
99 <param name="truncateSeqNames" value="true" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
100 <param name="allowIncDictConcord" value="true" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
101 <param name="allowContigLenDiscord" value="false" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
102 <param name="outputFormat" value="False" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
103 <output name="outFile" file="picard_RS_output3.sam" ftype="sam" lines_diff="12" sort="True" />
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
104 </test>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
105 </tests>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
106 <help>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
107
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
108 .. class:: infomark
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
109
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
110 **Purpose**
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
111
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
112 Reorder SAM/BAM to match contig ordering in a particular reference file. Note that this is
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
113 not the same as sorting as done by the SortSam tool, which sorts by either coordinate
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
114 values or query name. The ordering in ReorderSam is based on exact name matching of
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
115 contigs/chromosomes. Reads that are mapped to a contig that is not in the new reference file are
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
116 not included in the output.
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
117
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
118 **Picard documentation**
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
119
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
120 This is a Galaxy wrapper for ReorderSam, a part of the external package Picard-tools_.
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
121
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
122 .. _Picard-tools: http://www.google.com/search?q=picard+samtools
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
123
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
124 ------
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
125
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
126 .. class:: infomark
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
127
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
128 **Inputs, outputs, and parameters**
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
129
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
130 For the file that needs to be reordered, either a sam file or a bam file must be supplied.
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
131 If a bam file is used, it must be coordinate-sorted. A reference file is also required,
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
132 so either a fasta file should be supplied or a built-in reference can be selected.
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
133
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
134 The output contains the same reads as the input file but the reads have been rearranged so
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
135 they appear in the same order as the provided reference file. The tool will output either
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
136 bam (the default) or sam, according to user selection. Bam is recommended since it is smaller.
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
137
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
138 The only extra parameters that can be set are flags for allowing incomplete dict concordance
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
139 and allowing contig length discordance. If incomplete dict concordance is allowed, only a
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
140 partial overlap of the bam contigs with the new reference sequence contigs is required. By
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
141 default it is off, requiring a corresponding contig in the new reference for each read contig.
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
142 If contig length discordance is allowed, contig names that are the same between a read and the
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
143 new reference contig are allowed even if they have different lengths. This is usually not a
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
144 good idea, unless you know exactly what you're doing. It's off by default.
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
145
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
146 .. class:: warningmark
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
147
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
148 **Warning on SAM/BAM quality**
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
149
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
150 Many SAM/BAM files produced externally and uploaded to Galaxy do not fully conform to SAM/BAM specifications. Galaxy deals with this by using the **LENIENT**
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
151 flag when it runs Picard, which allows reads to be discarded if they're empty or don't map. This appears
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
152 to be the only way to deal with SAM/BAM that cannot be parsed.
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
153
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
154
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
155 </help>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
156 </tool>
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
157
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
158
d7d33c0d98be Uploaded
devteam
parents:
diff changeset
159