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
76e70fcf
Commit
76e70fcf
authored
Jan 28, 2008
by
Andreas Kusalananda Kähäri
Browse files
Allow for seq_region_name to be '0'.
Formatting.
parent
2ede8202
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
+21
-13
modules/Bio/EnsEMBL/Slice.pm
modules/Bio/EnsEMBL/Slice.pm
+21
-13
No files found.
modules/Bio/EnsEMBL/Slice.pm
View file @
76e70fcf
...
...
@@ -129,24 +129,32 @@ sub new {
START END STRAND ADAPTOR EMPTY)
],
@
_
);
#empty is only for backwards compatibility
if
(
$empty
)
{
deprecate
("
Creation of empty slices is no longer needed
"
.
"
and is deprecated
");
return
bless
(
{
'
empty
'
=>
1
,
'
adaptor
'
=>
$adaptor
},
$class
);
if
(
$empty
)
{
deprecate
(
"
Creation of empty slices is no longer needed
"
.
"
and is deprecated
"
);
return
bless
(
{
'
empty
'
=>
1
,
'
adaptor
'
=>
$adaptor
},
$class
);
}
$seq_region_name
||
throw
('
SEQ_REGION_NAME argument is required
');
defined
(
$start
)
||
throw
('
START argument is required
');
defined
(
$end
)
||
throw
('
END argument is required
');
(
$start
<=
$end
+
1
)
||
throw
('
start must be less than or equal to end+1
');
if
(
!
defined
(
$seq_region_name
)
)
{
throw
('
SEQ_REGION_NAME argument is required
');
}
if
(
!
defined
(
$start
)
)
{
throw
('
START argument is required
')
}
if
(
!
defined
(
$end
)
)
{
throw
('
END argument is required
')
}
if
(
$start
>
$end
+
1
)
{
throw
('
start must be less than or equal to end+1
');
}
$seq_region_length
=
$end
if
(
!
defined
(
$seq_region_length
));
if
(
!
defined
(
$seq_region_length
)
)
{
$seq_region_length
=
$end
}
(
$seq_region_length
>
0
)
||
throw
('
SEQ_REGION_LENGTH must be > 0
');
if
(
$seq_region_length
<=
0
)
{
throw
('
SEQ_REGION_LENGTH must be > 0
');
}
if
(
$seq
&&
length
(
$seq
)
!=
(
$end
-
$start
+
1
)){
throw
('
SEQ must be the same length as the defined LENGTH not
'
.
length
(
$seq
)
.
'
compared to
'
.
(
$end
-
$start
+
1
));
if
(
defined
(
$seq
)
&&
length
(
$seq
)
!=
(
$end
-
$start
+
1
)
)
{
throw
(
'
SEQ must be the same length as the defined LENGTH not
'
.
length
(
$seq
)
.
'
compared to
'
.
(
$end
-
$start
+
1
)
);
}
if
(
defined
(
$coord_system
))
{
...
...
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