Bio::EnsEMBL::Analysis::RunnableDB BestPmatch
Included librariesPackage variablesGeneral documentationMethods
Toolbar
WebCvsRaw content
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Analysis::Config::GeneBuild::Pmatch qw ( BESTPMATCH_BY_LOGIC )
Bio::EnsEMBL::Analysis::Runnable::BestPmatch
Bio::EnsEMBL::Analysis::RunnableDB::BaseGeneBuild
Bio::EnsEMBL::Analysis::Tools::GeneBuildUtils qw ( empty_Object )
Bio::EnsEMBL::DnaPepAlignFeature
Bio::EnsEMBL::Utils::Argument qw ( rearrange )
Bio::EnsEMBL::Utils::Exception qw ( throw warning )
Inherit
Unavailable
Synopsis
No synopsis!
Description
No description!
Methods
INPUT_DB
No description
Code
MIN_COVERAGE
No description
Code
OUTPUT_DB
No description
Code
PMATCH_LOGIC_NAME
No description
Code
fetch_input
No description
Code
get_adaptor
No description
Code
new
No description
Code
pmatch_features
No description
Code
read_and_check_config
No description
Code
run
No description
Code
Methods description
None available.
Methods code
INPUT_DBdescriptionprevnextTop
sub INPUT_DB {
  my ($self, $arg) = @_;
  if($arg){
    $self->{'INPUT_DB'} = $arg;
  }
  return $self->{'INPUT_DB'};
}
MIN_COVERAGEdescriptionprevnextTop
sub MIN_COVERAGE {
  my ($self, $arg) = @_;
  if($arg){
    $self->{'MIN_COVERAGE'} = $arg;
  }
  return $self->{'MIN_COVERAGE'} = $arg;
}
OUTPUT_DBdescriptionprevnextTop
sub OUTPUT_DB {
  my ($self, $arg) = @_;
  if($arg){
    $self->{'OUTPUT_DB'} = $arg;
  }
  return $self->{'OUTPUT_DB'};
}
PMATCH_LOGIC_NAMEdescriptionprevnextTop
sub PMATCH_LOGIC_NAME {
  my ($self, $arg) = @_;
  if($arg){
    $self->{'PMATCH_LOGIC_NAME'} = $arg;
  }
  return $self->{'PMATCH_LOGIC_NAME'};
}
fetch_inputdescriptionprevnextTop
sub fetch_input {
  my ($self) = @_;
  my $pafa = $self->get_dbadaptor($self->INPUT_DB)->get_ProteinAlignFeatureAdaptor;  
  my @features ;
   
  if ( ref($self->PMATCH_LOGIC_NAME)=~m/ARRAY/ ) {   
     for my  $logic_name  (@{ $self->PMATCH_LOGIC_NAME}) {   
        my @f = @{$pafa->fetch_all_by_logic_name($logic_name)} ; 
        print "Have fetched ".@f." with logic_name : $logic_name from ".$pafa->dbc->dbname."\n"; 
        push @features, @f ;  
     }  
  } else {  
    @features = @{$pafa->fetch_all_by_logic_name($self->PMATCH_LOGIC_NAME)} ; 
    print "Have fetched ".@features." with logic_name : ".$self->PMATCH_LOGIC_NAME." from ".$pafa->dbc->dbname."\n";
  }  
  $self->pmatch_features(\@features);
}
get_adaptordescriptionprevnextTop
sub get_adaptor {
  my ($self) = @_;
  my $output_db = $self->get_dbadaptor($self->OUTPUT_DB);
  return $output_db->get_ProteinAlignFeatureAdaptor;
}
newdescriptionprevnextTop
sub new {
  my ($class,@args) = @_;
  my $self = $class->SUPER::new(@args);

  print "\nReading config : Bio/EnsEMBL/Analysis/Config/GeneBuild/Pmatch.pm\n\n" ; 
  $self->read_and_check_config($BESTPMATCH_BY_LOGIC);
  return $self;
}
pmatch_featuresdescriptionprevnextTop
sub pmatch_features {
  my ($self, $features) = @_;
  if($features){
    if(ref($features) eq "ARRAY"){
      push(@{$self->{'pmatch_features'}}, @$features);
    }else{
      push(@{$self->{'pmatch_features'}}, $features);
    }
  }
  return $self->{'pmatch_features'};
}
read_and_check_configdescriptionprevnextTop
sub read_and_check_config {
  my $self = shift;

  $self->SUPER::read_and_check_config($BESTPMATCH_BY_LOGIC);
  
  #######
#CHECKS
#######
foreach my $config_var (qw(PMATCH_LOGIC_NAME OUTPUT_DB INPUT_DB)){ throw("You must define $config_var in config for logic '". $self->analysis->logic_name."'") if not defined $self->$config_var; } };
}
rundescriptionprevnextTop
sub run {
  my ($self) = @_;
  my $pmf2 = Bio::EnsEMBL::Analysis::Runnable::BestPmatch->
    new( 
        '-protein_hits' => $self->pmatch_features,
        '-min_coverage' => $self->MIN_COVERAGE,
        '-analysis' => $self->analysis,
       );
  $pmf2->run;
  my @output = @{$pmf2->output};
  foreach my $output(@output){
    empty_Object($output);
  }
  #my @unique = $self->uniquify(@output);
$self->output(\@output);
}
General documentation
No general documentation available.