This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Python/Perl Script For Defining Minimum Coverage Of Blast Match

Hi - does anyone know of a script that allows for a blast result to be filtered by the minimum total coverage of the query/subject that the alignment/s represent?

I'm imagining a script that calculates the total length of all HSPs between a query and a subject and then compares that to the length of the query and subject sequences. I'll write the script myself if I have to but I would have thought someone would have done it already.

Cheers,

Tim

blast

Thanks - Michael. I googled but not with 'Perl' in the search. I can't code in Perl at all but I'll get some help from a colleague to understand the script you linked to. If anyone knows of something similar Python I'd be very grateful. Cheers

Welcome to Biostars, Could you make this a comment please, because now it looks as if there were two answers at first glance.

1 answer

By googling, I found this example as first hit: http://betascience.blogspot.no/2010/01/filtering-blast-hits-by-coverage-using.html

It uses the methods frac_aligned_query() and frac_aligned_hit() from Bio::Search::Hit::GenericHit, these are not in the interface Bio::Root::Root Bio::Search::Hit::HitI which most examples use, but they give you a coverage directly.

Nice, that this helped. I googled for "BioPerl coverage blast" btw. I guessed that Biopython has almost identical functionality, but I didn't find a similar method.

In BioPerl these are calculated on the fly for the hits IIRC. These require tiling of the HSPs; bioperl has code that does this (my guess is it may be a matter of time before something similar exists in biopython).

Log in to answer this question.