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

Changeset 25:bf27106652f3 (2017-02-08)
Previous changeset 24:da6e10dee68b (2016-09-25) Next changeset 26:a028d13cd860 (2017-05-04)
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/freebayes commit 2bfbb5ae6b801e43355fdc3f964a5111fe3fe3a1
modified:
freebayes.xml
leftalign.xml
added:
macros.xml
b
diff -r da6e10dee68b -r bf27106652f3 freebayes.xml
--- a/freebayes.xml Sun Sep 25 09:48:42 2016 -0400
+++ b/freebayes.xml Wed Feb 08 12:45:05 2017 -0500
[
b'@@ -1,7 +1,10 @@\n-<tool id="freebayes" name="FreeBayes" version="1.0.2.29--1">\n-    <description> - bayesian genetic variant detector</description>\n+<tool id="freebayes" name="FreeBayes" version="@DEPENDENCY_VERSION@-2">\n+    <description>bayesian genetic variant detector</description>\n+    <macros>\n+        <import>macros.xml</import>\n+    </macros>\n     <requirements>\n-        <requirement type="package" version="1.0.2.29">freebayes</requirement>\n+        <requirement type="package" version="@DEPENDENCY_VERSION@">freebayes</requirement>\n         <requirement type="package" version="0.1.19">samtools</requirement>\n         <requirement type="package" version="4.1.3">gawk</requirement>\n         <requirement type="package" version="20160622">parallel</requirement>\n@@ -9,32 +12,36 @@\n     <stdio>\n         <exit_code range="1:" />\n     </stdio>\n-    <command>\n-<![CDATA[\n+    <command><![CDATA[\n     ##set up input files\n \n     #set $reference_fasta_filename = "localref.fa"\n \n     #if str( $reference_source.reference_source_selector ) == "history":\n-        ln -s -f "${reference_source.ref_file}" "${reference_fasta_filename}" &&\n-        samtools faidx "${reference_fasta_filename}" 2>&1 || echo "Error running samtools faidx for FreeBayes" >&2 &&\n+        ln -s -f \'${reference_source.ref_file}\' \'${reference_fasta_filename}\' &&\n+        samtools faidx \'${reference_fasta_filename}\' 2>&1 || echo "Error running samtools faidx for FreeBayes" >&2 &&\n     #else:\n         #set $reference_fasta_filename = str( $reference_source.ref_file.fields.path )\n     #end if\n \n     #for $bam_count, $input_bam in enumerate( $reference_source.input_bams ):\n-        ln -s -f "${input_bam}" "b_${bam_count}.bam" &&\n-        ln -s -f "${input_bam.metadata.bam_index}" "b_${bam_count}.bam.bai" &&\n+        ln -s -f \'${input_bam}\' \'b_${bam_count}.bam\' &&\n+        ln -s -f \'${input_bam.metadata.bam_index}\' \'b_${bam_count}.bam.bai\' &&\n     #end for\n \n-    ## Tabixize optional input_varinat_vcf file (for --variant-input option)\n+    ## Tabixize optional input_variant_vcf file (for --variant-input option)\n     #if ( str( $options_type.options_type_selector ) == \'cline\' or str( $options_type.options_type_selector ) == \'full\' ) and str( $options_type.optional_inputs.optional_inputs_selector ) == \'set\' and str( $options_type.optional_inputs.input_variant_type.input_variant_type_selector ) == "provide_vcf":\n-        ln -s -f "${options_type.optional_inputs.input_variant_type.input_variant_vcf}" "input_variant_vcf.vcf.gz" &&\n-        ln -s -f "${Tabixized_input}" "input_variant_vcf.vcf.gz.tbi" &&\n+        ln -s -f \'${options_type.optional_inputs.input_variant_type.input_variant_vcf}\' \'input_variant_vcf.vcf.gz\' &&\n+        ln -s -f \'${Tabixized_input}\' \'input_variant_vcf.vcf.gz.tbi\' &&\n     #end if\n \n     #for $bam_count, $input_bam in enumerate( $reference_source.input_bams ):\n-        samtools view -H b_${bam_count}.bam | grep "^@SQ" | cut -f 2- | awk \'{ gsub("^SN:","",$1); gsub("^LN:","",$2); print $1"\\t0\\t"$2; }\' >> regions_all.bed &&\n+        samtools view -H b_${bam_count}.bam |\n+        grep "^@SQ" |\n+        cut -f 2- |\n+        awk \'{ gsub("^SN:","",$1);\n+        gsub("^LN:","",$2);\n+        print $1"\\t0\\t"$2; }\' >> regions_all.bed &&\n     #end for\n \n     sort -u regions_all.bed > regions_uniq.bed &&\n@@ -50,182 +57,188 @@\n     for i in `cat regions_uniq.bed | awk \'{print $1":"$2".."$3}\'`;\n     do\n \n-    echo "\n+        echo "\n+\n+        ## COMMAND LINE STARTS HERE\n+\n+        freebayes\n \n-    ## COMMAND LINE STARTS HERE\n+        --region \'\\$i\'\n \n-    freebayes\n+        #for $bam_count, $input_bam in enumerate( $reference_source.input_bams ):\n+            --bam \'b_${bam_count}.bam\'\n+        #end for\n+        --fasta-reference \'${reference_fasta_filename}\'\n \n-    --region \'\\$i\'\n+        ## Outputs\n+        --vcf \'./vcf_output/part_\\$i.vcf\'\n \n-    #for $bam_count, $input_bam in enumerate( $reference_source.input_bams ):\n-        --bam \'b_${bam_count}.bam\'\n-    #end fo'..b'                   <!-- do nothing -->\n-                    </when>\n+                    <when value="do_not_set" /><!-- do nothing -->\n                 </conditional>\n             </when>\n-            <when value="simple">\n-                <!-- do nothing -->\n-            </when>\n+            <when value="simple" /><!-- do nothing -->\n             <when value="simple_w_filters">\n                 <!-- add standard-filters to command line -->\n-            <param name="min_coverage" type="integer" value="0" label="Require at least this coverage to process a site" help="-! --min-coverage; default=0  " />\n+                <expand macro="par_min_cov" />\n             </when>\n             <when value="naive">\n                 <!-- do nothing build command line using haplotype-length 0 min-alternate-count 1 min-alternate-fraction 0 pooled-continuous report-monomorphic -->\n             </when>\n             <when value="naive_w_filters">\n                 <!-- do nothing build command line using haplotype-length 0 min-alternate-count 1 min-alternate-fraction 0 pooled-continuous report-monomorphic standard-filters-->\n-                <param name="min_coverage" type="integer" value="0" label="Require at least this coverage to process a site" help="-! --min-coverage; default=0  " />\n+                <expand macro="par_min_cov" />\n             </when>\n         </conditional>\n     </inputs>\n@@ -687,11 +697,11 @@\n \n **Galaxy-specific options**\n \n-Galaxy allows six levels of control over FreeBayes options provided by **Choose parameter selection level** menu option. These are:\n+Galaxy allows five levels of control over FreeBayes options provided by **Choose parameter selection level** menu option. These are:\n \n  1. *Simple diploid calling*: The simples possible FreeBayes application. Equvalent of using FreeBayes with only a BAM input and no other parameter options.\n- 2. *Simple diploid calling with filtering and coverage*: Same as #1 plus two additional options: -0 (standard filters: --min-mapping-quality 30 --min-base-quality 20 --min-supporting-allele-qsum 0 --genotype-varinat-threshold 0) and --min-coverage. \n- 3. *Frequency-based pooled calling*: This is equivalent to using FreeBayes with the following options: --haplotype-length 0 --min-alternate-count 1 --min-alternate-fraction 0 --pooled-continuous --report-monomorphic. This is the best choice for calling varinats in mixtures such as viral, bacterial, or organellar genomes. \n+ 2. *Simple diploid calling with filtering and coverage*: Same as #1 plus two additional options: -0 (standard filters: --min-mapping-quality 30 --min-base-quality 20 --min-supporting-allele-qsum 0 --genotype-varinat-threshold 0) and --min-coverage.\n+ 3. *Frequency-based pooled calling*: This is equivalent to using FreeBayes with the following options: --haplotype-length 0 --min-alternate-count 1 --min-alternate-fraction 0 --pooled-continuous --report-monomorphic. This is the best choice for calling varinats in mixtures such as viral, bacterial, or organellar genomes.\n  4. *Frequency-based pooled calling with filtering and coverage*: Same as #3 but adds -0 and --min-coverage like in #2.\n  5. *Complete list of all options*: Gives you full control by exposing all FreeBayes options as Galaxy widgets.\n \n@@ -945,21 +955,10 @@\n \n ------\n \n-**Citation**\n-\n-For the underlying tool, please cite `Erik Garrison and Gabor Marth. Haplotype-based variant detection from short-read sequencing &lt;http://arxiv.org/abs/1207.3907&gt;`_.\n+**Acknowledgments**\n \n The initial version of the wrapper was produced by Dan Blankenberg and upgraded by Anton Nekrutenko.\n TNG was developed by Bjoern Gruening\n-\n     </help>\n-    <citations>\n-        <citation type="bibtex">@misc{1207.3907,\n-Author = {Erik Garrison},\n-Title = {Haplotype-based variant detection from short-read sequencing},\n-Year = {2012},\n-Eprint = {arXiv:1207.3907},\n-url = {http://arxiv.org/abs/1207.3907},\n-}</citation>\n-    </citations>\n+    <expand macro="citations" />\n </tool>\n'
b
diff -r da6e10dee68b -r bf27106652f3 leftalign.xml
--- a/leftalign.xml Sun Sep 25 09:48:42 2016 -0400
+++ b/leftalign.xml Wed Feb 08 12:45:05 2017 -0500
[
@@ -1,6 +1,9 @@
 <?xml version="1.0"?>
-<tool id="bamleftalign" name="BamLeftAlign" version="1.0.2.29">
+<tool id="bamleftalign" name="BamLeftAlign" version="@DEPENDENCY_VERSION@-1">
     <description> indels in BAM datasets</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
     <requirements>
         <requirement type="package" version="1.0.2.29">freebayes</requirement>
         <requirement type="package" version="0.1.19">samtools</requirement>
@@ -8,48 +11,48 @@
     <stdio>
         <exit_code range="1:" />
     </stdio>
-    <command>
+    <command><![CDATA[
         ##set up input files
         #set $reference_fasta_filename = "localref.fa"
         #if str( $reference_source.reference_source_selector ) == "history":
-            ln -s "${reference_source.ref_file}" "${reference_fasta_filename}" &amp;&amp;
-            samtools faidx "${reference_fasta_filename}" 2&gt;&amp;1 || echo "Error running samtools faidx for leftalign" &gt;&amp;2 &amp;&amp;
+            ln -s '${reference_source.ref_file}' '${reference_fasta_filename}' &&
+            samtools faidx "${reference_fasta_filename}" 2>&1 || echo "Error running samtools faidx for leftalign" >&2 &&
         #else:
             #set $reference_fasta_filename = str( $reference_source.ref_file.fields.path )
         #end if
 
-        ##finished setting up inputs
-        
         ##start leftalign commandline
-        samtools view -bh "${input_bam}" | bamleftalign
-        --fasta-reference "${reference_fasta_filename}"
-        -c
-        --max-iterations "${iterations}"
-        ##outputs
-        > "${output_bam}"
-    </command>
+        cat '${input_bam}' |
+        bamleftalign
+            --fasta-reference '${reference_fasta_filename}'
+            -c
+            --max-iterations "${iterations}"
+            > '${output_bam}'
+    ]]></command>
     <inputs>
         <conditional name="reference_source">
-            <param name="reference_source_selector" type="select" label="Choose the source for the reference list">
+            <param name="reference_source_selector" type="select" label="Choose the source for the reference genome">
                 <option value="cached">Locally cached</option>
                 <option value="history">History</option>
             </param>
             <when value="cached">
-                <param name="input_bam" type="data" format="bam" label="Select BAM dataset to leftalign">
+                <param name="input_bam" type="data" format="bam" label="Select alignment file in BAM format">
                     <validator type="unspecified_build" />
-                    <validator type="dataset_metadata_in_data_table" table_name="fasta_indexes" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." />
+                    <validator type="dataset_metadata_in_data_table" table_name="fasta_indexes" metadata_name="dbkey"
+                               metadata_column="1" message="Sequences are not currently available for the specified build." />
                 </param>
-                <param name="ref_file" type="select" label="Using reference genome">
+                <param name="ref_file" type="select" label="Using reference genome" argument="--fasta-reference">
                     <options from_data_table="fasta_indexes"></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_bam" type="data" format="bam" label="BAM dataset to re-align" />
-                <param name="ref_file" type="data" format="fasta" label="Using reference file" />
+                <param name="ref_file" type="data" format="fasta" label="Using reference file" argument="--fasta-reference" />
             </when>
         </conditional>
-        <param name="iterations" type="integer" value="5" label="Maximum number of iterations" help="Iterate the left-realignment no more than this many times" />
+        <param name="iterations" type="integer" value="5" label="Maximum number of iterations"
+               help="Iterate the left-realignment no more than this many times" argument="--max-iterations" />
     </inputs>
     <outputs>
         <data format="bam" name="output_bam" label="${tool.name} on ${on_string} (alignments)" />
@@ -67,17 +70,7 @@
 
 When calling indels, it is important to homogenize the positional distribution of insertions and deletions in the input by using left realignment. Left realignment will place all indels in homopolymer and microsatellite repeats at the same position, provided that doing so does not introduce mismatches between the read and reference other than the indel. This method is computationally inexpensive and handles the most common classes of alignment inconsistency.
 
-This is leftalign utility from FreeBayes package developed and maintained by Erik Garrison (https://github.com/ekg/freebayes).
+This is leftalign utility from FreeBayes package.
     </help>
-    <citations>
-        <citation type="bibtex">
-          @misc{1207.3907,
-          Author = {Erik Garrison},
-          Title = {Haplotype-based variant detection from short-read sequencing},
-          Year = {2012},
-          Eprint = {arXiv:1207.3907},
-          url = {http://arxiv.org/abs/1207.3907}
-          }
-        </citation>
-    </citations>
+    <expand macro="citations" />
 </tool>
b
diff -r da6e10dee68b -r bf27106652f3 macros.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml Wed Feb 08 12:45:05 2017 -0500
b
@@ -0,0 +1,22 @@
+<macros>
+    <token name="@DEPENDENCY_VERSION@">1.0.2.29</token>
+
+    <xml name="citations">
+        <citations>
+            <citation type="bibtex">
+              @misc{1207.3907,
+                  Author = {Erik Garrison},
+                  Title = {Haplotype-based variant detection from short-read sequencing},
+                  Year = {2012},
+                  Eprint = {arXiv:1207.3907},
+                  url = {http://arxiv.org/abs/1207.3907}
+              }
+            </citation>
+        </citations>
+    </xml>
+    
+    <xml name="par_min_cov">
+        <param name="min_coverage" type="integer" value="0" label="Require at least this coverage to process a site"
+               help="default=0" argument="--coverage" />
+    </xml>
+</macros>