Tool:Trim Adapters Of Paired-End Reads (Fastq)
1
5
Entering edit mode
11.2 years ago

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 clipPairedEndFastq.pl 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!

clipPairedEndFastq.pl

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

[INPUT]
 -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: ./clipPairedEndFastq.pl -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 support@ecseq.com.

The script can be downloaded here.

paired-end adaptor-trimming ngs • 6.6k views
ADD COMMENT
0
Entering edit mode
11.2 years ago

Nice work and Thanks for sharing the code. The other tool which does things similar to this is ea-utils fastq mcf (http://code.google.com/p/ea-utils/wiki/FastqMcf)

ADD COMMENT

Login before adding your answer.

Traffic: 3832 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6