Mercurial > repos > jjkoehorst > sapp
view rnaseq/cutadapt/cutadapt.xml @ 14:41bfc53ee550
removal of rnaseq
author | jjkoehorst <jasperkoehorst@gmail.com> |
---|---|
date | Sat, 21 Feb 2015 17:12:28 +0100 |
parents | a712b378e090 |
children |
line wrap: on
line source
<tool id="cutadapt" name="Cutadapt" version="1.6"> <description>Remove adapter sequences from Fastq/Fasta</description> <requirements> <requirement type="package" version="1.6">cutadapt</requirement> </requirements> <version_command>cutadapt --version</version_command> <command>cutadapt #if $input.extension.startswith( "fastq"): --format=fastq #if $input.extension == "fastqillumina": --quality-base=64 #end if #if $input.extension == "fastqsolexa": --quality-base=64 #end if #else --format=$input.extension #end if #for $a in $adapters #if $a.adapter_source.adapter_source_list == 'prebuilt': --adapter="${a.adapter_source.adapter.fields.name}"='${a.adapter_source.adapter}' #else if str($a.adapter_source.adapter_name) != "": --adapter='${a.adapter_source.adapter_name}'='${a.adapter_source.adapter}' #else --adapter='${a.adapter_source.adapter}' #end if #end for $anywhere_adapters_textbox #for $aa in $anywhere_adapters #if $aa.anywhere_adapter_source.anywhere_adapter_source_list == 'prebuilt': --anywhere="${aa.anywhere_adapter_source.anywhere_adapter.fields.name}"='${aa.anywhere_adapter_source.anywhere_adapter}' #else if str($aa.anywhere_adapter_source.anywhere_adapter_name) != "": --anywhere='${aa.anywhere_adapter_source.anywhere_adapter_name}'='${aa.anywhere_adapter_source.anywhere_adapter}' #else --anywhere='${aa.anywhere_adapter_source.anywhere_adapter}' #end if #end for #for $fa in $front_adapters #if $fa.front_adapter_source.front_adapter_source_list == 'prebuilt': --front="${fa.front_adapter_source.front_adapter.fields.name}"='${fa.front_adapter_source.front_adapter}' #else if str($fa.front_adapter_source.front_adapter_name) != "": --front='${fa.front_adapter_source.front_adapter_name}'='${fa.front_adapter_source.front_adapter}' #else --front='${fa.front_adapter_source.front_adapter}' #end if #end for --error-rate=$error_rate --times=$count --overlap=$overlap $no_indels $match_read_wildcards #if str( $output_filtering_options.output_filtering) == "filter": $output_filtering_options.discard $output_filtering_options.discard_untrimmed $output_filtering_options.no_trim $output_filtering_options.mask_adapter #if str($output_filtering_options.min) != '0': --minimum-length=$output_filtering_options.min #end if #if str($output_filtering_options.max) != '0': --maximum-length=$output_filtering_options.max #end if #end if --output='$output' #if $paired_end.paired_end_boolean: --paired-output='$paired_output' #end if #if str( $output_params.output_type ) == "additional": #if $output_params.rest_file: --rest-file=$rest_output #end if #if $output_params.wildcard_file: --wildcard-file=$wild_output #end if #if $output_params.too_short_file: --too-short-output=$too_short_output #end if #if $output_params.too_long_file: --too-long-output=$too_long_output #end if #if $output_params.untrimmed_file: --untrimmed-output=$untrimmed_output #if $paired_end.paired_end_boolean: --untrimmed-paired-output=$untrimmed_paired_output #end if #end if #if $output_params.info_file: --info-file=$info_file #end if #end if #if str( $read_modification_params.read_modification) == "modify": #if str($read_modification_params.quality_cutoff) != '0': --quality-cutoff=$read_modification_params.quality_cutoff #end if #if str($read_modification_params.cut) != '0': --cut=$read_modification_params.cut #end if #if $read_modification_params.prefix != '': --prefix="$read_modification_params.prefix" #end if #if $read_modification_params.suffix != '': --suffix="$read_modification_params.suffix" #end if #if $read_modification_params.length_tag != '': --length-tag="$read_modification_params.length_tag" #end if $read_modification_params.zero_cap #end if '$input' #if $paired_end.paired_end_boolean: '$input2' #end if > $report </command> <inputs> <param format="fastq, fastqsanger, fastqillumina, fastqsolexa, fasta" name="input" type="data" optional="false" label="Fastq file to trim" length="100"/> <conditional name="paired_end"> <param name="paired_end_boolean" type="boolean" value="false" label="Track Paired Reads" help="This option will keep a second file synchronized if you use one of the filtering options that discards reads. It will NOT trim adapters off of the second read. You must run Cutadapt a second time on the output of the first run to trim adapters from both reads (see Cutadapt documentation for details)." /> <when value="true"> <param format="fastq, fastqsanger, fastqillumina, fastqsolexa, fasta" name="input2" type="data" optional="false" label="Paired fastq file (NOT trimmed)" length="100"/> </when> </conditional> <param name="anywhere_adapters_textbox" area="True" size="20x40" type="text" value="-b GATCGGAAGAGCACACGTCTGAACTCCAGTCACACAGTGATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACACTGATATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACACTTGAATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACAGTCAAATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACAGTTCCATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACATCACGATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACATGAGCATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACATGTCAATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACATTCCTATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCAAAAGATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCAACTAATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCACCGGATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCACGATATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCACTCAATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCAGATCATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCAGGCGATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCATGGCATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCATTTTATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCCAACAATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCCGTCCATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCGATGTATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCGGAATATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCGTACGATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCTAGCTATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCTATACATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCTCAGAATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACCTTGTAATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACGACGACATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACGAGTGGATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACGATCAGATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACGCCAATATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACGGCTACATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACGGTAGCATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACGTAGAGATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACGTCCGCATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACGTGAAAATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACGTGGCCATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACGTTTCGATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACTAATCGATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACTACAGCATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACTAGCTTATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACTATAATATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACTCATTCATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACTCCCGAATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACTCGAAGATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACTCGGCAATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACTGACCAATCTCGTATGCCGTCTTCTGCTTG -b GATCGGAAGAGCACACGTCTGAACTCCAGTCACTTAGGCATCTCGTATGCCGTCTTCTGCTTG -b " label="Preset cutadapters, replace by yours if required"/> <repeat name="adapters" title="3' Adapters" help="Sequence of an adapter that was ligated to the 3' end. The adapter itself and anything that follows is trimmed."> <conditional name="adapter_source"> <param name="adapter_source_list" type="select" label="Source" > <option value="prebuilt" selected="true">Standard (select from the list below)</option> <option value="user">Enter custom sequence</option> </param> <when value="user"> <param name="adapter_name" size="30" label="Enter custom 3' adapter name (Optional)" type="text" value="" /> <param name="adapter" size="30" label="Enter custom 3' adapter sequence" type="text" value="AATTGGCC" /> </when> <when value="prebuilt"> <param name="adapter" type="select" label="Choose 3' adapter"> <options from_file="cutadapt_adapters.txt"> <column name="name" index="1"/> <column name="value" index="0"/> </options> </param> </when> </conditional> </repeat> <repeat name="anywhere_adapters" title="5' or 3' (Anywhere) Adapters" help="Sequence of an adapter that was ligated to the 5' or 3' end. If the adapter is found within the read or overlapping the 3' end of the read, the behavior is the same as for the -a option. If the adapter overlaps the 5' end (beginning of the read), the initial portion of the read matching the adapter is trimmed, but anything that follows is kept. If multiple -a or -b options are given, only the best matching adapter is trimmed."> <conditional name="anywhere_adapter_source"> <param name="anywhere_adapter_source_list" type="select" label="Source"> <option value="prebuilt" selected="true">Standard (select from the list below)</option> <option value="user">Enter custom sequence</option> </param> <when value="user"> <param name="anywhere_adapter_name" size="30" label="Enter custom 5' or 3' adapter name (Optional)" type="text" value="" /> <param name="anywhere_adapter" size="30" label="Enter custom 5' or 3' adapter sequence" type="text" value="AATTGGCC" /> </when> <when value="prebuilt"> <param name="anywhere_adapter" type="select" label="Choose 5' or 3' adapter"> <options from_file="cutadapt_adapters.txt"> <column name="name" index="1"/> <column name="value" index="0"/> </options> </param> </when> </conditional> </repeat> <repeat name="front_adapters" title="5' (Front) Adapters" help="Sequence of an adapter that was ligated to the 5' end. If the adapter sequence starts with the character '^', the adapter is 'anchored'. An anchored adapter must appear in its entirety at the 5' end of the read (it is a prefix of the read). A non-anchored adapter may appear partially at the 5' end, or it may occur within the read. If it is found within a read, the sequence preceding the adapter is also trimmed. In all cases the adapter itself is trimmed."> <conditional name="front_adapter_source"> <param name="front_adapter_source_list" type="select" label="Source"> <option value="prebuilt" selected="true">Standard (select from the list below)</option> <option value="user">Enter custom sequence</option> </param> <when value="user"> <param name="front_adapter_name" size="30" label="Enter custom 5' adapter name (Optional)" type="text" value="" /> <param name="front_adapter" size="30" label="Enter custom 5' adapter sequence" type="text" value="AATTGGCC" /> </when> <when value="prebuilt"> <param name="front_adapter" type="select" label="Choose 5' adapter"> <options from_file="cutadapt_adapters.txt"> <column name="name" index="1"/> <column name="value" index="0"/> </options> </param> </when> </conditional> </repeat> <param name="error_rate" type="float" min="0" max="1" value="0.1" label="Maximum error rate" help="Maximum allowed error rate (no. of errors divided by the length of the matching region)." /> <param name="no_indels" type="boolean" value="false" truevalue="--no-indels" falsevalue="" label="Do not allow indels (Use ONLY with anchored 5' (front) adapters)." help="Do not allow indels in the alignments. That is, allow only mismatches. This option is currently only supported for anchored 5' adapters ('^ADAPTER') (default: both mismatches and indels are allowed)." /> <param name="count" type="integer" min="1" value="1" label="Match times" help="Try to remove adapters at most COUNT times. Useful when an adapter gets appended multiple times." /> <param name="overlap" type="integer" min="1" value="3" label="Minimum overlap length" help="Minimum overlap length. If the overlap between the adapter and the sequence is shorter than LENGTH, the read is not modified. This reduces the number of bases trimmed purely due to short random adapter matches." /> <param name="match_read_wildcards" type="boolean" value="false" truevalue="--match-read-wildcards" falsevalue="" label="Match Read Wildcards" help="Allow 'N's in the read as matches to the adapter." /> <conditional name="output_filtering_options"> <param name="output_filtering" type="select" label="Output filtering options" help="Options for filtering processed reads by those that contain the adapter or by minimum or maximum length"> <option value="default">Default (no filtering)</option> <option value="filter">Set Filters</option> </param> <when value="default" /> <when value="filter"> <param name="discard" type="boolean" value="false" truevalue="--discard" falsevalue="" label="Discard Trimmed Reads" help="Discard reads that contain the adapter instead of trimming them. Use the 'Minimum overlap length' option in order to avoid throwing away too many randomly matching reads!" /> <param name="discard_untrimmed" type="boolean" value="false" truevalue="--discard-untrimmed" falsevalue="" label="Discard Untrimmed Reads" help="Discard reads that do not contain the adapter." /> <param name="min" type="integer" min="0" optional="true" value="0" label="Minimum length" help="Discard trimmed reads that are shorter than LENGTH. Reads that are too short even before adapter removal are also discarded. In colorspace, an initial primer is not counted. Value of 0 means no minimum length." /> <param name="max" type="integer" min="0" optional="true" value="0" label="Maximum length" help="Discard trimmed reads that are longer than LENGTH. Reads that are too long even before adapter removal are also discarded. In colorspace, an initial primer is not counted. Value of 0 means no maximum length." /> <param name="no_trim" type="boolean" value="false" truevalue="--no-trim" falsevalue="" label="Do not trim adapters" help="Match and redirect reads to output/untrimmed-output as usual, but don't remove the adapters (default: trim the adapters)." /> <param name="mask_adapter" type="boolean" value="false" truevalue="--mask-adapter" falsevalue="" label="Mask Adapters" help="Mask adapter bases with 'N' instead of trimming them (default: trim adapters)." /> </when> </conditional> <conditional name="output_params"> <param name="output_type" type="select" label="Additional output options" help="By default all reads will be put in the same file. However, reads with adapters matching in the middle, unmatched reads, and too-short reads can be saved in separate files."> <option value="default">Default</option> <option value="additional">Additional output files</option> </param> <when value="default" /> <when value="additional"> <param name="info_file" type="boolean" value="false" label="Info File" help="Write information about each read and its adapter matches to a file."/> <param name="rest_file" type="boolean" value="false" label="Rest of Read" help="When the adapter matches in the middle of a read, write the rest (after the adapter) into a file."/> <param name="wildcard_file" type="boolean" value="false" label="Wildcard File" help="When the adapter has wildcard bases ('N's) write adapter bases matching wildcard positions to file."/> <param name="too_short_file" type="boolean" value="false" label="Too Short Reads" help="Write reads that are too short (according to minimum length specified) to a file. (default: discard reads)"/> <param name="too_long_file" type="boolean" value="false" label="Too Long Reads" help="Write reads that are too long (according to maximum length specified) to a file. (default: discard reads)"/> <param name="untrimmed_file" type="boolean" value="false" label="Untrimmed Reads" help="Write reads that do not contain the adapter to a separate file, instead of writing them to the regular output file. (default: output to same file as trimmed)"/> </when> </conditional> <conditional name="read_modification_params"> <param name="read_modification" type="select" label="Additional modifications to reads" help="Various options to trim reads based on quality, modify read names and quality scores"> <option value="none">No Read Modifications</option> <option value="modify">Set Modification Options</option> </param> <when value="none" /> <when value="modify"> <param name="cut" type="integer" optional="true" value="0" label="Cut bases from reads before adapter trimming" help="Remove bases from the beginning or end of each read before trimming adapters. If positive, the bases are removed from the beginning of each read. If negative, the bases are removed from the end of each read." /> <param name="quality_cutoff" type="integer" min="0" optional="true" value="0" label="Quality cutoff" help="Trim low-quality ends from reads before adapter removal. The algorithm is the same as the one used by BWA (Subtract CUTOFF from all qualities; compute partial sums from all indices to the end of the sequence; cut sequence at the index at which the sum is minimal). Value of 0 means no quality trimming." /> <param name="prefix" label="Prefix" type="text" help="Add this prefix to read names" /> <param name="suffix" label="Suffix" type="text" help="Add this suffix to read names" /> <param name="strip_suffix" label="Strip suffix" type="text" help="Remove this suffix from read names if present." /> <param name="length_tag" label="Length Tag" type="text" help="Search for TAG followed by a decimal number in the name of the read (description/comment field of the FASTA or FASTQ file). Replace the decimal number with the correct length of the trimmed read. For example, use --length-tag 'length=' to search for fields like 'length=123'." /> <param name="zero_cap" type="boolean" value="false" label="Change negative quality values to zero (0)" truevalue="--zero-cap" falsevalue="" help="Workaround to avoid segmentation faults in BWA" /> </when> </conditional> </inputs> <outputs> <data format="txt" name="report" label="${tool.name} on ${on_string} (Report)" /> <data format="input" name="output" metadata_source="input" label="${tool.name} on ${on_string} (Reads)"/> <data format="input" name="paired_output" metadata_source="input" label="${tool.name} on ${on_string} (Paired Reads)" > <filter>(paired_end['paired_end_boolean'] is True)</filter> </data> <data format="input" name="rest_output" metadata_source="input" label="${tool.name} on ${on_string} (Rest of Reads)" > <filter>(output_params['output_type'] == "additional")</filter> <filter>(output_params['rest_file'] is True)</filter> </data> <data format="txt" name="wild_output" metadata_source="input" label="${tool.name} on ${on_string} (Wildcard File)" > <filter>(output_params['output_type'] == "additional")</filter> <filter>(output_params['wildcard_file'] is True)</filter> </data> <data format="input" name="too_short_output" metadata_source="input" label="${tool.name} on ${on_string} (Too Short Reads)" > <filter>(output_params['output_type'] == "additional")</filter> <filter>(output_params['too_short_file'] is True)</filter> </data> <data format="input" name="too_long_output" metadata_source="input" label="${tool.name} on ${on_string} (Too Long Reads)" > <filter>(output_params['output_type'] == "additional")</filter> <filter>(output_params['too_long_file'] is True)</filter> </data> <data format="input" name="untrimmed_output" metadata_source="input" label="${tool.name} on ${on_string} (Untrimmed Reads)" > <filter>(output_params['output_type'] == "additional")</filter> <filter>(output_params['untrimmed_file'] is True)</filter> </data> <data format="input" name="untrimmed_paired_output" metadata_source="input" label="${tool.name} on ${on_string} (Untrimmed Paired Reads)" > <filter>(paired_end['paired_end_boolean'] is True)</filter> <filter>(output_params['output_type'] == "additional")</filter> <filter>(output_params['untrimmed_file'] is True)</filter> </data> <data format="txt" name="info_file" metadata_source="input" label="${tool.name} on ${on_string} (Info File)" > <filter>(output_params['output_type'] == "additional")</filter> <filter>(output_params['info_file'] is True)</filter> </data> </outputs> <stdio> <exit_code range="1" level="fatal" description="IOError, FormatError, or Interrupt" /> <exit_code range="2" level="fatal" description="Invalid options specified" /> <exit_code range="3:" level="fatal" description="Unknown error" /> </stdio> <tests> <test> <param name="input" value="cutadapt_small.fastq" ftype="fastqsanger"/> <param name="adapter_source_list" value="user"/> <param name="adapter" value=""/> <param name="anywhere_adapter_source_list" value="user"/> <param name="anywhere_adapter" value="TTAGACATATCTCCGTCG"/> <param name="front_adapter_source_list" value="user"/> <param name="front_adapter" value=""/> <param name="output_filtering" value="default"/> <param name="read_modification" value="none"/> <param name="output_type" value="default"/> <output name="output" file="cutadapt_small.out"/> </test> <!-- Unable to get tests to function with conditional parameters <test> <param name="input" value="cutadapt_small.fastq" ftype="fastqsanger"/> <param name="adapter_source_list" value="user"/> <param name="adapter" value="TTAGACATATCTCCGTCG"/> <param name="anywhere_adapter_source_list" value="user"/> <param name="anywhere_adapter" value=""/> <param name="front_adapter_source_list" value="user"/> <param name="front_adapter" value=""/> <param name="output_filtering" value="filter"/> <param name="discard" value="true"/> <param name="read_modification" value="none"/> <param name="output_type" value="default"/> <output name="output" file="cutadapt_discard.out"/> </test> <test> <param name="input" value="cutadapt_rest.fa" ftype="fasta"/> <param name="adapter_source_list" value="user"/> <param name="adapter" value="ADAPTER"/> <param name="anywhere_adapter_source_list" value="user"/> <param name="anywhere_adapter" value=""/> <param name="front_adapter_source_list" value="user"/> <param name="front_adapter" value=""/> <param name="output_filtering" value="default"/> <param name="read_modification" value="none"/> <param name="output_type" value="additional"/> <param name="rest_file" value="true"/> <output name="output" file="cutadapt_rest.out"/> <output name="rest_output" file="cutadapt_rest2.out"/> </test> --> </tests> <help> Note ------- Original code from lparsons, 1% modified to add more reads at once. Summary ------- This tool removes adapter sequences from DNA high-throughput sequencing data. This is usually necessary when the read length of the machine is longer than the molecule that is sequenced, such as in microRNA data. The tool is based on the opensource `cutadapt <http://code.google.com/p/cutadapt/>`_ tool. See the `complete cutadapt documentation <https://cutadapt.readthedocs.org/en/latest/index.html>`_ for additional details. ----- Algorithm --------- cutadapt uses a simple semi-global alignment algorithm, without any special optimizations. For speed, the algorithm is implemented as a Python extension module in ``calignmodule.c``. Partial adapter matches ----------------------- Cutadapt correctly deals with partial adapter matches. As an example, suppose your adapter sequence is ``ADAPTER`` (specified via 3' Adapters parameter). If you have these input sequences:: MYSEQUENCEADAPTER MYSEQUENCEADAP MYSEQUENCEADAPTERSOMETHINGELSE All of them will be trimmed to ``MYSEQUENCE``. If the sequence starts with an adapter, like this:: ADAPTERSOMETHING It will be empty after trimming. When the allowed error rate is sufficiently high, errors in the adapter sequence are allowed. For example, ``ADABTER`` (1 mismatch), ``ADAPTR`` (1 deletion), and ``ADAPPTER`` (1 insertion) will all be recognized if the error rate is set to 0.15. Anchoring 5' adapters --------------------- If you specify a 5' (Front) adapter, the adapter may overlap the beginning of the read or occur anywhere whithin it. If it appears withing the read, the sequence that precedes it will also be trimmed in addition to the adapter. For example when the adapter sequence is ``ADAPTER``:: HELLOADAPTERTHERE APTERTHERE will both be trimmed to ``THERE``. To avoid this, you can prefix the adapter with the character ``^``. This will restrict the search, forcing the adapter to be a prefix of the read. With the adapter sequence set to ``^ADAPTER``, only reads like this will be trimmed:: ADAPTERHELLO Allowing adapters anywhere -------------------------- Cutadapt assumes that any adapter specified via the 3' Adapter parameter was ligated to the 3\' end of the sequence. This is the correct assumption for at least the SOLiD and Illumina small RNA protocols and probably others. The assumption is enforced by the alignment algorithm, which only finds the adapter when its starting position is within the read. In other words, the 5' base of the adapter must appear within the read. The adapter and all bases following it are removed. If, on the other hand, your adapter can also be ligated to the 5' end (on purpose or by accident), you should tell cutadapt so by using the Anywhere Adapter parameter. It will then use a slightly different alignment algorithm (so-called semiglobal alignment), which allows any type of overlap between the adapter and the sequence. In particular, the adapter may appear only partially in the beginning of the read, like this:: PTERMYSEQUENCE The decision which part of the read to remove is made as follows: If there is at least one base before the found adapter, then the adapter is considered to be a 3' adapter and the adapter itself and everything following it is removed. Otherwise, the adapter is considered to be a 5' adapter and it is removed from the read. Here are some examples, which may make this clearer (left: read, right: trimmed read):: MYSEQUENCEADAPTER -> MYSEQUENCE (3' adapter) MADAPTER -> M (3' adapter) ADAPTERMYSEQUENCE -> MYSEQUENCE (5' adapter) PTERMYSEQUENCE -> MYSEQUENCE (5' adapter) The regular algorithm (3' Adapter) would trim the first two examples in the same way, but trim the third to an empty sequence and trim the fourth not at all. Format of the info file ----------------------- The info file contains information about the found adapters. The output is a tab-separated text file. Each line corresponds to one read of the input file. The fields are: 1. Read name 2. Number of errors 3. 0-based start coordinate of the adapter match 4. 0-based end coordinate of the adapter match 5. Sequence of the read to the left of the adapter match (can be empty) 6. Sequence of the read that was matched to the adapter 7. Sequence of the read to the right of the adapter match (can be empty) 8. Name of the found adapter. The concatenation of the fields 5-7 yields the full read sequence. In column 8, adapters without a name are numbered starting from 1. If no adapter was found, the format is as follows: 1. Read name 2. The value -1 3. The read sequence When parsing that file, be aware that additional columns may be added in the future. Note also that some fields can be empty, resulting in consecutive tabs within a line. Also, in the current version, when the *Match times* option is set to a value other than 1 (the default value), multiple lines are written to the info file for each read. .. _cutadapt: http://code.google.com/p/cutadapt/ </help> </tool>