Mercurial > repos > nick > sequence_content_trimmer
comparison trimmer.xml @ 1:7ef568cbf13b draft
"planemo upload commit 9a5d91c35d21411a0733cd233ca588ff358aabd8-dirty"
| author | nick |
|---|---|
| date | Fri, 27 May 2022 22:44:01 +0000 |
| parents | c824894e0827 |
| children | a8fd651dcbd9 |
comparison
equal
deleted
inserted
replaced
| 0:c824894e0827 | 1:7ef568cbf13b |
|---|---|
| 1 <tool id="sequence_content_trimmer" version="0.1" name="Sequence Content Trimmer"> | 1 <?xml version="1.0"?> |
| 2 <tool id="sequence_content_trimmer" version="0.2.1" name="Sequence Content Trimmer"> | |
| 2 <description>trim reads based on certain bases</description> | 3 <description>trim reads based on certain bases</description> |
| 3 <command interpreter="python"> | 4 <command detect_errors="exit_code"><![CDATA[ |
| 4 trimmer.py $input1 | 5 #if $paired.is_paired and (('fasta' in $input1.extension and 'fastq' in $input2.extension) or \ |
| 5 #if $paired.is_paired: | 6 ('fastq' in $input1.extension and 'fasta' in $input2.extension)) |
| 6 $input2 $output1 $output2 | 7 echo 'Both input files must be either fastq or fasta (no mixing the two).' >&2 |
| 7 #if ('fasta' in $input1.extension and 'fastq' in $input2.extension) or ('fastq' in $input1.extension and 'fasta' in $input2.extension) | 8 #else |
| 8 --error 'Both input files must be either fastq or fasta (no mixing the two).' | 9 trimmer.py $input1 |
| 10 #if $paired.is_paired: | |
| 11 $input2 $output1 $output2 | |
| 12 #end if | |
| 13 #if $input1.extension in ('fastq', 'fastqsanger', 'fastqillumina', 'fastqsolexa') | |
| 14 -f fastq | |
| 15 #elif $input1.extension == 'fasta' | |
| 16 -f fasta | |
| 17 #else | |
| 18 -f $input1.extension | |
| 19 #end if | |
| 20 -b $bases -t $thres -w $win_len $invert | |
| 21 #if $min_len.has_min_len: | |
| 22 -m $min_len.value | |
| 23 #end if | |
| 24 #if not $paired.is_paired: | |
| 25 > $output1 | |
| 9 #end if | 26 #end if |
| 10 #end if | 27 #end if |
| 11 #if $input1.extension == 'fastq' or $input1.extension == 'fastqsanger' or $input1.extension == 'fastqillumina' or $input1.extension == 'fastqsolexa' | 28 ]]> |
| 12 -f fastq | |
| 13 #elif $input1.extension == 'fasta' | |
| 14 -f fasta | |
| 15 #else | |
| 16 -f $input1.extension | |
| 17 #end if | |
| 18 -b $bases -t $thres -w $win_len $invert | |
| 19 #if $min_len.has_min_len: | |
| 20 -m $min_len.value | |
| 21 #end if | |
| 22 #if not $paired.is_paired: | |
| 23 > $output1 | |
| 24 #end if | |
| 25 </command> | 29 </command> |
| 26 <inputs> | 30 <inputs> |
| 27 <conditional name="paired"> | 31 <conditional name="paired"> |
| 28 <param name="is_paired" type="select" label="Paired reads?"> | 32 <param name="is_paired" type="select" label="Paired reads?"> |
| 29 <option value="" selected="True">Unpaired</option> | 33 <option value="" selected="True">Unpaired</option> |
| 36 <when value=""> | 40 <when value=""> |
| 37 <param name="input1" type="data" format="fasta,fastq" label="Input reads"/> | 41 <param name="input1" type="data" format="fasta,fastq" label="Input reads"/> |
| 38 </when> | 42 </when> |
| 39 </conditional> | 43 </conditional> |
| 40 <param name="bases" type="text" value="N" label="Bases to filter on"/> | 44 <param name="bases" type="text" value="N" label="Bases to filter on"/> |
| 41 <param name="thres" type="float" value="0.5" min="0" max="1" label="Frequency threshold" help="trim when the frequency of filter bases (or non-filter bases, if inverting) exceeds this value."/> | 45 <param name="thres" type="float" value="0.5" min="0" max="1" label="Frequency threshold" help="Trim when the frequency of filter bases (or non-filter bases, if inverting) exceeds this value."/> |
| 42 <param name="win_len" type="integer" value="10" min="1" label="Size of the window"/> | 46 <param name="win_len" type="integer" value="10" min="1" label="Size of the window"/> |
| 43 <param name="invert" type="boolean" truevalue="--invert" falsevalue="" checked="False" label="Invert filter bases" help="Trim when the frequency of bases NOT in the "filter bases" list exceeds the threshold."/> | 47 <param name="invert" type="boolean" truevalue="--invert" falsevalue="" checked="False" label="Invert filter bases" help="Trim when the frequency of bases NOT in the "filter bases" list exceeds the threshold."/> |
| 44 <conditional name="min_len"> | 48 <conditional name="min_len"> |
| 45 <param name="has_min_len" type="boolean" truevalue="true" falsevalue="" checked="False" label="Set a minimum read length"/> | 49 <param name="has_min_len" type="boolean" truevalue="true" falsevalue="" checked="False" label="Set a minimum read length"/> |
| 46 <when value="true"> | 50 <when value="true"> |
| 47 <param name="value" type="integer" value="10" min="0" label="Minimum read length" help="Reads trimmed to less than this length will be omitted from the output. Pairs will be preserved: both must exceed this threshold to be kept."/> | 51 <param name="value" type="integer" value="10" min="0" label="Minimum read length" help="Reads trimmed to less than this length will be omitted from the output. Pairs will be preserved: both must exceed this threshold to be kept."/> |
| 48 </when> | 52 </when> |
| 49 </conditional> | 53 </conditional> |
| 50 </inputs> | 54 </inputs> |
| 51 <outputs> | 55 <outputs> |
| 52 <data name="output1" format_source="input1"/> | 56 <data name="output1" format_source="input1" label="$tool.name on $on_string"/> |
| 53 <data name="output2" format_source="input2"> | 57 <data name="output2" format_source="input2" label="$tool.name on $on_string (mate 2)"> |
| 54 <filter>paired['is_paired']</filter> | 58 <filter>paired['is_paired']</filter> |
| 55 </data> | 59 </data> |
| 56 </outputs> | 60 </outputs> |
| 57 | 61 |
| 58 <help> | 62 <help> |
| 64 This tool trims the 3' ends of reads based on the presence of the given bases. For instance, trim when N's are encountered or when the GC content exceeds a certain frequency. | 68 This tool trims the 3' ends of reads based on the presence of the given bases. For instance, trim when N's are encountered or when the GC content exceeds a certain frequency. |
| 65 | 69 |
| 66 | 70 |
| 67 .. class:: infomark | 71 .. class:: infomark |
| 68 | 72 |
| 73 **How it works** | |
| 74 | |
| 75 This will slide along the read with a window, and trim once the frequency of filter bases exceeds the frequency threshold (unless "Invert filter bases" is enabled, in which case it will trim once non-filter bases exceed the threshold). | |
| 76 | |
| 77 The trim point will be just before the first (leftmost) filter base in the final window (the one where the frequency exceeded the threshold). | |
| 78 | |
| 79 | |
| 80 .. class:: infomark | |
| 81 | |
| 69 **Input** | 82 **Input** |
| 70 | 83 |
| 71 The inputs can be in the following formats: fasta, fastq, fastqsanger, fastqillumina, and fastqsolexa. Both must be either a fasta or fastq type (no mixing fastq and fasta). | 84 The inputs can be in the following formats: fasta, fastq, fastqsanger, fastqillumina, and fastqsolexa. Both must be either a fasta or fastq type (no mixing fastq and fasta). |
| 72 | 85 |
| 73 </help> | 86 </help> |
