Bio::SeqFeature
SimilarityPair
Summary
Bio::SeqFeature::SimilarityPair - Sequence feature based on the similarity
of two sequences.
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
$sim_pair = Bio::SeqFeature::SimilarityPair->from_searchResult($blastHit);
$sim = $sim_pair->query(); # a Bio::SeqFeature::Similarity object - the query
$sim = $sim_pair->hit(); # dto - the hit.
# some properties for the similarity pair
$expect = $sim_pair->significance();
$score = $sim_pair->score();
$bitscore = $sim_pair->bits();
# this will not write the description for the sequence (only its name)
print $sim_pair->query()->gff_string(), "\n";
Description
Lightweight similarity search result as a pair of Similarity
features. This class inherits off Bio::SeqFeature::FeaturePair and
therefore implements Bio::SeqFeatureI, whereas the two features of the
pair are descendants of Bio::SeqFeature::Generic, with better support
for representing similarity search results in a cleaner way.
Methods
Methods description
Title : new Usage : my $similarityPair = new Bio::SeqFeature::SimilarityPair (-hit => $hit, -query => $query, -source => 'blastp'); Function: Initializes a new SimilarityPair object Returns : Bio::SeqFeature::SimilarityPair Args : -query => The query in a Feature pair -hit => (formerly '-subject') the subject/hit in a Feature pair |
Title : query Usage : $query_feature = $obj->query(); $obj->query($query_feature); Function: The query object for this similarity pair Returns : Bio::SeqFeature::Similarity Args : [optional] Bio::SeqFeature::Similarity
See Bio::SeqFeature::Similarity, Bio::SeqFeature::FeaturePair |
Title : subject Usage : $sbjct_feature = $obj->subject(); $obj->subject($sbjct_feature); Function: Get/Set Subject for a SimilarityPair Returns : Bio::SeqFeature::Similarity Args : [optional] Bio::SeqFeature::Similarity Notes : Deprecated. Use the method 'hit' instead |
Title : hit Usage : $sbjct_feature = $obj->hit(); $obj->hit($sbjct_feature); Function: Get/Set Hit for a SimilarityPair Returns : Bio::SeqFeature::Similarity Args : [optional] Bio::SeqFeature::Similarity |
Title : source_tag Usage : $source = $obj->source_tag(); # i.e., program $obj->source_tag($evalue); Function: Gets the source tag (program name typically) for a feature Returns : string Args : [optional] string |
Title : significance Usage : $evalue = $obj->significance(); $obj->significance($evalue); Function: Returns : Args : |
Title : score Usage : $score = $obj->score(); $obj->score($value); Function: Returns : Args : |
Title : bits Usage : $bits = $obj->bits(); $obj->bits($value); Function: Returns : Args : |
Methods code
sub new
{ my($class,@args) = @_;
if(! grep { lc($_) eq "-feature_factory"; } @args) {
my $fact = Bio::Factory::ObjectFactory->new(
-type => "Bio::SeqFeature::Similarity",
-interface => "Bio::SeqFeatureI");
push(@args, '-feature_factory', $fact);
}
my $self = $class->SUPER::new(@args);
my ($primary, $hit, $query, $fea1, $source,$sbjct) =
$self->_rearrange([qw(PRIMARY
HIT
QUERY
FEATURE1
SOURCE
SUBJECT
)],@args);
if( $sbjct ) {
if(! $hit) { $hit = $sbjct }
else {
$self->warn("-hit and -subject were specified, using -hit and ignoring -subject");
}
}
$self->query( $query) if $query && ! $fea1;
$hit && $self->hit($hit);
if( defined $primary || ! defined $self->primary_tag) {
$primary = 'similarity' unless defined $primary;
$self->primary_tag($primary);
}
$source && $self->source_tag($source);
return $self;} |
sub query
{ return shift->feature1(@_); } |
sub subject
{ my $self = shift;
$self->hit(@_); } |
sub hit
{ return shift->feature2(@_); } |
sub source_tag
{ my ($self, @args) = @_;
if(@args) {
$self->hit()->source_tag(@args);
}
return $self->query()->source_tag(@args);} |
sub significance
{ my ($self, @args) = @_;
if(@args) {
$self->hit()->significance(@args);
}
return $self->query()->significance(@args);} |
sub score
{ my ($self, @args) = @_;
if(@args) {
$self->hit()->score(@args);
}
return $self->query()->score(@args);} |
sub bits
{ my ($self, @args) = @_;
if(@args) {
$self->hit()->bits(@args);
}
return $self->query()->bits(@args);} |
General documentation
User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to one
of the Bioperl mailing lists. Your participation is much appreciated.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Report bugs to the Bioperl bug tracking system to help us keep track
the bugs and their resolution. Bug reports can be submitted via the
web:
http://bugzilla.open-bio.org/
The rest of the documentation details each of the object
methods. Internal methods are usually preceded with a _