Included libraries | Package variables | General documentation | Methods |
WebCvs | Raw content |
P | Description | Code |
_overload | No description | Code |
frame | No description | Code |
homologySeq | Description | Code |
hs | Description | Code |
match | Description | Code |
new | No description | Code |
percent | Description | Code |
positive | Description | Code |
qs | Description | Code |
querySeq | Description | Code |
sbjctSeq | Description | Code |
ss | Description | Code |
P | code | next | Top |
Title : P |
homologySeq | code | prev | next | Top |
Title : homologySeq |
hs | code | prev | next | Top |
Title : hs |
match | code | prev | next | Top |
Title : match |
percent | code | prev | next | Top |
Title : percent |
positive | code | prev | next | Top |
Title : positive |
qs | code | prev | next | Top |
Title : qs |
querySeq | code | prev | next | Top |
Title : querySeq |
sbjctSeq | code | prev | next | Top |
Title : sbjctSeq |
ss | code | prev | next | Top |
Title : ss |
P | description | prev | next | Top |
my ($self, @args) = @_; my $float = $self->significance(@args); my $match = '([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?'; # Perl Cookbook 2.1}
if ($float =~ /^$match$/) { # Is a C float
return $float; } elsif ("1$float" =~ /^$match$/) { # Almost C float, Jitterbug 974
return "1$float"; } else { $self->warn("[HSP::P()] '$float' is not a known number format. Returning zero (0) instead."); return 0; }
_overload | description | prev | next | Top |
my $self = shift; return $self->start."..".$self->end." ".$self->bits;}
frame | description | prev | next | Top |
my ($self, $frame) = @_; if( defined $frame ) { if( $frame == 0 ) { $frame = undef; } elsif( $frame !~ /^([+-])?([1-3])/ ) { $self->warn("Specifying an invalid frame ($frame)"); $frame = undef; } else { # JB 949 - Creates too many warnings for blastx report.}
# Future enhancement to BPLite::_parseHeader needed to set report type
# so that subject strand is used with tblastn and query strand with blastx
# if( ($1 eq '-' && $self->subject->strand >= 0) ||
# ($1 eq '+' && $self->subject->strand <= 0) ) {
# $self->warn("Frame ($frame) did not match strand of query match (".
# $self->subject->strand().")");
# }
# Set frame to GFF [0-2]
$frame = $2 - 1; } } return $self->SUPER::frame($frame); } 1;
homologySeq | description | prev | next | Top |
shift->{'HS'}}
hs | description | prev | next | Top |
shift->{'HS'}}
match | description | prev | next | Top |
shift->query->frac_identical(@_)}
new | description | prev | next | Top |
my ($class, @args) = @_; # workaround to make sure frame is not set before strand is}
# interpreted from query/subject info
# this workaround removes the key from the hash
# so the superclass does not try and work with it
# we'll take care of setting it in this module later on
my %newargs = @args; foreach ( keys %newargs ) { if( /frame$/i ) { delete $newargs{$_}; } } # done with workaround
my $self = $class->SUPER::new(%newargs); my ($score,$bits,$match,$positive,$percent,$p,$qb,$qe,$sb,$se,$qs, $ss,$hs,$qname,$sname,$qlength,$slength, $frame) = $self->_rearrange([qw(SCORE BITS MATCH POSITIVE PERCENT P QUERYBEGIN QUERYEND SBJCTBEGIN SBJCTEND QUERYSEQ SBJCTSEQ HOMOLOGYSEQ QUERYNAME SBJCTNAME QUERYLENGTH SBJCTLENGTH FRAME )],@args); # Store the aligned query as sequence feature
if ($qe > $qb) { # normal query: start < end
$self->query( Bio::SeqFeature::Similarity->new (-start=>$qb, -end=>$qe, -strand=>1, -source=>"BLAST" ) ) } else { # reverse query (i dont know if this is possible, but feel free to correct)
$self->query( Bio::SeqFeature::Similarity->new (-start=>$qe, -end=>$qb, -strand=>-1, -source=>"BLAST" ) ) } # store the aligned subject as sequence feature
if ($se > $sb) { # normal subject
$self->subject( Bio::SeqFeature::Similarity->new (-start=>$sb, -end=>$se, -strand=>1, -source=>"BLAST" ) ) } else { # reverse subject: start bigger than end
$self->subject( Bio::SeqFeature::Similarity->new (-start=>$se, -end=>$sb, -strand=>-1, -source=>"BLAST" ) ) } # name the sequences
if($self->query->can('seq_id')){ $self->query->seq_id($qname); # query
$self->subject->seq_id($sname); # subject
}else{ $self->query->seqname($qname); # query
$self->subject->seqname($sname); # subject
} # set lengths
$self->query->seqlength($qlength); # query
$self->subject->seqlength($slength); # subject
# set object vars
$self->score($score); $self->bits($bits); $self->significance($p); $self->query->frac_identical($match); $self->subject->frac_identical($match); # $self->{'PERCENT'} = int( (1000 * $match) / $self->query->length ) / 10;
# $self->{'PERCENT'} = 100 * ($match / $self->subject->length);
$self->{'PERCENT'} = defined($percent) ? $percent : 100 * ($match / $self->subject->length);
$self->{'POSITIVE'} = $positive; $self->{'QS'} = $qs; $self->{'SS'} = $ss; $self->{'HS'} = $hs; defined $frame && $self->frame($frame); return $self; # success - we hope!
} # to disable overloading comment this out:
percent | description | prev | next | Top |
shift->{'PERCENT'}}
positive | description | prev | next | Top |
shift->{'POSITIVE'}}
qs | description | prev | next | Top |
shift->{'QS'}}
querySeq | description | prev | next | Top |
shift->{'QS'}}
sbjctSeq | description | prev | next | Top |
shift->{'SS'}}
ss | description | prev | next | Top |
shift->{'SS'}}