Archive

  • Visit JGI.DOE.GOV
Data & Tools
Home › Data & Tools › Software › BBTools › BBTools User Guide › Add Adapters Guide

Add Adapters Guide

AddAdapters is designed for grading the performance of adapter-trimming tools. It can add adapters to reads, and annotate the reads with their correct post-trimming length; and it can be run on trimmed reads, to calculate the rates of correct and incorrect trimming. However, it does not understand insert size, so for adding adapters to paired reads, it’s better to use RandomReads.

*Usage Examples*

To add adapters to reads:
addadapters.sh in=a.fq out=b.fq adapters=adapters.fa

To grade trimmed reads:
addadapters.sh in=trimmed.fq grade

To use RandomReads instead, to add adapters in the correct location according to insert size:
randomreads.sh ref=ref.fa out=reads.fq len=150 paired reads=100k mininsert=50 maxinsert=350 fragadapter1=ACTG fragadapter2=ACTG
rename.sh in=reads.fq out=renamed.fq renamebytrim interleaved

The result of this will still be named correctly for grading by addadapters. “ACTG” would normally be a much longer adapter sequence.

Flag Descriptions

Description:  Randomly adds adapters to a file, or grades a trimmed file.
The input is a set of reads, paired or unpaired.
The output is those same reads with adapter sequence replacing some of the bases in some reads.
For paired reads, adapters are located in the same position in read1 and read2.
This is designed for benchmarking adapter-trimming software, and evaluating methodology.

Usage:  addadapters.sh in=file in2=file2 out=outfile out2=outfile2 adapters=file

in2 and out2 are for paired reads and are optional.
If input is paired and there is only one output file, it will be written interleaved.


Parameters:
ow=f                (overwrite) Overwrites files that already exist.
int=f               (interleaved) Determines whether INPUT file is considered interleaved.
qin=auto            ASCII offset for input quality.  May be 33 (Sanger), 64 (Illumina), or
		    auto.
qout=auto           ASCII offset for output quality.  May be 33 (Sanger), 64 (Illumina), or
		    auto (same as input).
add                 Add adapters to input files.  Default mode.
grade               Evaluate trimmed input files.
adapters=file       Fasta file of adapter sequences.
literal=sequence    Comma-delimited list of adapter sequences.
left                Adapters are on the left (3') end of the read.
right               Adapters are on the right (5') end of the read.  Default mode.
adderrors=t         Add errors to adapters based on the quality scores.
addpaired=t         Add adapters to the same location for read 1 and read 2.
arc=f               Add reverse-complemented adapters as well as forward.
rate=0.5            Add adapters to this fraction of reads.
  • BBTools User Guide
    • Usage Guide
    • Installation Guide
    • Data Preprocessing
    • Add Adapters Guide
    • BBDuk Guide
    • BBMap Guide
    • BBMask Guide
    • BBMerge Guide
    • BBNorm Guide
    • CalcUniqueness Guide
    • Clumpify Guide
    • Dedupe Guide
    • Reformat Guide
    • Repair Guide
    • Seal Guide
    • Split Nextera Guide
    • Statistics Guide
    • Tadpole Guide
    • Taxonomy Guide
  • BBTools FAQ and Support Forums

More from the JGI archives:

  • Software Tools
  • Science Highlights
  • News Releases
  • Blog
  • User Proposals
  • 2018-24 Strategic Plan
  • Progress Reports
  • Historical Primers
  • Legacy Projects
  • Past Events
  • JGI.DOE.GOV
  • Disclaimer
  • Accessibility / Section 508
Lawrence Berkeley National Lab Biosciences Area
A project of the US Department of Energy, Office of Science

JGI is a DOE Office of Science User Facility managed by Lawrence Berkeley National Laboratory

© 1997-2025 The Regents of the University of California