annotate picard_ReorderSam.xml @ 46:7f39041ec022 draft

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