Converting Phred64 fastq to Phred33 fastq
2
4
Entering edit mode
8.4 years ago
Shicheng Guo ★ 9.4k

Hi all,

I've been asked to convert some Phred64 fastq files to Phred33 fastq

How can I perform this? Any recommended perl script?

Thank you

The following pipeline works pretty well. Thanks Frank:

  1. install fastq_phred_convert from github
  2. export PERL5LIB=$PERL5LIB:/home/user/fastq_phred_convert/
  3. Copy fastq_33_to_64.pl and fastq_63_to_33.pl to /usr/bin
  4. Use them as the traditional command: perl /usr/bin fastq_63_to_33.pl *input.fastq
phred64 phred33 • 4.5k views
ADD COMMENT
4
Entering edit mode
8.4 years ago

I recommend reformat from BBMap:

reformat.sh in=reads.fq out=reformatted.fq qin=64 qout=33
ADD COMMENT
3
Entering edit mode
8.4 years ago

Hey!

I wrote two little perl scripts which should perform the requested operation. The script is available at https://github.com/greatfireball/fastq_phred_convert.

Just clone the repository

git clone https://github.com/greatfireball/fastq_phred_convert

and run the commands

cd fastq_phred_convert
./fastq_64_to_33.pl input.fq

The output will be written to STDOUT.

In case you need a progress report or find a bug... Just let me know.

Best,
Frank

PS: The other script can be used to convert from a 33 offset to 64 and is called

fastq_64_to_33.pl
ADD COMMENT
2
Entering edit mode

Hi Foerster,

How to solve the problem, we can only use the perl script in the fold of /fastq_phred_convert/. We can not use this perl script in the directory of the data storage.

Best regards,

ADD REPLY
0
Entering edit mode

Hey Shicheng Guo,

Given that your data are located at /storage/some/place/input.fq and the perl scripts are located in /home/user/fastq_phred_convert/, you can call the program inside the script folder and redirect the output:

cd /home/user/fastq_phred_convert/
./fastq_33_to_64.pl /storage/some/place/input.fq > /storage/some/place/output.fq

In case you try to run it from the data folder you will receive an error like:

cd /storage/some/place/
/home/user/fastq_phred_convert/astq_33_to_64.pl input.fq > output.fq
Can't locate convert.pm in @INC[...]

So perl can not determine where the module is located. One way to fix this is the environmental variable PERL5LIB, which can be set to hold the location of modules. Just add (in case of bash) the installation folder to its end:

export PERL5LIB=$PERL5LIB:/home/user/fastq_phred_convert/
/home/user/fastq_phred_convert/astq_33_to_64.pl input.fq > output.fq

I will prepare a little fix to the scripts that will solve the problem (hopefully) also. After adding that fix, I will send you a note.

Best,
Frank

ADD REPLY
1
Entering edit mode

The update is available and fixes that issue.

Just go to your repository folder and run git pull

r clone the repository again as suggested in my first post.

Best regards,
Frank

ADD REPLY
0
Entering edit mode

Yes. it works pretty well.

  1. install fastq_phred_convert from github
  2. export PERL5LIB=$PERL5LIB:/home/user/fastq_phred_convert/
  3. copy fastq_33_to_64.pl and fastq_63_to_33.pl to /usr/bin
  4. use them as the traditional command: perl /usr/bin fastq_63_to_33.pl *input.fastq
ADD REPLY

Login before adding your answer.

Traffic: 2646 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