Question: Python/Perl Script For Defining Minimum Coverage Of Blast Match
0
gravatar for timothy.l.fitzgerald
5.8 years ago by
timothy.l.fitzgerald0 wrote:

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 • 2.6k views
ADD COMMENTlink modified 5.8 years ago • written 5.8 years ago by timothy.l.fitzgerald0

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

ADD REPLYlink written 5.8 years ago by timothy.l.fitzgerald0

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

ADD REPLYlink modified 5.8 years ago • written 5.8 years ago by Michael Dondrup46k

Sorry will do in future

ADD REPLYlink written 5.8 years ago by timothy.l.fitzgerald0
2
gravatar for Michael Dondrup
5.8 years ago by
Bergen, Norway
Michael Dondrup46k wrote:

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.

ADD COMMENTlink written 5.8 years ago by Michael Dondrup46k

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.

ADD REPLYlink modified 5.8 years ago • written 5.8 years ago by Michael Dondrup46k

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).

ADD REPLYlink written 5.8 years ago by Chris Fields2.1k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1630 users visited in the last hour