Bio::EnsEMBL::Analysis::Tools::Pmatch MergedHit
Included librariesPackage variablesGeneral documentationMethods
Toolbar
WebCvsRaw content
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Utils::Argument qw ( rearrange )
Bio::EnsEMBL::Utils::Exception qw ( verbose throw warning info )
Inherit
Unavailable
Synopsis
No synopsis!
Description
No description!
Methods
add_CoordPairDescriptionCode
coverageDescriptionCode
each_CoordPairDescriptionCode
newDescriptionCode
qendDescriptionCode
qstartDescriptionCode
queryDescriptionCode
strandDescriptionCode
subsume_MergedHitDescriptionCode
targetDescriptionCode
tendDescriptionCode
tstartDescriptionCode
Methods description
add_CoordPaircode    nextTop
 Title   : add_CoordPair
Usage :
Function: adds a CoordPair to the supporting data for this MergedHit
Example :
Returns :
Args :
coveragecodeprevnextTop
 Title   : coverage
Usage :
Function: get/set for coverage (% of target covered by this hit
Example :
Returns :
Args :
each_CoordPaircodeprevnextTop
 Title   : each_CoordPair
Usage :
Function: returns the CoordPairs contibuting to this MergedHit
Example :
Returns :
Args :
newcodeprevnextTop
 Title   : new
Usage :
Function: constructor
Example :
Returns :
Args :
qendcodeprevnextTop
 Title   : qend
Usage :
Function: returns overall end of hit in fpc contig coords
Example :
Returns :
Args :
qstartcodeprevnextTop
 Title   : qstart
Usage :
Function: returns overall start of hit in fpc contig coords
Example :
Returns :
Args :
querycodeprevnextTop
 Title   : query
Usage :
Function: get/set for query (fpccontig name)
Example :
Returns :
Args :
strandcodeprevnextTop
 Title   : strand
Usage :
Function: get/set for (query) strand
Example :
Returns :
Args :
subsume_MergedHitcodeprevnextTop
 Title   : subsume_MergedHit
Usage :
Function: Incorporate all the pairs from another MergedHit into this one
Example :
Returns :
Args :
targetcodeprevnextTop
 Title   : target
Usage :
Function: get/set for target (protein name)
Example :
Returns :
Args :
tendcodeprevnextTop
 Title   : tend
Usage :
Function: returns overall end of hit in protein coords
Example :
Returns :
Args :
tstartcodeprevnextTop
 Title   : tstart
Usage :
Function: returns overall start of hit in protein coords
Example :
Returns :
Args :
Methods code
add_CoordPairdescriptionprevnextTop
sub add_CoordPair {
  my ($self,$pair) = @_;
  $self->throw('No coord pair') unless defined $pair;
  $self->throw('$pair is not a Bio::EnsEMBL::Analysis::Tools::Pmatch::CoordPair') unless $pair->isa("Bio::EnsEMBL::Analysis::Tools::Pmatch::CoordPair");


  push(@{$self->{_coord_pairs}},$pair);
  
  # need to do some sorting?
if ($self->strand == 1) { @{$self->{_coord_pairs}} = sort {$a->qstart <=> $b->qstart} @{$self->{_coord_pairs}}; } else { @{$self->{_coord_pairs}} = sort {$b->qstart <=> $a->qstart} @{$self->{_coord_pairs}}; } $self->tstart(@{$self->{_coord_pairs}}[0]->tstart); $self->qstart(@{$self->{_coord_pairs}}[0]->qstart); $self->tend(@{$self->{_coord_pairs}}[scalar(@{$self->{_coord_pairs}})-1]->tend); $self->qend(@{$self->{_coord_pairs}}[scalar(@{$self->{_coord_pairs}})-1]->qend);
}
coveragedescriptionprevnextTop
sub coverage {
  my ($self,$arg) = @_;
  if ($arg) {
    #if($arg < 0 || $arg > 100){
# throw("coverage is not between 0 and 100");
#}
$self->{'coverage'} = $arg; } return $self->{'coverage'};
}
each_CoordPairdescriptionprevnextTop
sub each_CoordPair {
  my ($self) = @_;
  # sorted by qstart, based on strand
return @{$self->{_coord_pairs}};
}
newdescriptionprevnextTop
sub new {
  my ($class, @args) = @_;
  my $self = bless {}, $class;

  my ($query, $target, $strand,$coverage) = rearrange(['QUERY',
							       'TARGET',
							       'STRAND',
							       'COVERAGE'],@args);

  $self->throw("No query") unless defined $query;
  $self->query($query);

  $self->throw("No target") unless defined $target;
  $self->target($target);

  $self->throw("No strand") unless defined $strand;
  $self->strand($strand);

  $self->throw("No coverage") unless defined $coverage;
  $self->coverage($coverage);

  $self->{'_coord_pairs'} = [];

  return $self;
}
qenddescriptionprevnextTop
sub qend {
  my ($self,$arg) = @_;
  if ($arg) {
    $self->{'qend'} = $arg;
  }
  return $self->{'qend'};
}

1;
}
qstartdescriptionprevnextTop
sub qstart {
  my ($self,$arg) = @_;
  if ($arg) {
    $self->{'qstart'} = $arg;
  }
  return $self->{'qstart'};
}
querydescriptionprevnextTop
sub query {
  my ($self,$arg) = @_;
  if ($arg) {
    $self->{'query'} = $arg;
  }
  return $self->{'query'};
}
stranddescriptionprevnextTop
sub strand {
  my ($self,$arg) = @_;
  if ($arg) {
    $self->{'strand'} = $arg;
  }
  return $self->{'strand'};
}
subsume_MergedHitdescriptionprevnextTop
sub subsume_MergedHit {
  my ($self,$hit) = @_;
  $self->throw('No hit') unless defined $hit;
  $self->throw('$hit is not a Bio::EnsEMBL::Analysis::Tools::Pmatch::MergedHit') unless $hit->isa("Bio::EnsEMBL::Analysis::Tools::Pmatch::MergedHit");

  push(@{$self->{_coord_pairs}},$hit->each_CoordPair);
  
  # need to do some sorting?
if ($self->strand == 1) { @{$self->{_coord_pairs}} = sort {$a->qstart <=> $b->qstart} @{$self->{_coord_pairs}}; } else { @{$self->{_coord_pairs}} = sort {$b->qstart <=> $a->qstart} @{$self->{_coord_pairs}}; } $self->tstart(@{$self->{_coord_pairs}}[0]->tstart); $self->qstart(@{$self->{_coord_pairs}}[0]->qstart); $self->tend(@{$self->{_coord_pairs}}[scalar(@{$self->{_coord_pairs}})-1]->tend); $self->qend(@{$self->{_coord_pairs}}[scalar(@{$self->{_coord_pairs}})-1]->qend);
}
targetdescriptionprevnextTop
sub target {
  my ($self,$arg) = @_;
  if ($arg) {
    $self->{'target'} = $arg;
  }
  return $self->{'target'};
}
tenddescriptionprevnextTop
sub tend {
  my ($self,$arg) = @_;
  if ($arg) {
    $self->{'tend'} = $arg;
  }
  return $self->{'tend'};
}
tstartdescriptionprevnextTop
sub tstart {
  my ($self,$arg) = @_;
  if ($arg) {
    $self->{'tstart'} = $arg;
  }
  return $self->{'tstart'};
}
General documentation
No general documentation available.