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
58b9dc56
Commit
58b9dc56
authored
14 years ago
by
Andreas Kusalananda Kähäri
Browse files
Options
Downloads
Patches
Plain Diff
In new(): Make sure we know what we're testing for.
Also get rid of inconsistency pointed out by Michael S.
parent
d7895e7d
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/CoordSystem.pm
+32
-26
32 additions, 26 deletions
modules/Bio/EnsEMBL/CoordSystem.pm
with
32 additions
and
26 deletions
modules/Bio/EnsEMBL/CoordSystem.pm
+
32
−
26
View file @
58b9dc56
...
@@ -122,60 +122,66 @@ sub new {
...
@@ -122,60 +122,66 @@ sub new {
my
$self
=
$class
->
SUPER::
new
(
@
_
);
my
$self
=
$class
->
SUPER::
new
(
@
_
);
my
(
$name
,
$version
,
$top_level
,
$sequence_level
,
$default
,
$rank
)
=
my
(
$name
,
$version
,
$top_level
,
$sequence_level
,
$default
,
$rank
)
=
rearrange
(['
NAME
','
VERSION
','
TOP_LEVEL
',
'
SEQUENCE_LEVEL
',
rearrange
(
[
'
NAME
',
'
VERSION
',
'
DEFAULT
',
'
RANK
'],
@
_
);
'
TOP_LEVEL
',
'
SEQUENCE_LEVEL
',
'
DEFAULT
',
'
RANK
'
],
@
_
);
throw
('
The NAME argument is required
')
if
(
!
$name
);
$version
=
''
if
(
!
defined
(
$version
)
);
$version
=
''
if
(
!
defined
(
$version
));
$top_level
=
(
$top_level
)
?
1
:
0
;
$sequence_level
=
(
$sequence_level
)
?
1
:
0
;
$top_level
=
(
$top_level
)
?
1
:
0
;
$default
=
(
$default
)
?
1
:
0
;
$sequence_level
=
(
$sequence_level
)
?
1
:
0
;
$default
=
(
$default
)
?
1
:
0
;
$rank
||=
0
;
$rank
||=
0
;
if
(
$top_level
)
{
if
(
$top_level
==
1
)
{
if
(
$rank
)
{
if
(
$rank
==
1
)
{
throw
('
RANK argument must be 0 if TOP_LEVEL is 1
');
throw
('
RANK argument must be 0 if TOP_LEVEL is 1
');
}
}
if
(
$name
)
{
if
(
defined
(
$name
)
)
{
if
(
$name
ne
'
toplevel
')
{
if
(
$name
ne
'
toplevel
'
)
{
throw
('
The NAME argument must be "toplevel" if TOP_LEVEL is 1
')
throw
('
The NAME argument must be "toplevel" if TOP_LEVEL is 1
')
;
}
}
}
else
{
}
else
{
$name
=
'
toplevel
';
$name
=
'
toplevel
';
}
}
if
(
$sequence_level
)
{
if
(
$sequence_level
==
1
)
{
throw
("
SEQUENCE_LEVEL argument must be 0 if TOP_LEVEL is 1
");
throw
("
SEQUENCE_LEVEL argument must be 0 if TOP_LEVEL is 1
");
}
}
$default
=
0
;
$default
=
0
;
}
else
{
}
else
{
if
(
!
$rank
)
{
throw
("
RANK argument must be non-zero if not toplevel CoordSystem
");
if
(
$rank
==
0
)
{
throw
("
RANK argument must be non-zero unless TOP_LEVEL is 1
");
}
}
if
(
$name
eq
'
toplevel
')
{
throw
("
Cannot name coord system 'toplevel' unless TOP_LEVEL is 1
");
if
(
!
defined
(
$name
)
)
{
throw
('
The NAME argument is required
');
}
elsif
(
$name
eq
'
toplevel
'
)
{
throw
(
"
Cannot name coord system 'toplevel'
"
.
"
unless TOP_LEVEL is 1
"
);
}
}
}
}
if
(
$rank
!~
/^\d+$/
)
{
if
(
$rank
!~
/^\d+$/
)
{
throw
('
The RANK argument must be a positive integer
');
throw
('
The RANK argument must be a positive integer
');
}
}
$self
->
{'
version
'}
=
$version
;
$self
->
{'
version
'}
=
$version
;
$self
->
{'
name
'}
=
$name
;
$self
->
{'
name
'}
=
$name
;
$self
->
{'
top_level
'}
=
$top_level
;
$self
->
{'
top_level
'}
=
$top_level
;
$self
->
{'
sequence_level
'}
=
$sequence_level
;
$self
->
{'
sequence_level
'}
=
$sequence_level
;
$self
->
{'
default
'}
=
$default
;
$self
->
{'
default
'}
=
$default
;
$self
->
{'
rank
'}
=
$rank
;
$self
->
{'
rank
'}
=
$rank
;
return
$self
;
return
$self
;
}
}
## end sub new
=head2 name
=head2 name
...
...
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