This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extracting sequence less than N length from FASTA file

How do I extract sequences less than 800 bp from a fasta file, I used the following command to extract but I was not successful in doing so. I still have some sequences more than 800 bp in length.

command: $ awk 'BEGIN {RS = ">" ; ORS = ""} length ($2) <= 800 {print ">"$0}' input.fasta > output.fasta

sequence

Hello atitparajuli2018!

Questions similar to yours can already be found at:

We have closed your question to allow us to keep similar content in the same thread.

If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.

Cheers!

0 answers

No answers yet.

Log in to answer this question.