This is a test version of Biostars. For the public version, visit https://www.biostars.org.
fasta to fastq without quality scores

is it possible to convert fasta to fastq format without quality scores? if not how one can get quality scores of fasta sequences already in the genebank? i am retrieving sequences of clone libraries which are longer than HTP sequences and available only in fasta format. i have to process these files in QIIME pipeline

sequence next-gen sequencing rna-seq

2 answers

Seqtk can do this, here using # as the fake quality score:

seqtk seq -F '#' in.fa > out.fq

Seem seqtk seq has no -F option:

  • seqtk seq -F seq: invalid option -- 'F'

Usage: seqtk seq [options] <in.fq>|<in.fa>

Options: -q INT mask bases with quality lower than INT [0]

     -X INT    mask bases with quality higher than INT [255]
     -n CHAR   masked bases converted to CHAR; 0 for lowercase [0]
     -l INT    number of residues per line; 0 for 2^32-1 [0]
     -Q INT    quality shift: ASCII-INT gives base quality [33]
     -s INT    random seed (effective with -f) [11]
     -f FLOAT  sample FLOAT fraction of sequences [1]
     -M FILE   mask regions in BED or name list FILE [null]
     -L INT    drop sequences with length shorter than INT [0]
     -c        mask complement region (effective with -M)
     -r        reverse complement
     -A        force FASTA output (discard quality)
     -C        drop comments at the header lines
     -N        drop sequences containing ambiguous bases
     -1        output the 2n-1 reads only
     -2        output the 2n reads only
     -V        shift quality by '(-Q) - 33'
     -U        convert all bases to uppercases
     -S        strip of white spaces in sequences
Usage:   seqtk seq [options] <in.fq>|<in.fa>

Options: -q INT    mask bases with quality lower than INT [0]
         -X INT    mask bases with quality higher than INT [255]
         -n CHAR   masked bases converted to CHAR; 0 for lowercase [0]
         -l INT    number of residues per line; 0 for 2^32-1 [0]
         -Q INT    quality shift: ASCII-INT gives base quality [33]
         -s INT    random seed (effective with -f) [11]
         -f FLOAT  sample FLOAT fraction of sequences [1]
         -M FILE   mask regions in BED or name list FILE [null]
         -L INT    drop sequences with length shorter than INT [0]
         -F CHAR   fake FASTQ quality []
         -c        mask complement region (effective with -M)
         -r        reverse complement
         -A        force FASTA output (discard quality)
         -C        drop comments at the header lines
         -N        drop sequences containing ambiguous bases
         -1        output the 2n-1 reads only
         -2        output the 2n reads only
         -V        shift quality by '(-Q) - 33'
         -U        convert all bases to uppercases
         -S        strip of white spaces in sequences

-F CHAR fake FASTQ quality []

Make sure you have the current version.

Hi there. I am also trying to replace my 4th line quality scores with fake ones, but it does not work although I have the latest seqtk. Do you know what could be wrong or if there are other possible solutions? Cheers!

You can convert fasta to fastq with fake quality scores with reformat.sh from the BBMap / BBTools package.

But are you sure you need to do this? Can't QIIME process fasta files?

P. S.: what are "HTP sequences".

I converted fastq file to fasta using the following command - seqtk seq -aQ64 sample1.fastq > sample1.fasta

but in output - i am getting other words besides A, T , G, C- for example - W & R

CACACWCAACCCAGGTATGCATGCACATGCACGTCCATCTGCACACTCAACCCAAGCATGTGCACACACRCACACTTGTACACACACACTCAACCCAAGCACATGTGCAGTT

Can anyone tell why I am getting this result and what is the interpretation of this type of result?

Log in to answer this question.