Repository 'bam_to_sam'
hg clone https://toolshed.g2.bx.psu.edu/repos/devteam/bam_to_sam

Changeset 4:af7c50162f0b (2015-04-21)
Previous changeset 3:c1419fa820c6 (2015-03-18) Next changeset 5:f57df915aa10 (2017-05-09)
Commit message:
Uploaded
modified:
bam_to_sam.xml
macros.xml
test-data/bam_to_sam_out1.sam
test-data/bam_to_sam_out2.sam
test-data/bam_to_sam_out3.sam
b
diff -r c1419fa820c6 -r af7c50162f0b bam_to_sam.xml
--- a/bam_to_sam.xml Wed Mar 18 15:44:51 2015 -0400
+++ b/bam_to_sam.xml Tue Apr 21 14:36:15 2015 -0400
[
@@ -1,20 +1,23 @@
-<tool id="bam_to_sam" name="BAM-to-SAM" version="1.0.6">
+<tool id="bam_to_sam" name="BAM-to-SAM" version="2.0">
   <macros>
     <import>macros.xml</import>
   </macros>
   <expand macro="requirements"></expand>
   <expand macro="version_command"></expand>
   <expand macro="stdio"></expand>
-  <description>converts BAM format to SAM format</description>  
+  <description>convert BAM to SAM</description>  
     <command>
 <![CDATA[
-  samtools sort -O bam -@ \${GALAXY_SLOTS:-1} "$input1" -o sorted_input.bam -T temp && 
-  samtools view sorted_input.bam $header -o $output1 -@ \${GALAXY_SLOTS:-1}
+  samtools view -o "${output1}" ${header} "${input1}"
 ]]>
     </command>
     <inputs>
         <param format="bam" label="BAM File to Convert" name="input1" type="data" />
-        <param checked="False" falsevalue="" label="Include header in output" name="header" truevalue="-h" type="boolean" />
+        <param name="header" label="Header options" type="select" help="Allows to choose between seeing the entire dataset with the header, header only, or data only.">
+          <option value="-h">Include header in SAM output (-h)</option>
+          <option value="-H">Print header only (-H)</option>
+          <option value="">Exclude header</option>
+        </param>
     </inputs>
     <outputs>
         <data format="sam" label="${tool.name} on ${on_string}: converted SAM" name="output1" />
@@ -22,17 +25,17 @@
     <tests>
         <test>
             <param ftype="bam" name="input1" value="bam_to_sam_in1.bam" />
-            <param name="header" value="" />
+            <param name="header" value="-h" />
             <output file="bam_to_sam_out1.sam" name="output1" sorted="True" />
         </test>
         <test>
-            <param ftype="bam" name="input1" value="bam_to_sam_in2.bam" />
-            <param name="header" value="" />
+            <param ftype="bam" name="input1" value="bam_to_sam_in1.bam" />
+            <param name="header" value="-H" />
             <output file="bam_to_sam_out2.sam" name="output1" sorted="True" />
         </test>
         <test>
             <param ftype="bam" name="input1" value="bam_to_sam_in1.bam" />
-            <param name="header" value="True" />
+            <param name="header" value="" />
             <output file="bam_to_sam_out3.sam" name="output1" sorted="True" />
         </test>
     </tests>
@@ -41,9 +44,10 @@
 
 **What it does**
 
-This tool uses the SAMTools_ toolkit to produce a SAM file from a BAM file.
+Converts BAM dataset to SAM using ``samtools view`` command::
 
-.. _SAMTools: http://samtools.sourceforge.net/samtools.shtml
+ samtools view -o [OUTPUT SAM] [-h|-H] [INPUT BAM] 
+
 ]]>
   </help>
   <expand macro="citations"></expand>
b
diff -r c1419fa820c6 -r af7c50162f0b macros.xml
--- a/macros.xml Wed Mar 18 15:44:51 2015 -0400
+++ b/macros.xml Tue Apr 21 14:36:15 2015 -0400
b
@@ -7,7 +7,37 @@
     </xml>
     <xml name="citations">
         <citations>
