annotate tools/picard/picard_ReorderSam.xml @ 1:cdcb0ce84a1b

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