This is a test version of Biostars. For the public version, visit https://www.biostars.org.
extracting segments from .qual file

Is there anything similar to getfasta (bedtools) but will also work on an associated .qual file in the format:

>Scaff3
50 50 50 50 50 40 40 40 30 30 30 34 34 34 34

I basically need to extract a list of specific segments from the .qual file, and wondering if anyone knows of a suitable tool already available.

qual fasta bedtools

1 answer

You can use pyfaidx for this:

pip install (--user) pyfaidx
faidx scaffolds.qual Scaff3:1-8 Scaff3:4-11
>Scaff3:1-8
50 50 50
>Scaff3:4-11
50 50 50

Since a "qual" file has 3 characters per position, just make sure you count in threes to preserve your formatting.

Log in to answer this question.