+            <citation type="bibtex">
+                @misc{SAM_def,
+                title={Definition of SAM/BAM format},
+                url = {https://samtools.github.io/hts-specs/SAMv1.pdf},}
+            </citation>
             <citation type="doi">10.1093/bioinformatics/btp352</citation>
+            <citation type="doi">10.1093/bioinformatics/btr076</citation>
+            <citation type="doi">10.1093/bioinformatics/btr509</citation>
+            <citation type="bibtex">
+                @misc{Danecek_et_al,
+                Author={Danecek, P., Schiffels, S., Durbin, R.},
+                title={Multiallelic calling model in bcftools (-m)},
+                url = {http://samtools.github.io/bcftools/call-m.pdf},}
+            </citation>
+            <citation type="bibtex">
+                @misc{Durbin_VCQC,
+                Author={Durbin, R.},
+                title={Segregation based metric for variant call QC},
+                url = {http://samtools.github.io/bcftools/rd-SegBias.pdf},}
+            </citation>
+            <citation type="bibtex">
+                @misc{Li_SamMath,
+                Author={Li, H.},
+                title={Mathematical Notes on SAMtools Algorithms},
+                url = {http://www.broadinstitute.org/gatk/media/docs/Samtools.pdf},}
+            </citation>
+            <citation type="bibtex">
+                @misc{SamTools_github,
+                title={SAMTools GitHub page},
+                url = {https://github.com/samtools/samtools},}
+            </citation>
         </citations>
     </xml>
     <xml name="version_command">
@@ -18,4 +48,23 @@
             <exit_code range="1:" level="fatal" description="Error" />
         </stdio>
     </xml>
+    <token name="@no-chrom-options@">
+-----
+
+.. class:: warningmark
+
+**No options available? How to re-detect metadata**
+
+If you see a &quot;No options available&quot; within the &quot;**Select references (chromosomes and contigs) you would like to restrict bam to**&quot; drop down, you need to re-detect metadata for the dataset you are trying to process. To do this follow these steps:
+
+1. Click on the **pencil** icon adjacent to the dataset in the history
+2. A new menu will appear in the center pane of the interface
+3. Click **Datatype** tab
+4. Set **New Type** to **BAM**
+5. Click **Save**
+
+The medatada will be re-detected and you will be able to see the list of reference sequences in the &quot;**Select references (chromosomes and contigs) you would like to restrict bam to**&quot; drop-down.
+
+    </token>
+
 </macros>
b
diff -r c1419fa820c6 -r af7c50162f0b test-data/bam_to_sam_out1.sam
--- a/test-data/bam_to_sam_out1.sam Wed Mar 18 15:44:51 2015 -0400
+++ b/test-data/bam_to_sam_out1.sam Tue Apr 21 14:36:15 2015 -0400
b
@@ -1,3 +1,9 @@
+@HD VN:1.0 SO:coordinate
+@SQ SN:chr1 LN:101
+@SQ SN:chr7 LN:404
+@SQ SN:chr8 LN:202
+@RG ID:0 SM:Hi,Mom!
+@PG ID:1 PN:Hey! VN:2.0
 both_reads_align_clip_marked 83 chr7 1 255 101M = 302 201 CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN )'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/& RG:Z:0
 both_reads_present_only_first_aligns 89 chr7 1 255 101M * 0 0 CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN )'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/& RG:Z:0
 read_2_too_many_gaps 83 chr7 1 255 101M = 302 201 CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN )'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/& RG:Z:0
b
diff -r c1419fa820c6 -r af7c50162f0b test-data/bam_to_sam_out2.sam
--- a/test-data/bam_to_sam_out2.sam Wed Mar 18 15:44:51 2015 -0400
+++ b/test-data/bam_to_sam_out2.sam Tue Apr 21 14:36:15 2015 -0400
b
@@ -1,18 +1,6 @@
-bar:record:4 77 chr1 1 0 * * 0 0 AAAAAAAAAAAAA 1111111111111 RG:Z:rg1
-bar:record:6 77 chr1 1 0 * * 0 0 AAAAAAAAAAAAA 1111111111111 RG:Z:rg2
-bar:record:1 77 chr1 10 0 * * 0 0 AAAAAAAAAAAAA 1111111111111 RG:Z:rg1
-bar:record:3 77 chr1 10 0 * * 0 0 AAAAAAAAAAAAA 1111111111111 RG:Z:rg2
-bar:record:1 141 chr1 20 0 * * 0 0 CCCCCCCCCCCCC 2222222222222 RG:Z:rg1
-bar:record:7 77 chr1 20 0 * * 0 0 AAAAAAAAAAAAA 1111111111111 RG:Z:rg2
-bar:record:8 77 chr1 30 0 * * 0 0 AAAAAAAAAAAAA 1111111111111 RG:Z:rg2
-bar:record:4 141 chr1 40 0 * * 0 0 CCCCCCCCCCCCC 2222222222222 RG:Z:rg1
-bar:record:5 77 chr1 40 0 * * 0 0 AAAAAAAAAAAAA 1111111111111 RG:Z:rg2
-bar:record:6 141 chr1 50 0 * * 0 0 CCCCCCCCCCCCC 2222222222222 RG:Z:rg2
-bar:record:2 77 chr2 10 0 * * 0 0 AAAAAAAAAAAAA 1111111111111 RG:Z:rg1
-bar:record:2 141 chr2 30 0 * * 0 0 CCCCCCCCCCCCC 2222222222222 RG:Z:rg2
-bar:record:3 141 chr3 20 0 * * 0 0 CCCCCCCCCCCCC 2222222222222 RG:Z:rg1
-bar:record:8 141 chr3 20 0 * * 0 0 CCCCCCCCCCCCC 2222222222222 RG:Z:rg1
-bar:record:5 141 chr3 40 0 * * 0 0 CCCCCCCCCCCCC 2222222222222 RG:Z:rg1
-bar:record:9 77 chr4 10 0 * * 0 0 AAAAAAAAAAAAA 1111111111111 RG:Z:rg1
-bar:record:7 141 chr4 20 0 * * 0 0 CCCCCCCCCCCCC 2222222222222 RG:Z:rg1
-bar:record:9 141 chr4 60 0 * * 0 0 CCCCCCCCCCCCC 2222222222222 RG:Z:rg1
+@HD VN:1.0 SO:coordinate
+@SQ SN:chr1 LN:101
+@SQ SN:chr7 LN:404
+@SQ SN:chr8 LN:202
+@RG ID:0 SM:Hi,Mom!
+@PG ID:1 PN:Hey! VN:2.0
b
diff -r c1419fa820c6 -r af7c50162f0b test-data/bam_to_sam_out3.sam
--- a/test-data/bam_to_sam_out3.sam Wed Mar 18 15:44:51 2015 -0400
+++ b/test-data/bam_to_sam_out3.sam Tue Apr 21 14:36:15 2015 -0400
b
@@ -1,9 +1,3 @@
-@HD VN:1.0 SO:coordinate
-@SQ SN:chr1 LN:101
-@SQ SN:chr7 LN:404
-@SQ SN:chr8 LN:202
-@RG ID:0 SM:Hi,Mom!
-@PG ID:1 PN:Hey! VN:2.0
 both_reads_align_clip_marked 83 chr7 1 255 101M = 302 201 CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN )'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/& RG:Z:0
 both_reads_present_only_first_aligns 89 chr7 1 255 101M * 0 0 CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN )'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/& RG:Z:0
 read_2_too_many_gaps 83 chr7 1 255 101M = 302 201 CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN )'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/& RG:Z:0