trim_reads
Trim sequencing adapters and low-quality ends off FASTQ reads before mapping, and report what was removed. This is cutadapt's algorithm: quality trimming is BWA's running-sum rule (not a threshold - a single bad base in a good tail is absorbed, a real decline is not), and the adapter is found by semiglobal alignment allowing errors, so a PARTIAL adapter at the very end of a read is caught where a substring search would miss it. Quality trimming runs FIRST and adapter removal second, which is cutadapt's own order and changes the result when a low-quality tail is also the start of an adapter. THE REPORT ATTRIBUTES EVERY REMOVED BASE TO THE STEP THAT REMOVED IT, because losing 30% of your bases to quality means a bad sequencing run and losing it to adapter means a short insert - different problems that one total cannot distinguish. It does not map anything and does not filter reads: a read trimmed to nothing is returned empty and counted, never silently dropped.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reads | Yes | the reads to trim, as FASTQ - quality lines are required, because both halves of this need them. | |
| _files | No | The project: record references shaped like _subject. Their records become library documents a tool names in sequences/parts/document; a trace or alignment is found by file name. | |
| adapter | No | the adapter sequence to remove. Unset means quality trimming only. Illumina TruSeq is AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC and Nextera is CTGTCTCTTATACACATCT. | |
| _subject | No | The record to act on: exactly one of sequence, accession (+source), sample (an id from list_samples) or file ({name, text} or {name, base64}); record_index picks one record of several. | |
| min_length | No | reads shorter than this after trimming are COUNTED as too short, not removed - this tool does not filter. 0 reports none. Advanced. | |
| min_overlap | No | an adapter overlap shorter than this is ignored. Low values trim real bases by chance - at 1, a read ending in the adapter's first base is 'trimmed'. Advanced. | |
| adapter_kind | No | which end the adapter sits at. A read running off the end of its insert hits the 3' adapter, which is why that is the default. | three_prime |
| phred_offset | No | quality encoding: 33 for every modern FASTQ, 64 only for pre-1.8 Illumina. Advanced. | |
| max_error_rate | No | errors allowed in the adapter match, as a fraction of the overlap. cutadapt's own default. Advanced. | |
| quality_cutoff_back | No | quality cutoff for the 3' end, where quality decays with cycle number. 0 is off; 20 is the usual choice. NOT a threshold on individual bases - see the description. | |
| quality_cutoff_front | No | quality cutoff for the 5' end, which fails for different reasons than the 3' end and so takes its own number. 0 is off, and off is the usual answer. Advanced. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| report | Yes | what was removed and by which step: bases before and after, the two attributed counts, reads with an adapter, reads emptied and reads left too short | |
| readsEmptied | Yes | reads trimmed to nothing at all - a different alarm from 'too short', because it usually means the read was all adapter | |
| trimmedFastq | Yes | the trimmed reads as FASTQ, ready for `map_reads` | |
| readsWithAdapter | Yes | how many reads carried the adapter - the number that says whether your insert size is shorter than your read length | |
| basesRemovedByAdapter | Yes | bases removed by adapter trimming alone | |
| basesRemovedByQuality | Yes | bases removed by quality trimming alone |