This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Convert Fas/Qual Into Fastq?

How can I convert a fasta file with it's associated qual file into a fastq file?

Example:

==> contigs.fas <==
>Contig1 2221 reads, 573 bases
CAAGGAAGTGCTCCAGRAGCTGCAGGTGGGAATTCTCTTGCTTCAACAATAACGTCTCTTTCAGAAGGCATTGGTATCT
TTTCCCCACTTCCAAGCATTTTTTCAACTAATCTTATGTTATTAACCATTTCCTTAAATTCTTCTGGGTCTGCTGACAA
AGCATGATCAGGACCTTCCATATTTTTATCTAAGGTAAAGTGCTTCTCAATAACATCCGCTCCTAAGGCAACAGAAACT
ACTGGGGCGAGTATTCCCAATGTATGGTCAGAATATCCCACAGGGATATTGAATATACTTTTCAAGGTTTTAATAGCGT
TTAAATTGACATCTTCATAAGGGGTTGGGTAAGATGAAATACAATGCAATAAAATAATATCCCTGCATCCATTATTTTC
TAAAACTTTAACTGCTTCCCAAATTTCCCCAATATCAGACATTCCTGTAGATAAAATCACCGGCTTGCCTGTTTTTGCC
ACTTTTTCTAATAAGGGATAAAAGGTTAAATCACCAGAGGCAATTTTAAATCAGGCACATAAAAAAAAAAAGAAAAAAA
AAARCTCCTAGTAGACGATC
>Contig2 1005 reads, 266 bases
[...]

==> contigs.qual <==
>Contig1 2221 reads, 573 bases
49 48 42 50 42 47 37 46 45 47 43 41 39 33 43 38 33 52 53 65 46 63 55 46 59 48 
20 31 30 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 
90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 
90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 
90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 
90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 
90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 
90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 
90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 
[...]
fastq fasta quality conversion

5 answers

This was asked before and I have posted a script. I will dig it out for you...

Try the perl-script here:

How to convert 454 data to SAM format?

There are a range of scripts provided by the Bio-Linux team at their code corner including one to Convert FASTQ to .fasta and .qual files and vice-versa

http://nebc.nerc.ac.uk/tools/code-corner/scripts/sequence-formatting-and-other-text-manipulation

Check it out.

I had to do this very thing yesterday, and used a script I found off SEQAnswers: http://seqanswers.com/forums/showthread.php?t=2775

Try using the galaxy platform which can help you a lot usegalaxy.org for some free public server(s).

fastaq is a comand-line utility available in Linux (ubuntu). Hope this can help:

sudo apt-get install fastaq
fastaq fasta_to_fastq in.fna in.qual out.fastq

Log in to answer this question.