Tool: Trim Adapters Of Paired-End Reads (Fastq)
gravatar for David Langenberger
6.3 years ago by
David Langenberger8.8k wrote:

Trimming adapter sequences of paired-end experiments is sometimes a problem. If you clip the mates in two steps, it migh happen that you loose one mate, but not the corresponding one, resulting in two uneven sets of mates. With the small perl-script you are able to clip the adapters of both mates and you will end up with two correct fastq files. If both mates are too short after clipping (<15nt), both mates are deleted. If one mate is too short after clipping , but the other is long enough, there are two possibilities (-n parameter): 1) The mate which is too short is replaced by an "N", or 2) it is replaced by the original (untrimmed) read.

NOTE: cutadapt has to be installed on your machine!

usage: -m1 <file> -m2 <file> -o1 <file> -o2 <file> -s1 <file> -s2 <file>

 -m1 <file>    raw mates 1
 -m2 <file>    raw mates 2
 -a1 <string>  adapter for mates 1
 -a2 <string>  adapter for mates 2
 -o1 <file>    clipped mates 1
 -o2 <file>    clipped mates 2
 -s1 <file>    clippStat mates 1
 -s2 <file>    clippStat mates 2
 -n  <int>     1: fill mates <15nt with Ns (default)
               0: reset mates <15nt with original mate
 -h <file>     this (usefull) help message

Example: ./ -m1 R1.fq -m2 R2.fq -o1 R1.clipped.fq -o2 R2.clipped.fq -a1 ACGT -a2 ACGT -s1 R1.stat -s2 R2.stat

Coming soon: support of gzipped file; discard both mates, if one is too short;

If you have any suggestions to improve the script, contact

The script can downloaded here.

ADD COMMENTlink modified 5.2 years ago • written 6.3 years ago by David Langenberger8.8k
gravatar for Ashutosh Pandey
6.3 years ago by
Ashutosh Pandey11k wrote:

Nice work and Thanks for sharing the code. The other tool which does things similar to this is ea-utils fastq mcf (

ADD COMMENTlink modified 6.3 years ago by Istvan Albert ♦♦ 80k • written 6.3 years ago by Ashutosh Pandey11k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 849 users visited in the last hour