Bio::EnsEMBL::Analysis::RunnableDB
MissingOrthologues
Toolbar
Summary
Bio::EnsEMBL::Analysis::RunnableDB::MissingOrthologues;
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
my $orthologueanalysis = Bio::EnsEMBL::Analysis::RunnableDB::MissingOrthologues->new(
-analysis => $analysis_obj,
);
$orthologueanalysis->fetch_input();
$orthologueanalysis->run();
$orthologueanalysis->output();
$orthologueanalysis->write_output();
Description
This object wraps Bio::EnsEMBL::Analysis::Runnable::OrthologueEvaluator and is
used to fetch the input from different databases as well as writing results
the results to the database.a
Methods
check_transcript | No description | Code |
fetch_input | No description | Code |
filter_homologies | No description | Code |
get_longest_transcripts | No description | Code |
new | No description | Code |
read_and_check_config | No description | Code |
run | No description | Code |
write_output | No description | Code |
Methods description
None available.
Methods code
check_transcript | description | prev | next | Top |
sub check_transcript
{ my $tr = shift ;
my $transstr = $tr->translate->seq;
$transstr =~ s/(.{1,60})/$1\n/g;
if ($transstr =~m/\*/ ) {
print "SKIPPING " . $tr->translation->stable_id .
" : translation contain stop codon\n$transstr\n\n";
return undef ;
}
return $tr ; } |
sub fetch_input
{ my( $self ) = @_;
$self->get_initial_geneset($self->species_1, $$FIND_MISSING_ORTHOLOGUES{DEFAULT_GENE_BIOTYPES}) ; } |
sub filter_homologies
{ my ( $all_homologies , $look_for_this_species) = @_ ;
my @result ;
HOMOLOGIES :for my $homology ( @$all_homologies ) {
my @all_member_attributes = @{$homology->get_all_Member_Attribute} ;
shift @all_member_attributes ;
MA: foreach my $member_attribute (@all_member_attributes) {
my ($new_member, $attribute) = @{$member_attribute};
my $species_name_of_orthologue = $new_member->genome_db->name ;
if ( $species_name_of_orthologue =~m/$look_for_this_species/) {
push @result, $homology ;
}
}
}
return\@ result ; } |
sub get_longest_transcripts
{ my ($ga, $stable_ids) = @_ ;
my @cds ;
GENES : for my $sid (@$stable_ids ) {
my $gene = $ga->fetch_by_stable_id ($sid) ;
my $maxlen = 0;
my $nexonmax = 0;
my $longest_transcript;
foreach my $trans (@{$gene->get_all_Transcripts}) {
my $len = 0;
if ($trans->translation) {
my @trans_exons = @{$trans->get_all_translateable_Exons()};
foreach my $exon (@trans_exons) {
$len+= $exon->length;
}
if ($len > $maxlen) {
$maxlen = $len;
$longest_transcript = $trans;
$nexonmax = scalar($trans->get_all_Exons)
}
}
}
if (!defined($longest_transcript)) {
print "No longest_transcript transcript found for " . $gene->stable_id . "\n" ;
next GENES ;
}
my $transstr = $longest_transcript->translate->seq;
$transstr =~ s/(.{1,60})/$1\n/g;
if ($transstr =~m/\*/ ) {
print "SKIPPING " . $longest_transcript->translation->stable_id .
" : translation contain stop codon\n$transstr\n\n";
next GENES ;
}
my $cds = $longest_transcript->translate ;
$cds->display_id( $longest_transcript->translation->stable_id) ;
push @cds, $cds ;
}
my @rand_cds ;
return shuffle(\@cds) ;
}
1; } |
sub new
{ my ($class,@args) = @_;
my $self = $class->SUPER::new(@args);
$self->read_and_check_config ;
$self->verbose(1) ;
my $trusted_one2one_set= $$FIND_MISSING_ORTHOLOGUES{ANALYSIS_SETS}{$self->post_logic_name};
print "Searching for 1:1 orthoologues between $$trusted_one2one_set[0] and $$trusted_one2one_set[1]\n" ;
$self->species_1($$trusted_one2one_set[0]) ;
$self->species_2($$trusted_one2one_set[1]) ;
return $self;
}
} |
sub read_and_check_config
{ (my $self) = @_ ;
$self->SUPER::read_and_check_config();
my %config_hash = %{$FIND_MISSING_ORTHOLOGUES};
}
} |
sub run
{ my ($self) = @_;
my $query_spec = $$MAIN_CONFIG{QUERY_SPECIES};
my (%missing_orth,%trusted_orth);
QUERY_GENES : for my $gene_spec1 (@{$self->genes} ) {
my $tg1_homol = get_one2one_orth_for_gene_in_other_species($gene_spec1 ,$self->species_2) ;
if ( $tg1_homol ) {
$trusted_orth{$gene_spec1->stable_id}=1;
foreach my $homolog_to_check ( @{ $gene_spec1->get_all_homologous_Genes()} ) {
my ($check_homg, $check_homology, $check_species ) = @$homolog_to_check ;
if ($check_species eq $query_spec ) {
next QUERY_GENES ;
}else {
$missing_orth{$gene_spec1->stable_id} = $gene_spec1 ;
}
}
} else {
}
}
for ( keys %missing_orth) {
print "missing_orthologue: $_\n";
}
print scalar( keys %missing_orth)." missing orthologues identifed beteen " . $self->species_1 .
" and $query_spec ( using " . $self->species_2 ." as informant )\n";
my @input_id_file_names ;
my @longest_transcripts;
for my $stable_id ( keys %missing_orth ) {
my ($ltr, $m,$n) = get_transcript_with_longest_CDS($missing_orth{$stable_id}) ;
unless (contains_internal_stops($ltr)){
push @longest_transcripts, $ltr;
} else {
print "Skipping transcript because it contains internal stops\n" ;
}
}
my @cds ;
for my $tr ( @longest_transcripts ) {
my $cds = $tr->translate;
$cds->display_id($tr->translation->stable_id ) ;
push @cds, $cds ;
}
$self->output(shuffle(\@cds)) ; } |
sub write_output
{ my ($self) = @_;
my $written_files = $self->chunk_and_write_fasta_sequences( $self->output) ;
if ( $written_files ) {
print scalar(@$written_files) . " fasta-files written for " . $self->species_1."\n" ;
$self->upload_input_ids( $written_files );
print STDERR "input_ids uploaded\n" ;
} else {
print STDERR "NO input_ids uploaded\n" ;
} } |
General documentation
Post general queries to ensembl-dev@ebi.ac.uk
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a '_'