> For the complete documentation index, see [llms.txt](https://help.connected.illumina.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.connected.illumina.com/dragen-single-cell-rna/running-dragen-on-hpc/pre-trimming-with-cutadapt-when-using-the-star-mapper.md).

# Pre-Trimming With Cutadapt when using the STAR Mapper

### Recommended pre-trimming for DRAGEN v4.5 (DRAGEN-STAR workflow)

The standard DRAGEN hardware mode (run with FPGA acceleration) trims reads automatically. However, when processing scRNA-seq data with DRAGEN v4.5 software mode, using the DRAGEN-STAR workflow, trimming is not performed. We recommend pre-trimming FASTQs to remove TSO, polyA, and polyG sequences that can negatively impact alignment (leading to a variable drop in mapping rates, depending on the sample type and read 2 length). Note: *Trimming should only be performed on gene expression libraries.*\
TSO sequences are typically observed in <1–5% of reads from Illumina Single-Cell Prep Libraries and are more common in shorter, unfragmented library molecules.\
PolyA sequences occur when reads extend into the polyA tail or reverse-complement polyT capture sequence.\
PolyG sequences arise from reads containing short inserts, which generate dark cycles after processing past the end of the library molecule. Dark cycles are as G bases on Illumina instruments.\
Manual pre-trimming is recommended until support for these artifacts is incorporated in a future DRAGEN release (v4.6).\
The workflow below produces trimmed FASTQ pairs while trimming only Read 2, allowing the output files to be used directly with the DRAGEN-STAR pipeline.The standard DRAGEN hardware mode (run with FPGA acceleration) trims reads automatically. However, when processing scRNA-seq data with DRAGEN v4.5 software mode, using the DRAGEN-STAR workflow, trimming is not performed. We recommend pre-trimming FASTQs to remove TSO, polyA, and polyG sequences that can negatively impact alignment and mapping rates depending on the sample type and read 2 length.

* **TSO** sequences are typically observed in <1–5% of reads from Illumina Single-Cell Prep Libraries and are more common in shorter, unfragmented library molecules.
* **PolyA** sequences occur when reads extend into the polyA tail or reverse-complement polyT capture sequence.
* **PolyG** sequences arise from reads containing short inserts, which generate dark cycles after processing past the end of the library molecule. Dark cycles are as G bases on Illumina instruments.

Manual pre-trimming is recommended until support for these artifacts is incorporated in a future DRAGEN release (v4.6).

The workflow below produces trimmed FASTQ pairs while trimming only Read 2, allowing the output files to be used directly with the DRAGEN-STAR pipeline.

For more information about using the STAR Mapper with DRAGEN, see the following: <https://developer.illumina.com/news-updates/your-pipseq-workflow-is-consolidating-into-dragen>

#### 1. Install Cutadapt

<pre><code><strong># installation
</strong><strong>conda create -n cutadapt -c conda-forge -c bioconda cutadapt
</strong><strong># Activate it
</strong><strong>conda activate cutadapt
</strong><strong># verify installation
</strong><strong>cutadapt --version
</strong></code></pre>

#### 2. Set up the input + output paths and run the cutadapt command

```
r1="/path/to/r1.fastq.gz"
r2="/path/to/r2.fastq.gz"
sample_id="sample_name"

cutadapt \
  --cores 8 \
  --no-indels \
  --pair-filter=any \
  -e 0 \
  -O 12 \
  -U 1 \
  -G AGAGTGAATGGG \
  -G TCAACGCAGAGT \
  -A AAAAAAAAAAAA \
  -A "GGGGGGGGGGGGX;o=6;e=0.15" \
  -m 1:20 \
  -o "${sample_id}_R1.pretrimmed.fastq.gz" \
  -p "${sample_id}_R2.pretrimmed.fastq.gz" \
  "$r1" "$r2"
```

#### Parameter Details

<table data-header-hidden data-search="false"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Cutadapt option</strong></td><td><strong>Purpose</strong></td></tr><tr><td>-U 1</td><td>Trims 1 base from the 5′ end of Read 2, the transcript read.</td></tr><tr><td>-G AGAGTGAATGGG</td><td>Removes the TSO sequence from the 5′ side of the transcript read.</td></tr><tr><td>-G TCAACGCAGAGT</td><td>Removes the SMART PCR sequence from the 5′ side of the transcript read.</td></tr><tr><td>-A AAAAAAAAAAAA</td><td>Removes poly-A sequence from the 3′ side of the transcript read.</td></tr><tr><td>-A GGGGGGGGGGGG o=6;e=0.15"</td><td>Removes poly-G sequence from the 3′ side of the transcript read, requiring a 6 bp minimum overlap (o) and allowing 15% errors (e) in the matched region</td></tr><tr><td>-O 12</td><td>Requires a 12-base adapter overlap, matching the intended 12-base trimming stringency.</td></tr><tr><td>-e 0.10</td><td>Allows up to 10% mismatch, consistent with DRAGEN adapter trimming behavior.</td></tr><tr><td>--no-indels</td><td>Disallows insertions/deletions during adapter matching, making the behavior closer to DRAGEN’s mismatch-based adapter trimming.</td></tr><tr><td>-m 1:20</td><td>Keeps Read 1 effectively unfiltered by length, while requiring the transcript read to be at least 20 nt after trimming.</td></tr><tr><td>-p &#x3C;R2 path></td><td>Path to output trimmed R2 output</td></tr><tr><td>-o &#x3C;R1 path></td><td>Path to output R1 (untrimmed, but matching reads retained from R2)</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.connected.illumina.com/dragen-single-cell-rna/running-dragen-on-hpc/pre-trimming-with-cutadapt-when-using-the-star-mapper.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
