Skip to content
Snippets Groups Projects
Commit cbd832b9 authored by Alessandro Vullo's avatar Alessandro Vullo
Browse files

Added case of db adaptor for production database

parent c19c7bd7
No related branches found
No related tags found
No related merge requests found
......@@ -150,6 +150,7 @@ my %group2adaptor = (
'ontology' => 'Bio::EnsEMBL::DBSQL::OntologyDBAdaptor',
'otherfeatures' => 'Bio::EnsEMBL::DBSQL::DBAdaptor',
'pipeline' => 'Bio::EnsEMBL::Pipeline::DBSQL::DBAdaptor',
'production' => 'Bio::EnsEMBL::Production::DBSQL::DBAdaptor',
'snp' => 'Bio::EnsEMBL::ExternalData::SNPSQL::DBAdaptor',
'stable_ids' => 'Bio::EnsEMBL::DBSQL::DBAdaptor',
'variation' => 'Bio::EnsEMBL::Variation::DBSQL::DBAdaptor',
......@@ -1587,6 +1588,9 @@ sub load_registry_from_db {
my $ontology_db;
my $ontology_version;
my $production_db;
my $production_version;
my $stable_ids_db;
my $stable_ids_version;
......@@ -1652,6 +1656,19 @@ sub load_registry_from_db {
$ontology_db = $db;
$ontology_version = $1;
}
} elsif ( $db =~ /^ensembl(?:genomes)?_production(_\d+)?/x ) {
# production db can come with no version (i.e. that on ens-staging1),
# but it's backed up with a release number
my $version = $1;
if ($version) {
$version =~ s/_//;
if ($software_version and $version eq $software_version) {
$production_db = $db;
$production_version = $version;
}
} else { # this is the default choice
$production_db = $db if $db =~ /^ensembl(?:genomes)?_production$/;
}
} elsif ( $db =~ /^ensembl(?:genomes)?_stable_ids_(?:\d+_)?(\d+)/x ) {
if ( $1 eq $software_version ) {
$stable_ids_db = $db;
......@@ -2127,6 +2144,30 @@ sub load_registry_from_db {
print("No ontology database found\n");
}
# Production
if ( defined($production_db) ) {
require Bio::EnsEMBL::Production::DBSQL::DBAdaptor;
my $dba =
Bio::EnsEMBL::Production::DBSQL::DBAdaptor->new(
'-species' => 'multi' . $species_suffix,
'-group' => 'production',
'-host' => $host,
'-port' => $port,
'-user' => $user,
'-pass' => $pass,
'-dbname' => $production_db, );
if ($verbose) {
printf( "%s loaded\n", $production_db );
}
}
elsif ($verbose) {
print("No production database found\n");
}
# Stable IDs
if ( defined($stable_ids_db) && $stable_ids_version != 0 ) {
......@@ -2155,6 +2196,9 @@ sub load_registry_from_db {
-species => 'multi'.$species_suffix,
-alias => ['ontology'.$species_suffix] );
Bio::EnsEMBL::Utils::ConfigRegistry->add_alias(
-species => 'multi'.$species_suffix,
-alias => ['production'.$species_suffix] );
Bio::EnsEMBL::Utils::ConfigRegistry->add_alias(
-species => 'multi'.$species_suffix,
......
......@@ -142,7 +142,9 @@ my %grouping_of_biotypes = (
'short_noncoding'=> [qw( miRNA misc_RNA Mt_tRNA
rRNA snoRNA snRNA
)],
# practical Ensembl core categories for fasta dumping
# protein coding/pseudogene
'cdna' => [qw( protein_coding polymorphic_pseudogene IG_V_gene TR_V_gene
IG_J_gene TR_J_gene IG_D_gene IG_C_gene TR_C_gene pseudogene
retrotransposed IG_V_pseudogene TR_V_pseudogene
......@@ -150,10 +152,15 @@ my %grouping_of_biotypes = (
antisense ambiguous_orf transcribed_processed_pseudogene
disrupted_domain processed_pseudogene
)],
# protein coding transcript
# protein coding
'peptide_producing' => [qw( protein_coding polymorphic_pseudogene IG_V_gene TR_V_gene
IG_J_gene TR_J_gene IG_D_gene IG_C_gene TR_C_gene IG_LV_gene
nonsense_mediated_decay
)],
# short/long noncoding
'ncrna' => [qw( ncRNA miRNA miRNA_pseudogene misc_RNA misc_RNA_pseudogene Mt_tRNA
Mt_tRNA_pseudogene Mt_rRNA rRNA rRNA_pseudogene scRNA_pseudogene
snoRNA snoRNA_pseudogene snRNA snRNA_pseudogene tRNA_pseudogene
......
......@@ -18,15 +18,15 @@ SequenceOntologyMapper - Translates EnsEMBL objects into Sequence Ontology terms
use Bio::EnsEMBL::Utils::SequenceOntologyMapper
# get an Ensembl feature somehow in $feature
# get an Ensembl feature somehow in scalar $feature
...
...
my $ontology_adaptor = $registry->get_adaptor( 'Multi', 'Ontology', 'OntologyTerm' );
my $mapper = SequenceOntologyMapper->new($ontology_adaptor);
print $mapper->to_SO_accession($feature), "\n";
print $mapper->to_SO_name($feature), "\n";
print $mapper->to_accession($feature), "\n";
print $mapper->to_name($feature), "\n";
=head1 DESCRIPTION
......@@ -90,7 +90,6 @@ my %transcript_so_mapping =
'3prime_overlapping_ncrna' => 'SO:0000483',
'TR_V_gene' => 'SO:0000466',
'TR_V_pseudogene' => 'SO:0000336',
'TR_J_gene' => 'SO:0000470',
'IG_C_gene' => 'SO:0000478',
'IG_C_pseudogene' => 'SO:0000336',
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment