Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
79f41006
Commit
79f41006
authored
Jun 27, 2008
by
Ian Longden
Browse files
DBAdaptor examples replaced with registry ones. This was confusing people on the API course
parent
440d7c18
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
62 additions
and
29 deletions
+62
-29
modules/Bio/EnsEMBL/DBSQL/AnalysisAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/AnalysisAdaptor.pm
+6
-3
modules/Bio/EnsEMBL/DBSQL/AssemblyMapperAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/AssemblyMapperAdaptor.pm
+8
-3
modules/Bio/EnsEMBL/DBSQL/CoordSystemAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/CoordSystemAdaptor.pm
+8
-2
modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm
+7
-4
modules/Bio/EnsEMBL/DBSQL/ProteinFeatureAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/ProteinFeatureAdaptor.pm
+8
-8
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
+8
-3
modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm
+7
-3
modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm
+10
-3
No files found.
modules/Bio/EnsEMBL/DBSQL/AnalysisAdaptor.pm
View file @
79f41006
...
...
@@ -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');
...
...
modules/Bio/EnsEMBL/DBSQL/AssemblyMapperAdaptor.pm
View file @
79f41006
...
...
@@ -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');
...
...
modules/Bio/EnsEMBL/DBSQL/CoordSystemAdaptor.pm
View file @
79f41006
...
...
@@ -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:
...
...
modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm
View file @
79f41006
...
...
@@ -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_
GeneA
daptor();
$gene_adaptor =
Bio::EnsEMBL::Registry
->get_
a
daptor(
"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)};
...
...
modules/Bio/EnsEMBL/DBSQL/ProteinFeatureAdaptor.pm
View file @
79f41006
...
...
@@ -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_P
rotein
F
eature
Adaptor(
);
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", "p
rotein
f
eature
"
);
my @prot_feats = @{$pfa->fetch_all_by_translation_id(1231)};
...
...
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
View file @
79f41006
...
...
@@ -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');
...
...
modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm
View file @
79f41006
...
...
@@ -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);
...
...
modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm
View file @
79f41006
...
...
@@ -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);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment