Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl
Commits
791bb28a
Commit
791bb28a
authored
Nov 01, 2010
by
Andreas Kusalananda Kähäri
Browse files
Handle ASMPATCH and LRG genes.
parent
447682a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
10 deletions
+31
-10
modules/Bio/EnsEMBL/IdMapping/StableIdGenerator/EnsemblGeneric.pm
...Bio/EnsEMBL/IdMapping/StableIdGenerator/EnsemblGeneric.pm
+31
-10
No files found.
modules/Bio/EnsEMBL/IdMapping/StableIdGenerator/EnsemblGeneric.pm
View file @
791bb28a
...
...
@@ -132,7 +132,12 @@ sub initial_stable_id {
my
$s_dbh
=
$s_dba
->
dbc
->
db_handle
;
# look in the ${type}_stable_id table first
my
$sql
=
qq(SELECT MAX(stable_id) FROM ${type}_stable_id)
;
my
$sql
=
qq(
SELECT MAX(stable_id)
FROM ${type}_stable_id
WHERE stable_id LIKE "ENS%"
)
;
$init_stable_id
=
$self
->
fetch_value_from_db
(
$s_dbh
,
$sql
);
# also look in gene_archive to make sure there are no larger Ids there
...
...
@@ -178,16 +183,23 @@ sub initial_stable_id {
=cut
sub
increment_stable_id
{
my
$self
=
shift
;
my
$self
=
shift
;
my
$stable_id
=
shift
;
unless
(
$self
->
is_valid
(
$stable_id
))
{
throw
("
Unknown or missing stable ID
:
$stable_id
.
"
);
if
(
!
$self
->
is_valid
(
$stable_id
)
)
{
throw
(
sprintf
(
"
Unknown or missing stable ID
'%s'
",
$stable_id
)
);
}
$stable_id
=~
/ENS([A-Z]{1,4})(\d{11})/
;
my
$number
=
$
2
;
my
$new_stable_id
=
'
ENS
'
.
$
1
.
(
++
$number
);
if
(
$stable_id
=~
/^LRG/
)
{
throw
(
sprintf
(
"
We do not increment LRG genes... (got '%s').
"
.
"
Something's wrong.
",
$stable_id
)
);
}
$stable_id
=~
/(ENS|ASMPATCH)([A-Z]{1,4})(\d{11})/
;
my
$number
=
$
3
;
my
$new_stable_id
=
$
1
.
$
2
.
(
++
$number
);
return
$new_stable_id
;
}
...
...
@@ -210,8 +222,17 @@ sub increment_stable_id {
=cut
sub
is_valid
{
my
(
$self
,
$stable_id
)
=
@_
;
return
(
$stable_id
and
(
$stable_id
=~
/ENS([A-Z]{1,4})(\d{11})/
));
my
(
$self
,
$stable_id
)
=
@_
;
if
(
defined
(
$stable_id
)
)
{
if
(
$stable_id
=~
/^(ENS|ASMPATCH)([A-Z]{1,4})(\d{11})/
||
$stable_id
=~
/^LRG/
)
{
return
1
;
}
}
return
0
;
}
...
...
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