my $runnable = Bio::EnsEMBL::Analysis::Runnable::Spliced_elsewhere ->new
(
'-genes' => \@genes_array_ref,
'-analysis' => $analysis_object,
);
$runnable->run;
$output = $runnable->output
sub db
{ my ($self, $db) = @_;
if ($db) {
$self->find_file($db);
$self->{'_db'} = $db;
}
return $self->{'_db'}; } |
sub new
{ my ($class,@args) = @_;
my $self = $class->SUPER::new(@args);
$self->{'_genes'} = [];
my($genes,$PS_MULTI_EXON_DIR) =
rearrange([qw( GENES
PS_MULTI_EXON_DIR
)], @args);
$self->genes($genes);
$self->PS_MULTI_EXON_DIR($PS_MULTI_EXON_DIR);
$self->db($self->PS_MULTI_EXON_DIR."/all_multi_exon_genes.fasta");
return $self; } |
sub output
{ my ($self, $hash_ref) = @_;
if ($hash_ref) {
push @{$self->{'_output'}},$hash_ref;
}
return $self->{'_output'}; } |
sub run_blast
{ my ($self,$gene)=@_;
my $bplitewrapper = Bio::EnsEMBL::Analysis::Tools::BPliteWrapper-> new
(
-query_type => 'dna',
-database_type => 'dna',
);
my %output_hash;
foreach my $trans (@{$gene->get_all_Transcripts}){
next unless ($trans->translateable_seq);
my $query = $trans->feature_Slice->expand(1000,1000)->get_repeatmasked_seq;
my $test = $trans->feature_Slice->get_repeatmasked_seq->seq;
$test =~ s/N//g;
unless ( length($test) > 5 ) {
print STDOUT "ignoring " . $trans->display_id. " all Ns\n ";
$output_hash{$trans->dbID}= 'REPEATS';
$self->output(\%output_hash);
return 1;
}
print $trans->stable_id if ( $trans->stable_id ) ;
my $blast = Bio::EnsEMBL::Analysis::Runnable::Blast->new
('-query' => $query,
'-program' => 'blastn',
'-database' => $self->db,
'-threshold' => 1e-50,
'-parser' => $bplitewrapper,
'-options' => 'V=10',
'-analysis' => $self->analysis,
);
eval {
$blast->run();
};
if ($@) {
$self->throw("Problem with Blast $@\n ");
} else {
if ( $blast->output ) {
$output_hash{$trans->dbID}= $blast->output;
} else {
$output_hash{$trans->dbID}= 'NONE';
}
}
}
$self->output(\%output_hash);
return 1;
}
} |