Skip to content
Browse files

Hmmer3: When a hit description is too long, it is truncated in

the Scores table, so use the more complete description from
the Annotation line (>>) in those cases
  • Loading branch information...
1 parent f786730 commit 74c88d254215dd1879e23488cd308033d0fce6f9 @fjossandon fjossandon committed Jan 17, 2014
Showing with 15 additions and 4 deletions.
  1. +13 −2 Bio/SearchIO/hmmer3.pm
  2. +2 −2 t/SearchIO/hmmer.t
View
15 Bio/SearchIO/hmmer3.pm
@@ -518,11 +518,22 @@ sub next_result {
last;
}
- if ( $_ =~ m/^\>\>\s(.*?)\s+/ ) {
- $name = $1;
+ if ( $_ =~ m/^\>\>\s(\S*)\s+(.*)/ ) {
+ $name = $1;
+ my $desc = $2;
$annot_counter++;
$domaincounter{"$name.$annot_counter"} = 0;
+ # The Hit Description from the Scores table can be truncated if
+ # its too long, so use the '>>' line description when its longer
+ if (length $hit_list[
+ $hitinfo{"$name.$annot_counter"}
+ ]
+ [1] < length $desc
+ ) {
+ $hit_list[ $hitinfo{"$name.$annot_counter"} ][1] = $desc;
+ }
+
while ( defined( $_ = $self->_readline ) ) {
if ( $_ =~ m/Internal pipeline statistics/
|| $_ =~ m/Alignments for each domain/
View
4 t/SearchIO/hmmer.t
@@ -1044,7 +1044,7 @@ my @multi_hits = (
]
],
[ 'HemolysinCabind',
- 'Hemolysin-type calcium-binding repeat (2 cop',
+ 'Hemolysin-type calcium-binding repeat (2 copies)',
'47.9', 4.7e-13, 3,
[ [ 2, 13, 1214, 1225, 5.9, 0.0026 ],
[ 1, 18, 1231, 1248, 10.8, 6.8e-5 ],
@@ -1127,7 +1127,7 @@ $searchio = Bio::SearchIO->new(
@multi_hits = (
[ 'HTH_AraC',
- 'Bacterial regulatory helix-turn-helix proteins, Ara',
+ 'Bacterial regulatory helix-turn-helix proteins, AraC family',
'41.3', 6.7e-11, 2,
[ [ 'siadiAeevgfSpsyfsrlFkkytGvt', 'SLMELSRQVGLNDCTLKRGFRLVFDTT' ],
[ 'nwsiadiAeevgf-SpsyfsrlFkkytGvtPsqyr',

0 comments on commit 74c88d2

Please sign in to comment.
Something went wrong with that request. Please try again.