convert FASTA into FASTQ using linux
4
2
Entering edit mode
9.5 years ago
rhoney45 ▴ 20

Hiiii....If anyone can please helo me how to convert fasta files into fastq using ubuntu....i shall be very thank ful....

sequence • 31k views
ADD COMMENT
10
Entering edit mode
5.4 years ago
GenoMax 141k

For those who may happen to reach this thread by way of search in future you can convert a fasta file to fastq format using reformat.sh from BBMap suite.

Please remember that the Q-scores created here are fake (example below sets Q-scores to 35 for all bases).

reformat.sh in=test.fa out=fake.fq qfake=35

ADD COMMENT
8
Entering edit mode
9.5 years ago
Manvendra Singh ★ 2.2k

There is a perl script here

Usage is

perl fasta_to_fastq.pl reads.fasta > my_converted_fasta.fq
ADD COMMENT
0
Entering edit mode

Note: This assumes a qual score of 40. Nice tool though!

ADD REPLY
0
Entering edit mode

very nice script, Thank you so much! It also works on Mac!

ADD REPLY
0
Entering edit mode

please, the qual string length is one base longer than the sequence length. Could you advise how to solve it?

ADD REPLY
0
Entering edit mode

Paste your sequence and qual strings here - maybe that will help figure out what's happening.

ADD REPLY
0
Entering edit mode

Hi! The script works unless I use warnings; If I use it, then it gives a warning:

Use of uninitialized value $header in string ne at fasta_to_fastq.pl line 13, <FILE> line 1.

In line 13 is:

if($header ne "") {

Thank you in advance

ADD REPLY
0
Entering edit mode

See A: Convert from fasta to fastq for an alternative

ADD REPLY
0
Entering edit mode

You'll have to add my $header; somewhere at the top op the script (aka, declare the variable). I would also advise to add use strict; (next to use warnings)

ADD REPLY
6
Entering edit mode
9.5 years ago
Ram 43k

Hi,

FASTQ has more information content than FASTA. The conversion would require that you add some kind of quality scores, most probably some dummy values.

What would really enable us help you better is knowing the purpose behind your quest.

ADD COMMENT

Login before adding your answer.

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