Cuando lo ejecuto en su forma original me devuelve el listado completo de homologías para la lista de genes y funciona aparentemente bien. Cuando sustituyo la línea correspondiente para que solo me liste los ortólogos de mamíferos no lo admite.
A ver si hay por aquí alguien con experiencia en esta API que me pueda ayudar. Gracias de antemano, majos.
Using perl Syntax Highlighting
use strict;
use warnings;
use Bio::EnsEMBL::Registry;
## Load the registry automatically
my $reg = "Bio::EnsEMBL::Registry";
$reg->load_registry_from_url('mysql://[email protected]');
## Get the human gene adaptor
my $human_gene_adaptor = $reg->get_adaptor("Homo sapiens", "core", "Gene");
## Get the compara member adaptor
my $member_adaptor = $reg->get_adaptor("Compara", "compara", "Member");
## Get the compara homology adaptor
my $homology_adaptor = $reg->get_adaptor("Compara", "compara", "Homology");
## Lista de genes humanos para buscar homologos
my @BreastCANgenes = ('ABCA3','ABCB10','ABCB8','ACADM');
open ("archivo", ">homologos.txt");
my $gen;
foreach $gen (@BreastCANgenes) {
## Get all existing gene object
my $ctdp1_genes = $human_gene_adaptor->fetch_all_by_external_name($gen);
## For each of these genes...
foreach my $ctdp1_gene (@$ctdp1_genes) {
## Get the compara member
my $member = $member_adaptor->fetch_by_source_stable_id("ENSEMBLGENE", $ctdp1_gene->stable_id);
## Get all the homologues
my $all_homologies = $homology_adaptor->fetch_all_by_Member($member);
## For each homology
foreach my $this_homology (@$all_homologies) {
## print the description (type of homology) and the
## subtype (taxonomy level of the event: duplic. or speciation)
print $this_homology->description, " [", $this_homology->subtype, "]\n";
print archivo $this_homology->description, " [", $this_homology->subtype, "]\n";
## print the members in this homology
my $members = $this_homology->get_all_Members();
foreach my $this_member (@$members) {
print archivo $this_member->source_name, " ",
$this_member->stable_id, " (",
$this_member->genome_db->name, ")\n"
}
print "\n";
}
}
}
close ("archivo");
use warnings;
use Bio::EnsEMBL::Registry;
## Load the registry automatically
my $reg = "Bio::EnsEMBL::Registry";
$reg->load_registry_from_url('mysql://[email protected]');
## Get the human gene adaptor
my $human_gene_adaptor = $reg->get_adaptor("Homo sapiens", "core", "Gene");
## Get the compara member adaptor
my $member_adaptor = $reg->get_adaptor("Compara", "compara", "Member");
## Get the compara homology adaptor
my $homology_adaptor = $reg->get_adaptor("Compara", "compara", "Homology");
## Lista de genes humanos para buscar homologos
my @BreastCANgenes = ('ABCA3','ABCB10','ABCB8','ACADM');
open ("archivo", ">homologos.txt");
my $gen;
foreach $gen (@BreastCANgenes) {
## Get all existing gene object
my $ctdp1_genes = $human_gene_adaptor->fetch_all_by_external_name($gen);
## For each of these genes...
foreach my $ctdp1_gene (@$ctdp1_genes) {
## Get the compara member
my $member = $member_adaptor->fetch_by_source_stable_id("ENSEMBLGENE", $ctdp1_gene->stable_id);
## Get all the homologues
my $all_homologies = $homology_adaptor->fetch_all_by_Member($member);
## For each homology
foreach my $this_homology (@$all_homologies) {
## print the description (type of homology) and the
## subtype (taxonomy level of the event: duplic. or speciation)
print $this_homology->description, " [", $this_homology->subtype, "]\n";
print archivo $this_homology->description, " [", $this_homology->subtype, "]\n";
## print the members in this homology
my $members = $this_homology->get_all_Members();
foreach my $this_member (@$members) {
print archivo $this_member->source_name, " ",
$this_member->stable_id, " (",
$this_member->genome_db->name, ")\n"
}
print "\n";
}
}
}
close ("archivo");
Coloreado en 0.006 segundos, usando GeSHi 1.0.8.4
Esta es la versión modificada para obtener solo ortólogos en mamíferos:
Using perl Syntax Highlighting
use strict;
use warnings;
use Bio::EnsEMBL::Registry;
## Load the registry automatically
my $reg = "Bio::EnsEMBL::Registry";
$reg->load_registry_from_url('mysql://[email protected]');
## Get the human gene adaptor
my $human_gene_adaptor = $reg->get_adaptor("Homo sapiens", "core", "Gene");
## Get the compara member adaptor
my $member_adaptor = $reg->get_adaptor("Compara", "compara", "Member");
## Get the compara homology adaptor
my $homology_adaptor = $reg->get_adaptor("Compara", "compara", "Homology");
use Bio::EnsEMBL::Compara::MethodLinkSpeciesSet;
my @BreastCANgenes = ('ABCA3','ABCB10','ABCB8','ACADM');
open ("archivo", ">homologos.txt");
my $gen;
foreach $gen (@BreastCANgenes) {
## Get all existing gene object
my $ctdp1_genes = $human_gene_adaptor->fetch_all_by_external_name($gen);
## For each of these genes...
foreach my $ctdp1_gene (@$ctdp1_genes) {
## Get the compara member
my $member = $member_adaptor->fetch_by_source_stable_id("ENSEMBLGENE", $ctdp1_gene->stable_id);
## Get all the homologues
my $all_homologies
= $homology_adaptor
->fetch_all_by_MethodLinkSpeciesSet_orthology_type_subtype($member,'ortholog_one2one','Mammalia',);
## For each homology
foreach my $this_homology (@$all_homologies) {
## print the description (type of homology) and the
## subtype (taxonomy level of the event: duplic. or speciation)
print $this_homology->description, " [", $this_homology->subtype, "]\n";
print archivo $this_homology->description, " [", $this_homology->subtype, "]\n";
## print the members in this homology
my $members = $this_homology->get_all_Members();
foreach my $this_member (@$members) {
print archivo $this_member->source_name, " ",
$this_member->stable_id, " (",
$this_member->genome_db->name, ")\n"
}
print "\n";
}
}
}
close ("archivo");
use warnings;
use Bio::EnsEMBL::Registry;
## Load the registry automatically
my $reg = "Bio::EnsEMBL::Registry";
$reg->load_registry_from_url('mysql://[email protected]');
## Get the human gene adaptor
my $human_gene_adaptor = $reg->get_adaptor("Homo sapiens", "core", "Gene");
## Get the compara member adaptor
my $member_adaptor = $reg->get_adaptor("Compara", "compara", "Member");
## Get the compara homology adaptor
my $homology_adaptor = $reg->get_adaptor("Compara", "compara", "Homology");
use Bio::EnsEMBL::Compara::MethodLinkSpeciesSet;
my @BreastCANgenes = ('ABCA3','ABCB10','ABCB8','ACADM');
open ("archivo", ">homologos.txt");
my $gen;
foreach $gen (@BreastCANgenes) {
## Get all existing gene object
my $ctdp1_genes = $human_gene_adaptor->fetch_all_by_external_name($gen);
## For each of these genes...
foreach my $ctdp1_gene (@$ctdp1_genes) {
## Get the compara member
my $member = $member_adaptor->fetch_by_source_stable_id("ENSEMBLGENE", $ctdp1_gene->stable_id);
## Get all the homologues
my $all_homologies
= $homology_adaptor
->fetch_all_by_MethodLinkSpeciesSet_orthology_type_subtype($member,'ortholog_one2one','Mammalia',);
## For each homology
foreach my $this_homology (@$all_homologies) {
## print the description (type of homology) and the
## subtype (taxonomy level of the event: duplic. or speciation)
print $this_homology->description, " [", $this_homology->subtype, "]\n";
print archivo $this_homology->description, " [", $this_homology->subtype, "]\n";
## print the members in this homology
my $members = $this_homology->get_all_Members();
foreach my $this_member (@$members) {
print archivo $this_member->source_name, " ",
$this_member->stable_id, " (",
$this_member->genome_db->name, ")\n"
}
print "\n";
}
}
}
close ("archivo");
Coloreado en 0.003 segundos, usando GeSHi 1.0.8.4