How to trim adapters of paired-end reads (fastq)

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

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!

If you have any suggestions to improve the script, contact email image.

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

The script can be downloaded here.

Receive updates about NGS articles and trainings

Share this article

About us

ecSeq is a bioinformatics solution provider with solid expertise in the analysis of high-throughput sequencing data. We can help you to get the most out of your sequencing experiments by developing data analysis strategies and expert consulting. We organize public workshops and conduct on-site trainings on NGS data analysis.

Last updated on October 07, 2015