Entering edit mode
7.2 years ago
warlock.naren
•
0
Can you teach me how to convert .fa file into .fq file through cmd?
I am really new to linux.
Can you teach me how to convert .fa file into .fq file through cmd?
I am really new to linux.
download this : https://code.google.com/archive/p/fasta-to-fastq/
and :
perl fasta_to_fastq.pl reads.fasta > my_converted_fasta.fq
linearize the fasta with awk. Use a second awk to convert to a fastq. Use '#' as the default quality:
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' input.fa | awk '{L=length($2);printf("@%s\n%s\n+\n",substr($1,2),$2);for(i=0;i<L;++i) printf("#");printf("\n");}'
reformat.sh
from BBMap suite. reformat.sh in=your_file.fa out=your_fastq.fq qfake=30
(adjust Q value as desired, it is fake anyway).
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
I'm not sure if you are aware of this but I would like to point out that a fasta file does not contain the required information to produce a fastq file. A conversion to something which looks like a fastq is possible as shown by the answers below, but the basecall quality scores will be dummy values and not reflect anything real or relevant.