Install fastp and Trimmomatic for Read Trimming (macOS, conda)
Install fastp and Trimmomatic on macOS with conda, then run a real adapter- and quality-trimming command with each read trimmer.
Before you align or quantify anything, raw FASTQ files usually need a trim: adapter sequences clipped off, low-quality tails cut, and reads that are too short after trimming thrown away. Two tools dominate this step. fastp is a modern, all-in-one C++ trimmer that is extremely fast and needs almost no configuration. Trimmomatic is the older Java workhorse, slower and more verbose to invoke, but still the default in many published RNA-seq and variant-calling pipelines. This guide installs both into isolated conda environments on macOS and runs a real trim command with each.
fastp and Trimmomatic solve the same problem differently. fastp auto-detects adapters and quality-trims in one fast pass with sensible defaults. Trimmomatic needs you to specify each step explicitly (adapter file, quality thresholds, minimum length) as a chain of operations. Neither is "wrong" — pick based on what a downstream pipeline or protocol expects.
Prerequisites
You need a working conda on your Mac. If you do not have one yet, start with our Miniconda on Apple Silicon guide and come back here. This walkthrough assumes conda with the fast libmamba solver (default since conda 23.10) and installs only from conda-forge and bioconda.
We pass --override-channels on every install so conda never falls back to the Anaconda defaults channel, which on recent conda versions is gated behind a Terms-of-Service prompt that breaks non-interactive installs.
TL;DR: copy-paste install
# fastp: native arm64, C++, no JDK needed
conda create -n bu-fastp --override-channels -c conda-forge -c bioconda fastp
conda activate bu-fastp
fastp --version
# Trimmomatic: pure Java, pulls a JDK automatically
conda create -n bu-trim --override-channels -c conda-forge -c bioconda trimmomatic
conda activate bu-trim
trimmomatic --versionWe keep the two trimmers in separate environments (bu-fastp and bu-trim) rather than one combined env. That keeps each environment small and avoids any dependency conflict between fastp's C++ toolchain and Trimmomatic's JDK.
Step 1: Install fastp
fastp is distributed on bioconda as a single compiled binary with almost no runtime dependencies, so the environment is tiny and the install is fast.
conda create -n bu-fastp --override-channels -c conda-forge -c bioconda fastpYou should see something like the following in the solver output, with the important detail being the build tag:
The following NEW packages will be INSTALLED:
fastp bioconda/osx-arm64::fastp-<version>-h6d7220d_0
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
The osx-arm64 tag confirms bioconda ships a native Apple Silicon build of fastp — no Rosetta 2 emulation, no slowdown. That is one of fastp's selling points: it is written in C++ and compiled per-platform, so on an M-series Mac it runs at full native speed straight out of the box.
Step 2: Install Trimmomatic
Trimmomatic is pure Java, packaged on bioconda as a noarch build — the same package works on any platform because it is really just a JAR file plus a wrapper script. Installing it pulls in a JDK as a dependency automatically.
conda create -n bu-trim --override-channels -c conda-forge -c bioconda trimmomaticWatch the dependency list during the solve — you should see an OpenJDK package go in alongside Trimmomatic itself:
The following NEW packages will be INSTALLED:
openjdk conda-forge/osx-arm64::openjdk-<version>-...
trimmomatic bioconda/noarch::trimmomatic-<version>-...
This is expected and correct. You do not need Java installed separately on your Mac beforehand — conda resolves and installs its own isolated JDK inside the bu-trim environment. That JDK stays inside the environment and never touches any system-level Java you may or may not already have.
Because Trimmomatic's package is noarch, the download is small regardless of architecture, but the OpenJDK dependency it pulls in is not — expect the bu-trim environment to land noticeably larger on disk than bu-fastp, purely because of the bundled JVM.
Step 3: Verify both installs
Activate each environment in turn and check the version. Trimmomatic in particular is worth double-checking because its command-line entry point varies across packaging versions.
conda activate bu-fastp
fastp --version
which fastpconda activate bu-trim
trimmomatic --version
which trimmomaticIf trimmomatic --version prints nothing useful or errors, try the single-dash form instead — -version is Trimmomatic's own version flag, and the double-dash spelling is not always accepted:
trimmomatic -versionBoth binaries should resolve inside their respective environment's bin/ directory (.../envs/bu-fastp/bin/fastp and .../envs/bu-trim/bin/trimmomatic). If you get command not found, you forgot to conda activate the environment in this shell.
Step 4: Run a real trim with each
Both tools take paired-end or single-end FASTQ input. Here is the shape of a typical single-end trim with each, assuming a file reads.fastq.gz from a standard Illumina run.
fastp
conda activate bu-fastp
fastp \
-i reads.fastq.gz \
-o reads.trimmed.fastq.gz \
--qualified_quality_phred 20 \
--length_required 36 \
--json fastp.json \
--html fastp.htmlfastp auto-detects and trims the adapter sequence (adapter trimming is on by default for single-end reads), cuts bases below Phred quality 20, drops reads shorter than 36 bp after trimming, and — unusually for a trimmer — writes both a machine-readable fastp.json report and a self-contained fastp.html report you can open in a browser. That built-in QC report is one of the main reasons people prefer fastp over running FastQC as a separate step.
Trimmomatic
conda activate bu-trim
trimmomatic SE -phred33 \
reads.fastq.gz reads.trimmed.fastq.gz \
ILLUMINACLIP:TruSeq3-SE.fa:2:30:10 \
LEADING:3 TRAILING:3 \
SLIDINGWINDOW:4:20 \
MINLEN:36SE declares single-end mode and -phred33 sets the quality encoding (standard for any read produced after roughly 2011). Each step after that runs left to right in the order you list it: ILLUMINACLIP removes adapters using a reference FASTA of adapter sequences (bundled with the conda package, or you can supply your own), LEADING/TRAILING trim low-quality bases from each end, SLIDINGWINDOW:4:20 scans in 4-base windows and cuts once the average quality drops below 20, and MINLEN:36 discards anything shorter than 36 bp afterward. For paired-end data, swap SE for PE, pass both mate files, and Trimmomatic produces four output files — paired and unpaired reads for each mate.
The TruSeq3-SE.fa adapter file ships inside the Trimmomatic conda package under share/trimmomatic-<version>/adapters/. Find it with find $CONDA_PREFIX/share -iname "TruSeq3-SE.fa" after activating bu-trim, and reference it by its full path in the ILLUMINACLIP step if it is not in your working directory.
fastp vs Trimmomatic at a glance
| fastp | Trimmomatic | |
|---|---|---|
| Language | C++ | Java |
| Bioconda build | native osx-arm64 | noarch, pulls OpenJDK |
| Config style | one command, sensible defaults, auto-detects adapters | explicit chain of steps you write yourself |
| Built-in QC report | yes (fastp.html / fastp.json) | no (pair with FastQC separately) |
| Typical use | quick default trimming in modern pipelines | legacy pipelines and protocols that specify it by name |
Neither tool is strictly better — many published protocols specify Trimmomatic by name for reproducibility, while newer pipelines default to fastp for speed and the built-in report. If a paper or a workflow manager pipeline you are following (see Install Nextflow or Install Snakemake) names one explicitly, use that one rather than swapping in the other.
Common errors and fixes
| Error | Fix |
|---|---|
CondaToSNonInteractiveError on either install | Do not use the defaults channel. Install with --override-channels -c conda-forge -c bioconda as shown. |
trimmomatic: command not found right after install | The bin/ wrapper script name can vary by packaging version. Activate the env and try trimmomatic -version; if that also fails, locate the JAR with find $CONDA_PREFIX -iname "trimmomatic*.jar" and run it via java -jar <path> -version. |
Exception in thread "main" java.lang.UnsupportedClassVersionError | The JDK inside bu-trim is older than the Trimmomatic build expects (rare, but possible after a partial update). Recreate the env fresh rather than updating in place: conda env remove -n bu-trim then reinstall. |
ILLUMINACLIP step silently removes nothing | You pointed it at the wrong adapter FASTA, or your reads use a different adapter set than TruSeq. Confirm with fastp's auto-detected adapter report first, then match that adapter file for Trimmomatic. |
| Fewer reads survive than expected | MINLEN (Trimmomatic) or --length_required (fastp) is discarding short reads after trimming. Lower the threshold only if your downstream aligner tolerates short reads. |
command not found for either tool generally | You did not activate the environment. Run conda activate bu-fastp or conda activate bu-trim in each new shell. |
Managing the environments
Update either tool in place:
conda update -n bu-fastp --override-channels -c conda-forge -c bioconda fastp
conda update -n bu-trim --override-channels -c conda-forge -c bioconda trimmomaticSnapshot an environment so a collaborator can reproduce it exactly:
conda env export -n bu-fastp > fastp-env.yml
conda env export -n bu-trim > trim-env.ymlAnd remove either cleanly when you no longer need it:
conda remove -n bu-fastp --all
conda remove -n bu-trim --allNext steps
With trimmed reads in hand, a couple of natural follow-ons:
- Read Conda environments and Bioconda channels to understand why channel order and
--override-channelsmatter for every install in this series. - For RNA-seq, trimmed reads feed straight into quantification — see Install Salmon or continue with the full RNA-seq differential expression workflow.
- For DNA-seq variant calling, trimmed reads go on to alignment with BWA or Bowtie2 before variant calling with GATK4.