Commit 79f41006 authored by Ian Longden's avatar Ian Longden
Browse files

DBAdaptor examples replaced with registry ones. This was confusing people on the API course

parent 440d7c18
......@@ -15,11 +15,14 @@ Bio::EnsEMBL::DBSQL::AnalysisAdaptor
=head1 SYNOPSIS
use Bio::EnsEMBL::DBSQL::DBAdaptor;
use Bio::EnsEMBL::Registry;
$db = Bio::EnsEMBL::DBSQL::DBAdaptor->new(...);
Bio::EnsEMBL::Registry->load_registry_from_db(
-host => 'ensembldb.ensembl.org',
-user => 'anonymous'
);
$analysis_adaptor = $db_adaptor->get_AnalysisAdaptor;
$analysis_adaptor = Bio::EnsEMBL::Registry->get_adaptor("human", "core", "analysis");
my $analysis = $analysis_adaptor->fetch_by_logic_name('genscan');
......
......@@ -13,10 +13,15 @@
=head1 SYNOPSIS
my $db = Bio::EnsEMBL::DBSQL::DBAdaptor->new(...);
use Bio::EnsEMBL::Registry;
my $asma = $dba->get_AssemblyMapperAdaptor();
my $csa = $dba->get_CoordSystemAdaptor();
Bio::EnsEMBL::Registry->load_registry_from_db(
-host => 'ensembldb.ensembl.org',
-user => 'anonymous'
);
$asma = Bio::EnsEMBL::Registry->get_adaptor("human", "core", "assemblymapper");
$csa = Bio::EnsEMBL::Registry->get_adaptor("human", "core", "coordsystem");
my $chr33_cs = $csa->fetch_by_name('chromosome', 'NCBI33');
my $chr34_cs = $csa->fetch_by_name('chromosome', 'NCBI34');
......
......@@ -9,9 +9,15 @@ Bio::EnsEMBL::DBSQL::CoordSystemAdaptor
=head1 SYNOPSIS
my $db = Bio::EnsEMBL::DBSQL::DBAdaptor->new(...);
my $csa = $db->get_CoordSystemAdaptor();
use Bio::EnsEMBL::Registry;
Bio::EnsEMBL::Registry->load_registry_from_db(
-host => 'ensembldb.ensembl.org',
-user => 'anonymous'
);
$csa = Bio::EnsEMBL::Registry->get_adaptor("human", "core", "coordsystem");
#
# Get all coord systems in the database:
......
......@@ -7,11 +7,14 @@ storage of Gene objects
=head1 SYNOPSIS
use Bio::EnsEMBL::DBSQL::DBAdaptor;
use Bio::EnsEMBL::Registry;
$dba = Bio::EnsEMBL::DBSQL::DBAdaptor->new(...);
Bio::EnsEMBL::Registry->load_registry_from_db(
-host => 'ensembldb.ensembl.org',
-user => 'anonymous',
);
$gene_adaptor = $dba->get_GeneAdaptor();
$gene_adaptor = Bio::EnsEMBL::Registry->get_adaptor("human", "core", "gene");
$gene = $gene_adaptor->fetch_by_dbID(1234);
......@@ -19,7 +22,7 @@ storage of Gene objects
@genes = @{$gene_adaptor->fetch_all_by_external_name('BRCA2')};
$slice_adaptor = $db->get_SliceAdaptor;
$slice_adaptor = Bio::EnsEMBL::Registry->get_adaptor("human", "core", "slice");;
$slice = $slice_adaptor->fetch_by_region('chromosome', '1', 1, 1000000);
@genes = @{$gene_adaptor->fetch_all_by_Slice($slice)};
......
......@@ -15,14 +15,14 @@ Bio::EnsEMBL::DBSQL::ProteinFeatureAdaptor
=head1 SYNOPSIS
use Bio::EnsEMBL::DBSQL::DBAdaptor;
use Bio::EnsEMBL::DBSQL::ProteinFeatureAdaptor;
$db = new Bio::EnsEMBL::DBSQL::DBAdaptor( -user => 'root',
-db => 'pog' ,
-host => 'caldy' ,
-driver => 'mysql' );
my $pfa = $db->get_ProteinFeatureAdaptor();
use Bio::EnsEMBL::Registry;
Bio::EnsEMBL::Registry->load_registry_from_db(
-host => 'ensembldb.ensembl.org',
-user => 'anonymous'
);
$pfa = Bio::EnsEMBL::Registry->get_adaptor("human", "core", "proteinfeature");
my @prot_feats = @{$pfa->fetch_all_by_translation_id(1231)};
......
......@@ -16,12 +16,17 @@ the creation of Slice objects.
=head1 SYNOPSIS
use Bio::EnsEMBL::DBSQL::DBAdaptor;
use Bio::EnsEMBL::Utils::Slice qw(split_Slices);
use Bio::EnsEMBL::Registry;
Bio::EnsEMBL::Registry->load_registry_from_db(
-host => 'ensembldb.ensembl.org',
-user => 'anonymous'
);
$slice_adaptor = Bio::EnsEMBL::Registry->get_adaptor("human", "core", "slice");
$db = Bio::EnsEMBL::DBSQL::DBAdaptor->new(...);
$slice_adaptor = $db->get_SliceAdaptor();
# get a slice on the entire chromosome X
$chr_slice = $slice_adaptor->fetch_by_region('chromosome','X');
......
......@@ -7,10 +7,14 @@ interaction relating to the storage and retrieval of Transcripts
=head1 SYNOPSIS
$db = Bio::EnsEMBL::DBSQL::DBAdaptor->new(...);
$slice_adaptor = $db->get_SliceAdaptor();
use Bio::EnsEMBL::Registry;
$transcript_adaptor = $db->get_TranscriptAdaptor();
Bio::EnsEMBL::Registry->load_registry_from_db(
-host => 'ensembldb.ensembl.org',
-user => 'anonymous'
);
$transcript_adaptor = Bio::EnsEMBL::Registry->get_adaptor("human", "core", "transcript");
$transcript = $transcript_adaptor->fetch_by_dbID(1234);
......
......@@ -23,10 +23,17 @@ Transcript object first, and then fetching the Translation.
=head1 SYNOPSIS
my $db = Bio::EnsEMBL::DBSQL::DBAdaptor->new(...);
use Bio::EnsEMBL::Registry;
Bio::EnsEMBL::Registry->load_registry_from_db(
-host => 'ensembldb.ensembl.org',
-user => 'anonymous'
);
$transcript_adaptor = Bio::EnsEMBL::Registry->get_adaptor("human", "core", "transcript");
$translation_adaptor = Bio::EnsEMBL::Registry->get_adaptor("human", "core", "translation");
my $transcript_adaptor = $db->get_TranscriptAdaptor();
my $translation_adaptor = $db->get_TranslationAdaptor();
my $transcript = $transcript_adaptor->fetch_by_dbID(131243);
my $translation = $translation_adaptor->fetch_by_Transcript($transcript);
......
Markdown is supported
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