Python/Perl Script For Defining Minimum Coverage Of Blast Match
1
0
Entering edit mode
11.1 years ago

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 • 3.8k views
ADD COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Sorry will do in future

ADD REPLY
2
Entering edit mode
11.1 years ago
Michael 55k

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 COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 1520 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6