Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
5e891d54
Commit
5e891d54
authored
22 years ago
by
Graham McVicker
Browse files
Options
Downloads
Patches
Plain Diff
lite gene adaptor now optionally returns
genes in chromosomal coords from fetch_by_stable_id
parent
75130c9f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/Lite/GeneAdaptor.pm
+26
-7
26 additions, 7 deletions
modules/Bio/EnsEMBL/Lite/GeneAdaptor.pm
with
26 additions
and
7 deletions
modules/Bio/EnsEMBL/Lite/GeneAdaptor.pm
+
26
−
7
View file @
5e891d54
...
...
@@ -224,8 +224,24 @@ sub fetch_by_Slice {
=head2 fetch_by_stable_id
Arg [1] : string $stable_id
Arg [2] : (optional) boolean $chr_coords
flag set to 1 if genes should be retrieves in chromosomal coords
by default they are retrieved in contig coords
Example : $gene = $gene_adaptor->fetch_by_stable_id('ENSG000001432');
Description: Retrieves a gene via its stable id. By default genes are
retrieved in contig coords, but if the chr_coords flag is set
then they may be retrieved in chromosomal corods.
Returntype : Bio::EnsEMBL::Gene
Exceptions : none
Caller : geneview, familyview, general
=cut
sub
fetch_by_stable_id
{
my
(
$self
,
$stable_id
)
=
@_
;
my
(
$self
,
$stable_id
,
$chr_coords
)
=
@_
;
my
$core_db_adaptor
=
$self
->
db
->
get_db_adaptor
('
core
');
my
$sth
=
$self
->
prepare
...
...
@@ -250,9 +266,11 @@ sub fetch_by_stable_id {
my
(
$gene
)
=
@
{
$self
->
_objects_from_sth
(
$sth
,
$slice
)};
#transform gene to RawContig coords:
$gene
->
transform
;
unless
(
$chr_coords
)
{
#transform gene to RawContig coords:
$gene
->
transform
;
}
return
$gene
;
}
...
...
@@ -305,9 +323,10 @@ sub _objects_from_sth {
my
(
$exon_id
);
while
(
my
$hr
=
$sth
->
fetchrow_hashref
()
)
{
if
(
!
defined
$slice
->
chr_name
()
)
{
$slice
->
chr_name
(
$hr
->
{'
chr_name
'}
);
$slice
->
chr_start
(
1
);
unless
(
$slice
->
chr_name
)
{
#retrieve a slice for the entire chromosome
my
$chr
=
$hr
->
{'
chr_name
'};
%$slice
=
%
{
$core_db_adaptor
->
get_SliceAdaptor
->
fetch_by_chr_name
(
$chr
)};
}
if
(
!
exists
$gene_cache
{
$hr
->
{'
db
'}
.
"
-
"
.
$hr
->
{
gene_id
}
}
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment