Repository 'samtools_bam_to_cram'
hg clone https://toolshed.g2.bx.psu.edu/repos/iuc/samtools_bam_to_cram

Changeset 2:3e15f2544a5c (2019-07-29)
Previous changeset 1:4190f6830fe0 (2018-10-14) Next changeset 3:3d07b8a6dd8c (2019-10-17)
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/bam_to_cram commit ca0d1d44099fd21e0f8214102f4d8a2fd2d054d6
modified:
samtools_bam_to_cram.xml
test-data/test.cram
removed:
test-data/cached_locally/chr_m.fasta
test-data/cached_locally/chr_m.fasta.fai
test-data/cached_locally/fasta_indexes.loc
b
diff -r 4190f6830fe0 -r 3e15f2544a5c samtools_bam_to_cram.xml
--- a/samtools_bam_to_cram.xml Sun Oct 14 12:00:54 2018 -0400
+++ b/samtools_bam_to_cram.xml Mon Jul 29 08:46:31 2019 -0400
[
@@ -9,33 +9,23 @@
     <expand macro="version_command"/>
 
     <command><![CDATA[
-        #if str( $input_alignment.metadata.bam_index ) != "None":
-            ln
-                -f
-                -s
-                '${input_alignment.metadata.bam_index}'
-                '${input_alignment}.bai'
-                &&
-        #end if
-
-        #if $reference_source.reference_source_selector == 'history':
-            #set ref_fa = 'ref.fa'
-            ln -s '${reference_source.input_reference}' ref.fa &&
-        #else:
-            #set ref_fa = str( $reference_source.input_reference.fields.path )
-        #end if
+        @ADDTHREADS@
+        @PREPARE_FASTA_IDX@
+        @PREPARE_IDX@
 
         samtools view
             #if $parameter_regions.target_region == "regions_bed_file"
                 -L '${parameter_regions.regions_bed_file}'
             #end if
 
-            -@\${GALAXY_SLOTS:-1}
-            -C
-            -T '$ref_fa'
+            -@ \$addthreads
+     -C
+     -h 
             -o '${output_alignment}'
-
-            '${input_alignment}'
+            -T '$reffa'
+            -t '$reffai'
+            --output-fmt-option no_ref
+            infile
 
             #if $parameter_regions.target_region == "region"
                 '${parameter_regions.region_string}'
@@ -43,22 +33,22 @@
     ]]></command>
 
     <inputs>
-        <param name="input_alignment" type="data" format="bam,sam" label="BAM (or SAM) alignment file"/>
-        <conditional name="reference_source">
-            <param name="reference_source_selector" type="select" label="Load reference genome from">
+        <param name="input" type="data" format="bam,sam" label="BAM (or SAM) alignment file"/>
+        <conditional name="addref_cond">
+            <param name="addref_select" type="select" label="Load reference genome from">
                 <option value="cached">Local cache</option>
                 <option value="history">History</option>
             </param>
             <when value="cached">
-                <param name="input_reference" type="select" label="Reference genome">
+                <param name="ref" type="select" label="Reference genome">
                     <options from_data_table="fasta_indexes">
-                        <filter type="data_meta" ref="input_alignment" key="dbkey" column="1" />
+                        <filter type="data_meta" ref="input" key="dbkey" column="1" />
                     </options>
                     <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/>
                 </param>
             </when>
             <when value="history">
-                <param name="input_reference" type="data" format="fasta" label="Reference FASTA file"/>
+                <param name="ref" type="data" format="fasta" label="Reference FASTA file"/>
             </when>
         </conditional>
         <conditional name="parameter_regions">
@@ -84,43 +74,43 @@
 
     <tests>
         <test>
-            <param name="input_alignment" value="test.bam" ftype="bam" />
-            <param name="reference_source_selector" value="history" />
-            <param name="input_reference" value="test.fa" />
+            <param name="input" value="test.bam" ftype="bam" />
+            <param name="addref_select" value="history" />
+            <param name="ref" value="test.fa" />
             <param name="target_region" value="entire_input_file" />
 
             <output name="output_alignment" file="test.cram" compare="sim_size" delta="250" />
         </test>
         <test>
-            <param name="input_alignment" value="test.sam" ftype="sam" />
-            <param name="reference_source_selector" value="history" />
-            <param name="input_reference" value="test.fa" />
+            <param name="input" value="test.sam" ftype="sam" />
+            <param name="addref_select" value="history" />
+            <param name="ref" value="test.fa" />
             <param name="target_region" value="entire_input_file" />
 
             <output name="output_alignment" file="test.cram" compare="sim_size" delta="250" />
         </test>
         <test>
-            <param name="input_alignment" value="test.bam" ftype="bam" />
-            <param name="reference_source_selector" value="history" />
-            <param name="input_reference" value="test.fa" />
+            <param name="input" value="test.bam" ftype="bam" />
+            <param name="addref_select" value="history" />
+            <param name="ref" value="test.fa" />
             <param name="target_region" value="region" />
             <param name="region_string" value="CHROMOSOME_I" />
 
             <output name="output_alignment" file="test.cram" compare="sim_size" delta="250" />
         </test>
         <test>
-            <param name="input_alignment" value="test.bam" ftype="bam" />
-            <param name="reference_source_selector" value="history" />
-            <param name="input_reference" value="test.fa" />
+            <param name="input" value="test.bam" ftype="bam" />
+            <param name="addref_select" value="history" />
+            <param name="ref" value="test.fa" />
             <param name="target_region" value="regions_bed_file" />
             <param name="regions_bed_file" value="test.bed" ftype="bed" />
 
             <output name="output_alignment" file="test.cram" compare="sim_size" delta="250" />
         </test>
         <test>
-            <param name="input_alignment" ftype="bam" dbkey="equCab2" value="sam_to_bam_out2.bam" />
-            <param name="reference_source_selector" value="cached" />
-            <param name="input_reference" value="equCab2chrM" />
+            <param name="input" ftype="bam" dbkey="equCab2" value="sam_to_bam_out2.bam" />
+            <param name="addref_select" value="cached" />
+            <param name="ref" value="equCab2chrM" />
             <param name="target_region" value="entire_input_file" />
             <output name="output_alignment" file="test2.cram" compare="sim_size" delta="250" />
         </test>
b
diff -r 4190f6830fe0 -r 3e15f2544a5c test-data/cached_locally/chr_m.fasta
--- a/test-data/cached_locally/chr_m.fasta Sun Oct 14 12:00:54 2018 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
b'@@ -1,335 +0,0 @@\n->chrM\n-GTTAATGTAGCTTAATAATATAAAGCAAGGCACTGAAAATGCCTAGATGA\n-GTATTCTTACTCCATAAACACATAGGCTTGGTCCTAGCCTTTTTATTAGT\n-TATTAATAGAATTACACATGCAAGTATCCGCACCCCAGTGAGAATGCCCT\n-CTAAATCACGTCTCTACGATTAAAAGGAGCAGGTATCAAGCACACTAGAA\n-AGTAGCTCATAACACCTTGCTCAGCCACACCCCCACGGGACACAGCAGTG\n-ATAAAAATTAAGCTATGAACGAAAGTTCGACTAAGTCATATTAAATAAGG\n-GTTGGTAAATTTCGTGCCAGCCACCGCGGTCATACGATTAACCCAAATTA\n-ATAAATCTCCGGCGTAAAGCGTGTCAAAGACTAATACCAAAATAAAGTTA\n-AAACCCAGTTAAGCCGTAAAAAGCTACAACCAAAGTAAAATAGACTACGA\n-AAGTGACTTTAATACCTCTGACTACACGATAGCTAAGACCCAAACTGGGA\n-TTAGATACCCCACTATGCTTAGCCCTAAACTAAAATAGCTTACCACAACA\n-AAGCTATTCGCCAGAGTACTACTAGCAACAGCCTAAAACTCAAAGGACTT\n-GGCGGTGCTTTACATCCCTCTAGAGGAGCCTGTTCCATAATCGATAAACC\n-CCGATAAACCCCACCATCCCTTGCTAATTCAGCCTATATACCGCCATCTT\n-CAGCAAACCCTAAACAAGGTACCGAAGTAAGCACAAATATCCAACATAAA\n-AACGTTAGGTCAAGGTGTAGCCCATGGGATGGAGAGAAATGGGCTACATT\n-TTCTACCCTAAGAACAAGAACTTTAACCCGGACGAAAGTCTCCATGAAAC\n-TGGAGACTAAAGGAGGATTTAGCAGTAAATTAAGAATAGAGAGCTTAATT\n-GAATCAGGCCATGAAGCGCGCACACACCGCCCGTCACCCTCCTTAAATAT\n-CACAAATCATAACATAACATAAAACCGTGACCCAAACATATGAAAGGAGA\n-CAAGTCGTAACAAGGTAAGTATACCGGAAGGTGTACTTGGATAACCAAAG\n-TGTAGCTTAAACAAAGCATCCAGCTTACACCTAGAAGATTTCACTCAAAA\n-TGAACACTTTGAACTAAAGCTAGCCCAAACAATACCTAATTCAATTACCC\n-TTAGTCACTTAACTAAAACATTCACCAAACCATTAAAGTATAGGAGATAG\n-AAATTTTAACTTGGCGCTATAGAGAAAGTACCGTAAGGGAACGATGAAAG\n-ATGCATTAAAAGTACTAAACAGCAAAGCTTACCCCTTTTACCTTTTGCAT\n-AATGATTTAACTAGAATAAACTTAGCAAAGAGAACTTAAGCTAAGCACCC\n-CGAAACCAGACGAGCTACCTATGAACAGTTACAAATGAACCAACTCATCT\n-ATGTCGCAAAATAGTGAGAAGATTCGTAGGTAGAGGTGAAAAGCCCAACG\n-AGCCTGGTGATAGCTGGTTGTCCAGAAACAGAATTTCAGTTCAAATTTAA\n-ATTTACCTAAAAACTACTCAATTCTAATGTAAATTTAAATTATAGTCTAA\n-AAAGGTACAGCTTTTTAGATACAGGTTACAACCTTCATTAGAGAGTAAGA\n-ACAAGATAAACCCATAGTTGGCTTAAAAGCAGCCATCAATTAAGAAAGCG\n-TTCAAGCTCAACGACACATCTATCTTAATCCCAACAATCAACCCAAACTA\n-ACTCCTAATCTCATACTGGACTATTCTATCAACACATAGAAGCAATAATG\n-TTAATATGAGTAACAAGAATTATTTCTCCTTGCATAAGCTTATATCAGAA\n-CGAATACTCACTGATAGTTAACAACAAGATAGGGATAATCCAAAAACTAA\n-TCATCTATTTAAACCATTGTTAACCCAACACAGGCATGCATCTATAAGGA\n-AAGATTAAAAGAAGTAAAAGGAACTCGGCAAACACAAACCCCGCCTGTTT\n-ACCAAAAACATCACCTCTAGCATTTCCAGTATTAGAGGCACTGCCTGCCC\n-AGTGACATCTGTTtaaacggccgcggtatcctaaccgtgcaaaggtagca\n-taatcacttgttccctaaatagggacttgtatgaatggccacacgagggt\n-tttactgtctcttacttccaatcagtgaaattgaccttcccgtgaagagg\n-cgggaatgactaaataagacgagaagaccctatggagcttTAATTAACTG\n-ATTCACAAAAAACAACACACAAACCTTAACCTTCAGGGACAACAAAACTT\n-TTGATTGAATCAGCAATTTCGGTTGGGGTGACCTCGGAGAACAAAACAAC\n-CTCCGAGTGATTTAAATCCAGACTAACCAGTCAAAATATATAATCACTTA\n-TTGATCCAAACCATTGATCAACGGAACAAGTTACCCTAGGGATAACAGCG\n-CAATCCTATTCCAGAGTCCATATCGACAATTAGGGTTTACGACCTCGATG\n-TTGGATCAAGACATCCTAATGGTGCAACCGCTATTAAGGGTTCGTTTGTT\n-CAACGATTAAAGTCTTACGTGATCTGAGTTCAGACCGGAGTAATCCAGGT\n-CGGTTTCTATCTATTCTATACTTTTCCCAGTACGAAAGGACAAGAAAAGT\n-AGGGCCCACTTTACAAGAAGCGCCCTCAAACTAATAGATGACATAATCTA\n-AATCTAACTAATTTATAACTTCTACCGCCCTAGAACAGGGCTCgttaggg\n-tggcagagcccggaaattgcataaaacttaaacctttacactcagaggtt\n-caactcctctccctaacaacaTGTTCATAATTAACGTCCTCCTCCTAATT\n-GTCCCAATCTTGCTCGCCGTAGCATTCCTCACACTAGTTGAACGAAAAGT\n-CTTAGGCTATATGCAACTTCGCAAAGGACCCAACATCGTAGGCCCCTATG\n-GCCTACTACAACCTATTGCCGATGCCCTCAAACTATTTATCAAAGAGCCA\n-CTACAACCACTAACATCATCGACATCCATATTCATCATCGCACCAATCCT\n-AGCCCTAACCCTGGCCTTAACCATATGAATCCCTCTGCCCATACCATACC\n-CACTAATCAACATAAACCTAGGAATTCTATTCATACTAGCCATGTCCAGC\n-CTAGCTGTCTACTCAATCCTTTGATCAGGATGGGCCTCAAACTCAAAATA\n-CGCCCTAATTGGAGCTCTACGAGCAGTAGCACAAACCATCTCATACGAAG\n-TAACTCTAGCAATCATCCTACTCTCAGTCCTCCTAATAAGCGGATCATTC\n-ACATTATCAACACTTATTATTACCCAAGAATACCTCTGATTAATCTTCCC\n-ATCATGACCCTTAGCCATAATGTGATTCATCTCAACATTAGCCGAAACCA\n-ACCGAGCTCCATTTGACCTAACAGAAGGAGAATCAGAACTCGTCTCTGGA\n-TTCAACGTTGAATACGCAGCCGGCCCATTTGCTCTATTCTTCCTAGCAGA\n-ATACGCAAACATCATCATGATAAACATCTTCACAACAACCCTATTTCTAG\n-GAGCATTTCACAACCCCTACCTGCCAGAACTCTACTCAATTAATTTCACC\n-ATTAAAGCTCTCCTTCTAACATGTTCCTTCCTATGAATCCGAGCATCCTA\n-CCCACGATTCCGATATGACCAACTTATACACCTCCTATGAAAGAACTTCC\n-TACCACTCACACTAGCCCTCTGCATATGACACGTCTCACTTCCAATCATA\n-CTATCCAGCATCCCACCACAAACATAGGAAATATGTCTGACAAAAGAGTT\n-ACTTTGATAGAGTAAAACATAGAGGCTCAAACCCTCTTATTTctagaact\n-acaggaattgaacctgctcct'..b'CATTATCCACAGCCTAAATGACGAGCAAGATATC\n-CGAAAAATAGGCGGACTATTTAATGCAATACCCTTCACCACCACATCTCT\n-AATTATTGGCAGCCTTGCACTCACCGGAATTCCTTTCCTCACAGGCTTCT\n-ACTCCAAAGACCTCATCATCGAAACCGCCAACACATCGTACACCAACGCC\n-TGAGCCCTACTAATAACTCTCATTGCCACATCCCTCACAGCTGTCTACAG\n-TACCCGAATCATCTTCTTTGCACTCCTAGGGCAACCCCGCTTCCTCCCTC\n-TGACCTCAATCAACGAAAATAACCCCTTTCTAATTAACTCCATCAAACGC\n-CTCTTAATTGGCAGCATTTTTGCCGGATTCTTCATCTCCAACAATATCTA\n-CCCCACAACCGTCCCAGAAATAACCATACCTACTTACATAAAACTCACCG\n-CCCTCGCAGTAACCATCCTAGGATTTACACTAGCCCTAGAACTAAGCTTG\n-ATAACCCATAACTTAAAACTAGAACACTCCACCAACGTATTCAAATTCTC\n-CAACCTCCTAGGATACTACCCAACAATTATACACCGACTCCCACCGCTCG\n-CTAACCTATCAATAAGCCAAAAATCAGCATCACTTCTACTAGACTCAATC\n-TGACTAGAAAACATCCTGCCAAAATCTATCTCCCAGTTCCAAATAAAAAC\n-CTCGATCCTAATTTCCACCCAAAAAGGACAAATCAAATTATATTTCCTCT\n-CATTCCTCATCACCCTTACCCTAAGCATACTACTTTTTAATCTCCACGAG\n-TAACCTCTAAAATTACCAAGACCCCAACAAGCAACGATCAACCAGTCACA\n-ATCACAACCCAAGCCCCATAACTATACAATGCAGCAGCCCCTATAATTTC\n-CTCACTAAACGCCCCAGAATCTCCAGTATCATAAATAGCTCAAGCCCCCA\n-CACCACTAAACTTAAACACTACCCCCACTTCCTCACTCTTCAGAACATAT\n-AAAACCAACATAACCTCCATCAACAACCCTAAAAGAAATACCCCCATAAC\n-AGTCGTATTAGACACCCATACCTCAGGATACTGCTCAGTAGCCATAGCCG\n-TTGTATAACCAAAAACAACCAACATTCCTCCCAAATAAATCAAAAACACC\n-ATCAACCCCAAAAAGGACCCTCCAAAATTCATAATAATACCACAACCTAC\n-CCCTCCACTTACAATCAGCACTAAACCCCCATAAATAGGTGAAGGTTTTG\n-AAGAAAACCCCACAAAACTAACAACAAAAATAACACTCAAAATAAACACA\n-ATATATGTCATCATTATTCCCACGTGGAATCTAACCACGACCAATGACAT\n-GAAAAATCATCGTTGTATTTCAACTATAAGAACACCAATGACAAACATCC\n-GGAAATCTCACCCACTAATTAAAATCATCAATCACTCTTTTATTGACCTA\n-CCAGCCCCCTCAAACATTTCATCATGATGAAACTTCGGCTCCCTCCTAGG\n-AATCTGCCTAATCCTCCAAATCTTAACAGGCCTATTCCTAGCCATACACT\n-ACACATCAGACACGACAACTGCCTTCTCATCCGTCACTCACATCTGCCGA\n-GACGTTAACTACGGATGAATTATTCGCTACCTCCATGCCAACGGAGCATC\n-AATATTTTTTATCTGCCTCTTCATTCACGTAGGACGCGGCCTCTACTACG\n-GCTCTTACACATTCCTAGAGACATGAAACATTGGAATCATCCTACTTTTC\n-ACAGTTATAGCTACAGCATTCATGGGCTATGTCCTACCATGAGGCCAAAT\n-ATCCTTTTGAGGAGCAACAGTCATCACGAACCTCCTATCAGCAATTCCCT\n-ACATCGGTACTACCCTCGTCGAGTGAATCTGAGGTGGATTCTCAGTAGAC\n-AAAGCCACCCTTACCCGATTTTTTGCTTTCCACTTCATCCTACCCTTCAT\n-CATCACAGCCCTGGTAGTCGTACATTTACTATTTCTTCACGAAACAGGAT\n-CTAATAACCCCTCAGGAATCCCATCCGATATGGACAAAATCCCATTCCAC\n-CCATATTATACAATTAAAGACATCCTAGGACTCCTCCTCCTGATCTTGCT\n-CCTACTAACTCTAGTATTATTCTCCCCCGACCTCCTAGGAGACCCAGACA\n-ACTACACCCCAGCTAACCCTCTCAGCACTCCCCCTCATATTAAACCAGAA\n-TGGTACTTCCTGTTTGCCTACGCCATCCTACGCTCCATTCCCAACAAACT\n-AGGCGGCGTATTAGCCCTAATCCTCTCCATCCTGATCCTAGCACTCATCC\n-CCACCCTCCACATATCAAAACAACGAAGCATAATATTCCGGCCTCTCAGC\n-CAATGCGTATTCTGACTCTTAGTGGCAGACTTACTGACACTAACATGAAT\n-CGGCGGACAGCCAGTGGAACACCCATACGTAATTATCGGCCAACTGGCCT\n-CAATCCTCTACTTCTCCCTAATTCTCATTTTTATACCACTCGCAAGCACC\n-ATCGAAAACAATCTTCTAAAATGAAGAGTCCCTGTAGTATATCGCACATT\n-ACCCTGGTCTTGTAAACCAGAAAAGGGGGAAAACGTTTCCTCCCAAGGAC\n-TATCAAGGAAGAAGCTCTAGCTCCACCATCAACACCCAAAGCTGAAATTC\n-TACTTAAACTATTCCTTGATTTCTTCCCCTAAACGACAACAATTTACCCT\n-CATGTGCTATGTCAGTATCAGATTATACCCCCACATAACACCATACCCAC\n-CTGACATGCAATATCTTATGAATGGCCTATGTACGTCGTGCATTAAATTG\n-TCTGCCCCATGAATAATAAGCATGTACATAATATCATTTATCTTACATAA\n-GTACATTATATTATTGATCGTGCATACCCCATCCAAGTCAAATCATTTCC\n-AGTCAACACGCATATCACAGCCCATGTTCCACGAGCTTAATCACCAAGCC\n-GCGGGAAATCAGCAACCCTCCCAACTACGTGTCCCAATCCTCGCTCCGGG\n-CCCATCCAAACGTGGGGGTTTCTACAATGAAACTATACCTGGCATCTGGT\n-TCTTTCTTCAGGGCCATTCCCACCCAACCTCGCCCATTCTTTCCCCTTAA\n-ATAAGACATCTCGATGGACTAATGACTAATCAGCCCATGCTCACACATAA\n-CTGTGATTTCATGCATTTGGTATCTTTTTATATTTGGGGATGCTATGACT\n-CAGCTATGGCCGTCAAAGGCCTCGACGCAGTCAATTAAATTGAAGCTGGA\n-CTTAAATTGAACGTTATTCCTCCGCATCAGCAACCATAAGGTGTTATTCA\n-GTCCATGGTAGCGGGACATAGGAAACAAgtgcacctgtgcacctgtgcac\n-ctgtgcacctgtgcacctgtgcacctgtgcacctgtgcacctgtgcacct\n-gtgcacctgtgcacctgtgcacctgtgcacctgtgcacctgtgcacctgt\n-gcacctgtgcacctgtgcacctgtgcacctgtgcacctgtgcacctgtgc\n-acctgtgcacctgtgcacctgtgcacctgtgcacctgtgcacctgtgcac\n-ctgtgcacctACCCGCGCAGTAAGCAAGTAATATAGCTTTCTTAATCAAA\n-CCCCCCCTACCCCCCATTAAACTCCACATATGTACATTCAACACAATCTT\n-GCCAAACCCCAAAAACAAGACTAAACAATGCACAATACTTCATGAAGCTT\n-AACCCTCGCATGCCAACCATAATAACTCAACACACCTAACAATCTTAACA\n-GAACTTTCCCCCCGCCATTAATACCAACATGCTACTTTAATCAATAAAAT\n-TTCCATAGACAGGCATCCCCCTAGATCTAATTTTCTAAATCTGTCAACCC\n-TTCTTCCCCC\n'
b
diff -r 4190f6830fe0 -r 3e15f2544a5c test-data/cached_locally/chr_m.fasta.fai
--- a/test-data/cached_locally/chr_m.fasta.fai Sun Oct 14 12:00:54 2018 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,1 +0,0 @@
-chrM 16660 6 50 51
b
diff -r 4190f6830fe0 -r 3e15f2544a5c test-data/cached_locally/fasta_indexes.loc
--- a/test-data/cached_locally/fasta_indexes.loc Sun Oct 14 12:00:54 2018 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,1 +0,0 @@
-equCab2chrM equCab2 Horse (Equus caballus): equCab2 chrM ${__HERE__}/chr_m.fasta
b
diff -r 4190f6830fe0 -r 3e15f2544a5c test-data/test.cram
b
Binary file test-data/test.cram has changed