Mercurial > repos > iuc > polypolish
diff polypolish.xml @ 1:df205c588e6f draft default tip
planemo upload for repository https://github.com/mesocentre-clermont-auvergne/galaxy-tools/tree/master/tools/polypolish commit f3b5a8f978923c5bbf663b0a99025245458e6ee0
| author | iuc |
|---|---|
| date | Tue, 12 Nov 2024 09:56:19 +0000 |
| parents | 0c094ece2c73 |
| children |
line wrap: on
line diff
--- a/polypolish.xml Thu Sep 22 07:50:58 2022 +0000 +++ b/polypolish.xml Tue Nov 12 09:56:19 2024 +0000 @@ -5,45 +5,51 @@ <macros> <import>macro.xml</import> </macros> - <expand macro='xrefs'/> - <expand macro="requirements" /> - <expand macro="version_command" /> + <expand macro="xrefs"/> + <expand macro="requirements"/> + <expand macro="version_command"/> <command detect_errors="aggressive"><![CDATA[ ln -s '$input.fasta_file' input_data && #*====================================== For single SAM ======================================*# #if $input.sam_data_type.sam_selector == 'single' - #if $input.sam_data_type.single_sam.ext == 'unsorted.bam' - samtools view -h $input.sam_data_type.single_sam > input_sam && + #if $input.sam_data_type.single_sam.is_of_type("unsorted.bam") + samtools view -@ \$addthreads -h $input.sam_data_type.single_sam > input_sam && #elif $input.sam_data_type.single_sam.ext == 'sam' ln -s $input.sam_data_type.single_sam input_sam && + #else + echo "${input.sam_data_type.single_sam} not a sam/bam file" #end if - polypolish input_data input_sam > '$polished_fasta' + polypolish polish input_data input_sam > '$polished_fasta' #*====================================== For paired SAM ======================================*# #elif $input.sam_data_type.sam_selector == 'paired' - #if $input.sam_data_type.R1_sam.ext == 'unsorted.bam' - samtools view -h $input.sam_data_type.R1_sam > sample_R1.sam && + #if $input.sam_data_type.R1_sam.is_of_type("unsorted.bam") + samtools view -@ \$addthreads -h $input.sam_data_type.R1_sam > sample_R1.sam && #elif $input.sam_data_type.R1_sam.ext == 'sam' ln -s '$input.sam_data_type.R1_sam' sample_R1.sam && + #else + echo "${input.sam_data_type.single_sam} not a sam/bam file" #end if - #if $input.sam_data_type.R2_sam.ext == 'unsorted.bam' - samtools view -h $input.sam_data_type.R2_sam > sample_R2.sam && + #if $input.sam_data_type.R2_sam.is_of_type("unsorted.bam") + samtools view -@ \$addthreads -h $input.sam_data_type.R2_sam > sample_R2.sam && #elif $input.sam_data_type.R2_sam.ext == 'sam' ln -s '$input.sam_data_type.R2_sam' sample_R2.sam && + #else + echo "${input.sam_data_type.single_sam} not a sam/bam file" #end if #if $input.sam_data_type.insert_filter.filter_select == 'filter' - polypolish_insert_filter.py --low '$input.sam_data_type.insert_filter.low' + polypolish filter --low '$input.sam_data_type.insert_filter.low' --high '$input.sam_data_type.insert_filter.high' --in1 sample_R1.sam --in2 sample_R2.sam --out1 'filtered_1.sam' --out2 'filtered_2.sam' && - polypolish input_data 'filtered_1.sam' 'filtered_2.sam' > $polished_fasta + polypolish polish input_data 'filtered_1.sam' 'filtered_2.sam' > $polished_fasta #else - polypolish input_data sample_R1.sam sample_R2.sam > $polished_fasta + polypolish polish input_data sample_R1.sam sample_R2.sam > $polished_fasta #end if #*====================================== For multiple single-end SAM @@ -51,31 +57,33 @@ #elif $input.sam_data_type.sam_selector == 'multiple_single' mkdir single_collection && #for $value, $single_sam in enumerate($input.sam_data_type.single_collection): - #if $single_sam.ext == 'unsorted.bam' - samtools view -h $single_sam > 'single_collection/$(single_sam.element_identifier).sam' && + #if $single_sam.is_of_type("unsorted.bam") + samtools view -@ \$addthreads -h $single_sam > 'single_collection/$(single_sam.element_identifier).sam' && #elif $single_sam.ext == 'sam' ln -s $single_sam 'single_collection/$(single_sam.element_identifier).$(single_sam.ext)' && + #else + echo "${single_sam} is not a sam/bam file" #end if #end for - polypolish input_data single_collection/*.sam > '$polished_fasta' + polypolish polish input_data single_collection/*.sam > '$polished_fasta' #*====================================== For multiple paired-end SAM ======================================*# #elif $input.sam_data_type.sam_selector == "multiple_paired" mkdir paired_collection && #for $value, $paired_sam in enumerate($input.sam_data_type.paired_collection): - #if $paired_sam.forward.ext == 'unsorted.bam' - samtools view -h $paired_sam.forward > 'paired_collection/forward_input$(value)$(paired_sam.forward.element_identifier).sam' && + #if $paired_sam.forward.is_of_type("unsorted.bam") + samtools view -@ \$addthreads -h $paired_sam.forward > 'paired_collection/forward_input$(value)$(paired_sam.forward.element_identifier).sam' && #else ln -s '$paired_sam.forward' 'paired_collection/forward_input$(value)$(paired_sam.forward.element_identifier).sam' && #end if - #if $paired_sam.reverse.ext == 'unsorted.bam' - samtools view -h $paired_sam.reverse > 'paired_collection/reverse_input$(value)$(paired_sam.reverse.element_identifier).sam' && + #if $paired_sam.reverse.is_of_type("unsorted.bam") + samtools view -@ \$addthreads -h $paired_sam.reverse > 'paired_collection/reverse_input$(value)$(paired_sam.reverse.element_identifier).sam' && #else ln -s '$paired_sam.reverse' 'paired_collection/reverse_input$(value)$(paired_sam.reverse.element_identifier).sam' && #end if #if $input.sam_data_type.insert_filter.filter_select == 'filter' - polypolish_insert_filter.py --low '$input.sam_data_type.insert_filter.low' + polypolish filter --low '$input.sam_data_type.insert_filter.low' --high '$input.sam_data_type.insert_filter.high' --in1 'paired_collection/forward_input$(value)$(paired_sam.forward.element_identifier).sam' --in2 'paired_collection/reverse_input$(value)$(paired_sam.reverse.element_identifier).sam' @@ -87,9 +95,9 @@ Filtering option ======================================*# #if $input.sam_data_type.insert_filter.filter_select == 'filter' - polypolish input_data paired_collection/*_filtered.sam > '$polished_fasta' + polypolish polish input_data paired_collection/*_filtered.sam > '$polished_fasta' #else - polypolish input_data paired_collection/*.sam > '$polished_fasta' + polypolish polish input_data paired_collection/*.sam > '$polished_fasta' #end if #end if #*====================================== @@ -108,8 +116,7 @@ </command> <inputs> <section name="input" title="Input sequences" expanded="True"> - <param name="fasta_file" type="data" format="fasta" label="Select a draft genome for polishing" - help="Fasta sequence to be cleaned using short-reads data"/> + <param name="fasta_file" type="data" format="fasta" label="Select a draft genome for polishing" help="Fasta sequence to be cleaned using short-reads data"/> <conditional name="sam_data_type"> <param name="sam_selector" type="select" label="Select aligned data to polish" help="Choose number of aligned sam/bam files. Need aligned file with all possible locations in aligner option"> <option value="single">Single SAM/BAM file</option> @@ -135,16 +142,12 @@ </conditional> </section> <section name="options" title="Options" expanded="False"> - <param name="min_depth" argument="--min_depth" type="integer" min="0" value="5" label="Minimal depth" - help="A base must occur at least this many times in the pileup to be considered valid [default: 5]"/> - <param name="fraction_invalid" argument="--fraction_invalid" type="float" min="0" value="0.2" max="1" label="Minimal invalid fraction" - help="A base must make up less than this fraction of the read depth to be considered invalid [default: 0.2]"/> - <param name="max_errors" argument="--max_errors" type="integer" min="0" value="10" label="Number of mismatch/indels to ignore alignments" - help="Ignore alignments with more than this many mismatches and indels [default: 10]"/> - <param name="fraction_valid" argument="--fraction_valid" type="float" min="0" value="0.5" max="1" label="Minimal valid fraction" - help="A base must make up at least this fraction of the read depth to be considered valid [default: 0.5"/> + <param argument="--min_depth" type="integer" min="0" value="5" label="Minimal depth" help="A base must occur at least this many times in the pileup to be considered valid [default: 5]"/> + <param argument="--fraction_invalid" type="float" min="0" value="0.2" max="1" label="Minimal invalid fraction" help="A base must make up less than this fraction of the read depth to be considered invalid [default: 0.2]"/> + <param argument="--max_errors" type="integer" min="0" value="10" label="Number of mismatch/indels to ignore alignments" help="Ignore alignments with more than this many mismatches and indels [default: 10]"/> + <param argument="--fraction_valid" type="float" min="0" value="0.5" max="1" label="Minimal valid fraction" help="A base must make up at least this fraction of the read depth to be considered valid [default: 0.5"/> <param name="keep_logfile" type="boolean" truevalue="true" falsevalue="false" label="Keep log file"/> - <param name="debug" argument="--debug" type="boolean" truevalue="true" falsevalue="false" label="Keep per base information file"/> + <param argument="--debug" type="boolean" truevalue="true" falsevalue="false" label="Keep per base information file"/> </section> </inputs> <outputs> @@ -343,9 +346,9 @@ <param name="sam_selector" value="multiple_single"/> <param name="single_collection"> <collection type="list"> - <element name="R1_sam" value="aligned_test_file/alignement_R1.bam" ftype="unsorted.bam"/> - <element name="R1_bis_sam" value="aligned_test_file/alignement_R1_bis.bam" ftype="unsorted.bam"/> - <element name="R1_ter_sam" value="aligned_test_file/alignement_R1_ter.bam" ftype="unsorted.bam"/> + <element name="R1_sam" value="aligned_test_file/alignement_R1.sam" ftype="sam"/> + <element name="R1_bis_sam" value="aligned_test_file/alignement_R1_bis.sam" ftype="sam"/> + <element name="R1_ter_sam" value="aligned_test_file/alignement_R1_ter.sam" ftype="sam"/> </collection> </param> </conditional> @@ -361,29 +364,29 @@ <section name="input"> <param name="fasta_file" value="contigs.fa"/> <conditional name="sam_data_type"> - <param name="sam_selector" value="multiple_paired"/> - <param name="paired_collection"> - <collection type="list:paired"> - <element name="paired_1"> - <collection type="paired"> - <element name="forward" value="aligned_test_file/alignement_R1.bam" ftype="unsorted.bam"/> - <element name="reverse" value="aligned_test_file/alignement_R2.bam" ftype="unsorted.bam"/> - </collection> - </element> - <element name="paired_2"> - <collection type="paired"> - <element name="forward" value="aligned_test_file/alignement_R1_bis.bam" ftype="unsorted.bam"/> - <element name="reverse" value="aligned_test_file/alignement_R2_bis.bam" ftype="unsorted.bam"/> - </collection> - </element> - <element name="paired_3"> - <collection type="paired"> - <element name="forward" value="aligned_test_file/alignement_R1_ter.bam" ftype="unsorted.bam"/> - <element name="reverse" value="aligned_test_file/alignement_R2_ter.bam" ftype="unsorted.bam"/> - </collection> - </element> - </collection> - </param> + <param name="sam_selector" value="multiple_paired"/> + <param name="paired_collection"> + <collection type="list:paired"> + <element name="paired_1"> + <collection type="paired"> + <element name="forward" value="aligned_test_file/alignement_R1.bam" ftype="unsorted.bam"/> + <element name="reverse" value="aligned_test_file/alignement_R2.bam" ftype="unsorted.bam"/> + </collection> + </element> + <element name="paired_2"> + <collection type="paired"> + <element name="forward" value="aligned_test_file/alignement_R1_bis.bam" ftype="unsorted.bam"/> + <element name="reverse" value="aligned_test_file/alignement_R2_bis.bam" ftype="unsorted.bam"/> + </collection> + </element> + <element name="paired_3"> + <collection type="paired"> + <element name="forward" value="aligned_test_file/alignement_R1_ter.bam" ftype="unsorted.bam"/> + <element name="reverse" value="aligned_test_file/alignement_R2_ter.bam" ftype="unsorted.bam"/> + </collection> + </element> + </collection> + </param> </conditional> </section> <section name="options"> @@ -392,8 +395,36 @@ </section> <output name="polished_fasta" value="polished.fasta"/> </test> + <!-- Test_12 Test with bam files --> + <test expect_num_outputs="1"> + <section name="input"> + <param name="fasta_file" value="contigs.fa"/> + <conditional name="sam_data_type"> + <param name="sam_selector" value="single"/> + <param name="single_sam" value="aligned_test_file/alignement_R1.bam"/> + </conditional> + </section> + <output name="polished_fasta" value="polished.fasta"/> + </test> + <!-- Test_13 paired bam --> + <test expect_num_outputs="2"> + <section name="input"> + <param name="fasta_file" value="contigs.fa"/> + <conditional name="sam_data_type"> + <param name="sam_selector" value="paired"/> + <param name="R1_sam" value="aligned_test_file/alignement_R1.bam"/> + <param name="R2_sam" value="aligned_test_file/alignement_R2.bam"/> + </conditional> + </section> + <section name="options"> + <param name="debug" value="true"/> + <param name="keep_logfile" value="false"/> + </section> + <output name="polished_fasta" value="polished.fasta"/> + <output name="debug_file" value="debug_file_test_2.tsv"/> + </test> </tests> - <help><![CDATA[ + <help><![CDATA[ **What it does** Polypolish is a tool for polishing genome assemblies with short reads. Polypolish uses SAM/BAM files where each read has been aligned to all possible locations (not just a single best location). @@ -401,10 +432,12 @@ **Polypolish pipeline steps** 1. [Optional] Filter aligned reads - - Exclude some alignments based on their insert size - - This should reduce the number of excessive alignments, particularly near the edges of repeat sequences, improving Polypolish's ability to fix errors in those regions. + Exclude some alignments based on their insert size + This should reduce the number of excessive alignments, + particularly near the edges of repeat sequences, improving Polypolish's ability to fix errors in those regions. 2. Clean assembly with filtered reads + **Inputs** Polypolish need SAM/BAM input format obtain from aligner with option to keep all possible location Polypolish take on or more assembly as input fasta. @@ -414,9 +447,7 @@ For example using bwa mem to align raw data before use, you need : 1. To align each read data independantly (also for paired data) 2. Set the option "Output all alignments for single-ends or unpaired paired-ends" in Select analysis mode>Set input/output options - - This allow multiple ailgnemnt output need to use polypolish - - + This allow multiple ailgnemnt output need to use polypolish ]]></help> <expand macro="citations"/> </tool>
