For all the .fq
files in the repaired_reads
directory, I want to convert them to fasta format, where conversion for a single file can be done using:
sed -n '1~4s/^@/>/p;2~4p' INFILE.fq > OUTFILE.fasta
But when I write a for loop to create all the files, I get an error.
for f in `ls -1 ./repaired_reads/*.fq | sed 's/_.fq//'`;
do sed -n '1~4s/^@/>/p;2~4p' $f\.fq > ../fasta/$f\.fasta; # Convert fastq to fasta
done
Traceback:
bash: ../fasta/./repaired_reads/SRR9200813_1.fq.fasta: No such file or directory
bash: ../fasta/./repaired_reads/SRR9200813_2.fq.fasta: No such file or directory
bash: ../fasta/./repaired_reads/SRR9200814_1.fq.fasta: No such file or directory