comparison freebayes.xml @ 27:9f164587a92f draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/freebayes commit d2f9b1728a6525b599e2c014a183b0415b27a870
author iuc
date Tue, 06 Jun 2017 11:44:38 -0400
parents a028d13cd860
children 977a5301b66d
comparison
equal deleted inserted replaced
26:a028d13cd860 27:9f164587a92f
1 <tool id="freebayes" name="FreeBayes" version="@DEPENDENCY_VERSION@-3"> 1 <tool id="freebayes" name="FreeBayes" version="@DEPENDENCY_VERSION@-0">
2 <description>bayesian genetic variant detector</description> 2 <description>bayesian genetic variant detector</description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 </macros> 5 </macros>
6 <requirements> 6 <requirements>
22 samtools faidx '${reference_fasta_filename}' 2>&1 || echo "Error running samtools faidx for FreeBayes" >&2 && 22 samtools faidx '${reference_fasta_filename}' 2>&1 || echo "Error running samtools faidx for FreeBayes" >&2 &&
23 #else: 23 #else:
24 #set $reference_fasta_filename = str( $reference_source.ref_file.fields.path ) 24 #set $reference_fasta_filename = str( $reference_source.ref_file.fields.path )
25 #end if 25 #end if
26 26
27 #for $bam_count, $input_bam in enumerate( $reference_source.input_bams ): 27 #if $reference_source.batchmode.processmode == 'merge':
28 #set $input_bamfiles = $reference_source.batchmode.input_bams
29 #else:
30 #set $input_bamfiles = [ $reference_source.batchmode.input_bams ]
31 #end if
32
33 #for $bam_count, $input_bam in enumerate( $input_bamfiles ):
28 ln -s -f '${input_bam}' 'b_${bam_count}.bam' && 34 ln -s -f '${input_bam}' 'b_${bam_count}.bam' &&
29 ln -s -f '${input_bam.metadata.bam_index}' 'b_${bam_count}.bam.bai' && 35 ln -s -f '${input_bam.metadata.bam_index}' 'b_${bam_count}.bam.bai' &&
30 #end for 36 #end for
31 37
32 ## Tabixize optional input_variant_vcf file (for --variant-input option) 38 ## Tabixize optional input_variant_vcf file (for --variant-input option)
41 ln -s '${target_limit_type.input_target_bed}' regions_all.bed && 47 ln -s '${target_limit_type.input_target_bed}' regions_all.bed &&
42 #elif str( $target_limit_type.target_limit_type_selector ) == "limit_by_region": 48 #elif str( $target_limit_type.target_limit_type_selector ) == "limit_by_region":
43 printf '${target_limit_type.region_chromosome}\t${target_limit_type.region_start}\t${target_limit_type.region_end}' > regions_all.bed && 49 printf '${target_limit_type.region_chromosome}\t${target_limit_type.region_start}\t${target_limit_type.region_end}' > regions_all.bed &&
44 #else 50 #else
45 ##divide up the regions in the bam file for efficient processing 51 ##divide up the regions in the bam file for efficient processing
46 #for $bam_count, $input_bam in enumerate( $reference_source.input_bams ): 52 #for $bam_count, $input_bam in enumerate( $input_bamfiles ):
47 samtools view -H b_${bam_count}.bam | 53 samtools view -H b_${bam_count}.bam |
48 grep "^@SQ" | 54 grep "^@SQ" |
49 cut -f 2- | 55 cut -f 2- |
50 awk '{ gsub("^SN:","",$1); 56 awk '{ gsub("^SN:","",$1);
51 gsub("^LN:","",$2); 57 gsub("^LN:","",$2);
52 print $1"\t0\t"$2; }' >> regions_all.bed && 58 print $1"\t0\t"$2; }' >> regions_all.bed &&
53 #end for 59 #end for
54 #end if 60 #end if
55 61
56
57
58 sort -u regions_all.bed > regions_uniq.bed && 62 sort -u regions_all.bed > regions_uniq.bed &&
59 ## split into even small chunks, this has some disatvantages and will not be used for the moment 63 ## split into even small chunks, this has some disatvantages and will not be used for the moment
60 ## bedtools makewindows -b regions_uniq.bed -w 10000000 -s 9990000 > regions.bed && 64 ## bedtools makewindows -b regions_uniq.bed -w 10000000 -s 9990000 > regions.bed &&
61 65
62 mkdir vcf_output && 66 mkdir vcf_output &&
74 78
75 freebayes 79 freebayes
76 80
77 --region '\$i' 81 --region '\$i'
78 82
79 #for $bam_count, $input_bam in enumerate( $reference_source.input_bams ): 83 #for $bam_count, $input_bam in enumerate( $input_bamfiles ):
80 --bam 'b_${bam_count}.bam' 84 --bam 'b_${bam_count}.bam'
81 #end for 85 #end for
82 --fasta-reference '${reference_fasta_filename}' 86 --fasta-reference '${reference_fasta_filename}'
83 87
84 ## Outputs 88 ## Outputs
281 <param name="reference_source_selector" type="select" label="Choose the source for the reference genome"> 285 <param name="reference_source_selector" type="select" label="Choose the source for the reference genome">
282 <option value="cached">Locally cached</option> 286 <option value="cached">Locally cached</option>
283 <option value="history">History</option> 287 <option value="history">History</option>
284 </param> 288 </param>
285 <when value="cached"> 289 <when value="cached">
286 <param name="input_bams" type="data" format="bam" multiple="True" label="BAM file"> 290 <expand macro="input_bam">
287 <validator type="unspecified_build" /> 291 <expand macro="validation" />
288 <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." /> 292 </expand>
289 </param>
290 <param name="ref_file" type="select" label="Using reference genome"> 293 <param name="ref_file" type="select" label="Using reference genome">
291 <options from_data_table="fasta_indexes"></options> 294 <options from_data_table="fasta_indexes" />
292 <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/> 295 <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/>
293 </param> 296 </param>
294 </when> 297 </when>
295 <when value="history"> <!-- FIX ME!!!! --> 298 <when value="history"> <!-- FIX ME!!!! -->
296 <param name="input_bams" type="data" format="bam" multiple="True" label="BAM file" /> 299 <expand macro="input_bam" />
297 <param name="ref_file" type="data" format="fasta" label="Use the following dataset as the reference sequence" 300 <param name="ref_file" type="data" format="fasta" label="Use the following dataset as the reference sequence"
298 help="You can upload a FASTA sequence to the history and use it as reference" /> 301 help="You can upload a FASTA sequence to the history and use it as reference" />
299 </when> 302 </when>
300 </conditional> 303 </conditional>
301 <conditional name="target_limit_type"> 304 <conditional name="target_limit_type">
644 </data> 647 </data>
645 </outputs> 648 </outputs>
646 <tests> 649 <tests>
647 <test> 650 <test>
648 <param name="reference_source_selector" value="history" /> 651 <param name="reference_source_selector" value="history" />
652 <param name="processmode" value="individual" />
649 <param name="ref_file" ftype="fasta" value="freebayes-phix174.fasta"/> 653 <param name="ref_file" ftype="fasta" value="freebayes-phix174.fasta"/>
650 <param name="input_bams" ftype="bam" value="freebayes-phix174.bam"/> 654 <param name="input_bams" ftype="bam" value="freebayes-phix174.bam"/>
651 <param name="options_type_selector" value="simple"/> 655 <param name="options_type_selector" value="simple"/>
652 <output name="output_vcf" file="freebayes-phix174-test1.vcf" compare="contains"/> 656 <output name="output_vcf" file="freebayes-phix174-test1.vcf" compare="contains"/>
653 </test> 657 </test>
654 <test> 658 <test>
655 <param name="reference_source_selector" value="history" /> 659 <param name="reference_source_selector" value="history" />
660 <param name="processmode" value="individual" />
656 <param name="ref_file" ftype="fasta" value="freebayes-phix174.fasta"/> 661 <param name="ref_file" ftype="fasta" value="freebayes-phix174.fasta"/>
657 <param name="input_bams" ftype="bam" value="freebayes-phix174.bam"/> 662 <param name="input_bams" ftype="bam" value="freebayes-phix174.bam"/>
658 <param name="options_type_selector" value="naive_w_filters"/> 663 <param name="options_type_selector" value="naive_w_filters"/>
659 <param name="min_coverage" value="14"/> 664 <param name="min_coverage" value="14"/>
660 <output name="output_vcf" file="freebayes-phix174-test2.vcf" compare="contains"/> 665 <output name="output_vcf" file="freebayes-phix174-test2.vcf" compare="contains"/>
661 </test> 666 </test>
662 <test> 667 <test>
663 <param name="reference_source_selector" value="history" /> 668 <param name="reference_source_selector" value="history" />
669 <param name="processmode" value="individual" />
664 <param name="ref_file" ftype="fasta" value="freebayes-phix174.fasta"/> 670 <param name="ref_file" ftype="fasta" value="freebayes-phix174.fasta"/>
665 <param name="input_bams" ftype="bam" value="freebayes-phix174.bam"/> 671 <param name="input_bams" ftype="bam" value="freebayes-phix174.bam"/>
666 <param name="options_type_selector" value="naive_w_filters"/> 672 <param name="options_type_selector" value="naive_w_filters"/>
667 <param name="min_coverage" value="14"/> 673 <param name="min_coverage" value="14"/>
668 <output name="output_vcf" file="freebayes-phix174-test3.vcf" compare="contains"/> 674 <output name="output_vcf" file="freebayes-phix174-test3.vcf" compare="contains"/>
669 </test> 675 </test>
670 <test> 676 <test>
671 <param name="reference_source_selector" value="history" /> 677 <param name="reference_source_selector" value="history" />
678 <param name="processmode" value="individual" />
672 <param name="ref_file" ftype="fasta" value="freebayes-phix174.fasta"/> 679 <param name="ref_file" ftype="fasta" value="freebayes-phix174.fasta"/>
673 <param name="input_bams" ftype="bam" value="freebayes-phix174.bam"/> 680 <param name="input_bams" ftype="bam" value="freebayes-phix174.bam"/>
674 <param name="options_type_selector" value="full"/> 681 <param name="options_type_selector" value="full"/>
675 <param name="population_model_selector" value="set"/> 682 <param name="population_model_selector" value="set"/>
676 <param name="P" value="1"/> 683 <param name="P" value="1"/>