I am trying to convert file format from fa to fq using seqkit on Linux terminal. Command is simple as shown below.

seqkit fq2fa Std_metabat2_bin.9_sub.fa -o Std_metabat2_bin.9_sub.fq -j 20 

But, I have over 200 files (fa file of metagenome bins) and am wondering if there is better way than converting one file at one time.


One solution is to use a for loop to convert all the .fa files in the directory:

for file in *.fa; do seqkit fq2fa "$file" -o $(basename "$file" .fa).fq -j 20; done

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.