| 1 | ############################################################################# | ||||||||||||||||||||||||||||
| 2 | # $Author: markus $ | ||||||||||||||||||||||||||||
| 3 | # $Date: 2009-11-12 17:13:23 +0100 (Thu, 12 Nov 2009) $ | ||||||||||||||||||||||||||||
| 4 | # $Revision: 1844 $ | ||||||||||||||||||||||||||||
| 5 | ############################################################################# | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | package Bio::Grep::SearchResult; | ||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 2 | ▶ | use version; our $VERSION = qv('0.10.6'); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 2 | ▶ | use IO::String; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 2 | ▶ | use base 'Bio::Root::Root'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 2 | ▶ | use Class::MethodMaker [ | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | 2 | new => 'new2', | |||||||||||||||||||||||||||
| 20 | scalar => [ | ||||||||||||||||||||||||||||
| 21 | qw /sequence query begin end alignment sequence_id remark | ||||||||||||||||||||||||||||
| 22 | percent_identity evalue dG/ | ||||||||||||||||||||||||||||
| 23 | ], | ||||||||||||||||||||||||||||
| 24 | 2 | ]; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 27 | 0 | my $self = shift->new2; | |||||||||||||||||||||||||||
| 28 | 0 | my $arg_ref = shift; | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | #initizialize member variables | ||||||||||||||||||||||||||||
| 31 | 0 | for my $key ( keys %{$arg_ref} ) { | |||||||||||||||||||||||||||
| 32 | 0 | $self->$key( $arg_ref->{$key} ); | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | 0 | return $self; | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 0 | ▶ | sub reverse_complement { | ||||||||||||||||||||||||||
|
Subroutine
reverse_complement: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 38 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 39 | 0 | return $self->query->desc =~ m{ \(reverse\scomplement\) \z }xms; | |||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 0 | ▶ | sub mark_subject_uppercase { | ||||||||||||||||||||||||||
|
Subroutine
mark_subject_uppercase: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 43 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 44 | 0 | my $result = $self->sequence->seq; | |||||||||||||||||||||||||||
| 45 | 0 | ▶ | if ( !defined $self->begin || !defined $self->end ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $self->begin && defined $self->end
MC/DC0%0/2
defined $self->begin && defined $self->end
defined $self->begin
defined $self->end
Truth table0%0/3
A && B
A= defined $self->beginB= defined $self->end
| |||||||||||||||||||||||||||||
| 46 | 0 | return lc $result; | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | else { | ||||||||||||||||||||||||||||
| 49 | return | ||||||||||||||||||||||||||||
| 50 | 0 | lc( substr $result, 0, $self->begin ) | |||||||||||||||||||||||||||
| 51 | . uc( substr $result, $self->begin, $self->end - $self->begin ) | ||||||||||||||||||||||||||||
| 52 | . lc substr $result, $self->end; | ||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 0 | ▶ | sub subject { | ||||||||||||||||||||||||||
|
Subroutine
subject: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 57 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 0 | return Bio::Seq->new( | |||||||||||||||||||||||||||
| 60 | -id => $self->sequence->id, | ||||||||||||||||||||||||||||
| 61 | -seq => $self->sequence->subseq( $self->begin + 1, $self->end ) | ||||||||||||||||||||||||||||
| 62 | ); | ||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 0 | ▶ | sub upstream { | ||||||||||||||||||||||||||
|
Subroutine
upstream: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 66 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | 0 | return Bio::Seq->new( | |||||||||||||||||||||||||||
| 69 | -id => $self->sequence->id, | ||||||||||||||||||||||||||||
| 70 | -seq => $self->sequence->subseq( 1, $self->begin ) | ||||||||||||||||||||||||||||
| 71 | ); | ||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | 0 | ▶ | sub downstream { | ||||||||||||||||||||||||||
|
Subroutine
downstream: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 75 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | 0 | return Bio::Seq->new( | |||||||||||||||||||||||||||
| 78 | -id => $self->sequence->id, | ||||||||||||||||||||||||||||
| 79 | -seq => $self->sequence->subseq( | ||||||||||||||||||||||||||||
| 80 | $self->end + 1, | ||||||||||||||||||||||||||||
| 81 | length $self->sequence->seq | ||||||||||||||||||||||||||||
| 82 | ) | ||||||||||||||||||||||||||||
| 83 | ); | ||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | 0 | ▶ | sub alignment_string { | ||||||||||||||||||||||||||
|
Subroutine
alignment_string: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||
| 87 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 88 | 0 | my $result = q{}; | |||||||||||||||||||||||||||
| 89 | 0 | my $str = IO::String->new(); | |||||||||||||||||||||||||||
| 90 | 0 | my $out = Bio::AlignIO->new( -format => 'clustalw', -fh => $str ); | |||||||||||||||||||||||||||
| 91 | 0 | ▶ | if ( !defined $self->alignment ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 92 | 0 | $self->warn('No alignment calculated.'); | |||||||||||||||||||||||||||
| 93 | 0 | return q{}; | |||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||
| 95 | 0 | $out->write_aln( $self->alignment ); | |||||||||||||||||||||||||||
| 96 | 0 | $out->close(); | |||||||||||||||||||||||||||
| 97 | 0 | $str = IO::String->new( ${ $str->string_ref } ); | |||||||||||||||||||||||||||
| 98 | LINE: | ||||||||||||||||||||||||||||
| 99 | 0 | ▶ | while ( my $l = <$str> ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 100 | 0 | ▶ | next LINE if ( $l =~ /CLUSTAL/xms || $l =~ /\A \s+ \z/xms ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$l =~ /CLUSTAL/msx or $l =~ /\A \s+ \z/msx
MC/DC0%0/2
$l =~ /CLUSTAL/msx or $l =~ /\A \s+ \z/msx
$l =~ /CLUSTAL/msx
$l =~ /\A \s+ \z/msx
Truth table0%0/3
A or B
A= $l =~ /CLUSTAL/msxB= $l =~ /\A \s+ \z/msx
| |||||||||||||||||||||||||||||
| 101 | 0 | $result .= $l; | |||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||
| 103 | 0 | return $result; | |||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||
| 106 | 2 | 1; # Magic true value required at end of module | |||||||||||||||||||||||||||
| 107 | __END__ | ||||||||||||||||||||||||||||