Question: Converting Phred64 fastq to Phred33 fastq
3
gravatar for Shicheng Guo
3.4 years ago by
Shicheng Guo7.4k
Shicheng Guo7.4k wrote:

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

 

 

transform convert pred33 phred64 • 1.6k views
ADD COMMENTlink modified 3.4 years ago • written 3.4 years ago by Shicheng Guo7.4k
3
gravatar for Brian Bushnell
3.4 years ago by
Walnut Creek, USA
Brian Bushnell16k wrote:

I recommend reformat from BBMap:

reformat.sh in=reads.fq out=reformatted.fq qin=64 qout=33

ADD COMMENTlink written 3.4 years ago by Brian Bushnell16k
3
gravatar for Frank Förster
3.4 years ago by
Germany
Frank Förster30 wrote:

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 COMMENTlink modified 3.4 years ago • written 3.4 years ago by Frank Förster30
2

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 REPLYlink modified 3.4 years ago • written 3.4 years ago by Shicheng Guo7.4k

Hey Shicheng Guo,

Given that your data are located at

/storage/some/place/input.fq

and the perl scripts are located here

/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 REPLYlink modified 3.4 years ago • written 3.4 years ago by Frank Förster30
1

The update is available and fixes that issue.

Just go to your repository folder and run

git pull

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

Best regards,
Frank

ADD REPLYlink modified 3.4 years ago • written 3.4 years ago by Frank Förster30

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 REPLYlink written 3.4 years ago by Shicheng Guo7.4k
Please log in to add an answer.

Help
Access

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