pku-embl/metagenomics-skills/cutadapt

Claude Code and agent skill by pku-embl/metagenomics-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Adapter/primer trimming for short and long reads. Use for installation, parameter choice, execution, output interpretation, or troubleshooting.

Install

npx vskill@latest install pku-embl/metagenomics-skills/cutadapt

SKILL.md

Cutadapt

Upstream: Cutadapt

Citation

Martin, M. Cutadapt removes adapter sequences from high-throughput sequencing reads. EMBnet J. 17, 10–12 (2011). https://doi.org/10.14806/ej.17.1.200

See also docs/references.md.

Analytical thinking

Use when adapters/primers are known exactly (amplicon-like primers on shotgun libraries, custom oligos). For general Illumina shotgun QC prefer fastp.

How to run

Use a pinned environment and resolve paths from the sample manifest rather than constructing biological groups from filenames.

bash
set -Eeuo pipefail
id="${1:?usage: trim-one.sh SAMPLE_ID}"
[[ "$id" =~ ^[A-Za-z0-9][A-Za-z0-9._-]*$ ]] || exit 2
r1="seq/${id}_1.fq.gz"
r2="seq/${id}_2.fq.gz"
out="temp/qc"
threads="${THREADS:-8}"
adapter_r1="${ADAPTER_R1:-AGATCGGAAGAGC}"
adapter_r2="${ADAPTER_R2:-AGATCGGAAGAGC}"
[[ "$threads" =~ ^[1-9][0-9]*$ ]] || exit 2
[[ "$adapter_r1" =~ ^[ACGTNacgtn]+$ && "$adapter_r2" =~ ^[ACGTNacgtn]+$ ]] || exit 2
for input in "$r1" "$r2"; do test -s "$input" || exit 2; done
mkdir -p "$out" logs
for target in "$out/${id}_1.fq.gz" "$out/${id}_2.fq.gz" \
"$out/${id}.cutadapt.json"; do
test ! -e "$target" || { echo "refusing to overwrite: $target" >&2; exit 2; }
done
cutadapt -j "$threads" -a "$adapter_r1" -A "$adapter_r2" \
--minimum-length 50 --pair-filter any \
--json "$out/${id}.cutadapt.json" \
-o "$out/${id}_1.fq.gz" -p "$out/${id}_2.fq.gz" \
"$r1" "$r2" \
>"logs/${id}.cutadapt.stdout.log" \
2>"logs/${id}.cutadapt.stderr.log"

Cutadapt checks paired input length and writes retained reads as pairs. State the adapter sequences, minimum length, and --pair-filter policy in Methods.

Key parameters

-a/-AadaptersR1/R2
-jthreads

Decision notes

  • Stage: QC — adapter/primer trimming before host depletion / assembly
  • Prefer when custom adapters or amplicon primers matter; else fastp often enough
  • Keep trimmed PE pairing consistent for KneadData / assembly

Validation, recovery, and provenance

bash
gzip -t "temp/qc/${id}_1.fq.gz" "temp/qc/${id}_2.fq.gz"
test -s "temp/qc/${id}.cutadapt.json"
r1_count="$(seqkit stats -T "temp/qc/${id}_1.fq.gz" | awk 'NR==2 {print $4}')"
r2_count="$(seqkit stats -T "temp/qc/${id}_2.fq.gz" | awk 'NR==2 {print $4}')"
test "$r1_count" = "$r2_count"

Inspect the JSON/log for adapter yield, retained pairs, length loss, and warnings; a zero exit code does not establish that the specified oligos were appropriate. Rerun into fresh paths after changing adapters or filters. Record Cutadapt version, exact oligos, pair-filter policy, input/output checksums, command, and logs.

Related skills

fastp · trimmomatic · tool-selection · metagenomics-workflow

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
6
7-day trend score
10

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/pku-embl/metagenomics-skills/cutadapt/badge)](https://verified-skill.com/skills/pku-embl/metagenomics-skills/cutadapt)

Something wrong with this skill or its page? Tell us.