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
1f7e3f27
Commit
1f7e3f27
authored
17 years ago
by
Patrick Meidl
Browse files
Options
Downloads
Patches
Plain Diff
added last_status()
parent
75c83af4
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/Utils/AssemblyProjector.pm
+26
-5
26 additions, 5 deletions
modules/Bio/EnsEMBL/Utils/AssemblyProjector.pm
with
26 additions
and
5 deletions
modules/Bio/EnsEMBL/Utils/AssemblyProjector.pm
+
26
−
5
View file @
1f7e3f27
...
@@ -41,6 +41,8 @@ utility class to post-process projections from one assembly to another
...
@@ -41,6 +41,8 @@ utility class to post-process projections from one assembly to another
undef, 'NCBIM36');
undef, 'NCBIM36');
my $new_slice = $assembly_projector->old_to_new($slice);
my $new_slice = $assembly_projector->old_to_new($slice);
print $new_slice->name, " (", $assembly_projector->last_status, ")\n";
=head1 DESCRIPTION
=head1 DESCRIPTION
...
@@ -64,7 +66,8 @@ Discard the projected feature/slice if:
...
@@ -64,7 +66,8 @@ Discard the projected feature/slice if:
4. all segments are on same chromosome and strand
4. all segments are on same chromosome and strand
If a projection fails any of these rules, undef is returned instead of a
If a projection fails any of these rules, undef is returned instead of a
projected feature/slice.
projected feature/slice. You can use the last_status() method to find out about
the results of the rules tests.
Also note that when projecting features, only a shallow projection is performed,
Also note that when projecting features, only a shallow projection is performed,
i.e. other features attached to your features (e.g. the transcripts of a gene)
i.e. other features attached to your features (e.g. the transcripts of a gene)
...
@@ -203,8 +206,10 @@ sub new {
...
@@ -203,8 +206,10 @@ sub new {
seq_region and strand. If -MERGE_FRAGMENTS is set, gaps will be
seq_region and strand. If -MERGE_FRAGMENTS is set, gaps will be
bridged by creating a single object from first_segment_start to
bridged by creating a single object from first_segment_start to
last_segment_end. If -CHECK_LENGTH is set, the projected object
last_segment_end. If -CHECK_LENGTH is set, the projected object
will have to have the same length as the original. Please see
will have to have the same length as the original. You can use
the comments in the code for more details about these rules.
the last_status() method to find out what the result of some of
these rule tests were. Please see the comments in the code for
more details about these rules.
The return value of this method will always be a single object,
The return value of this method will always be a single object,
or undef if the projection fails any of the rules.
or undef if the projection fails any of the rules.
...
@@ -290,19 +295,25 @@ sub project {
...
@@ -290,19 +295,25 @@ sub project {
# as the original feature/slice
# as the original feature/slice
# 4. all segments are on same chromosome and strand
# 4. all segments are on same chromosome and strand
# keep track of the status of applied rules
my
@status
=
();
# test (1)
# test (1)
return
undef
unless
(
@segments
);
return
undef
unless
(
@segments
);
#warn "DEBUG: passed test 1\n";
#warn "DEBUG: passed test 1\n";
# test (2)
# test (2)
return
undef
if
(
!
(
$self
->
merge_fragments
)
and
scalar
(
@segments
)
>
1
);
return
undef
if
(
!
(
$self
->
merge_fragments
)
and
scalar
(
@segments
)
>
1
);
push
@status
,
'
fragmented
'
if
(
scalar
(
@segments
)
>
1
);
#warn "DEBUG: passed test 2\n";
#warn "DEBUG: passed test 2\n";
# test (3)
# test (3)
my
$first_slice
=
$segments
[
0
]
->
to_Slice
;
my
$first_slice
=
$segments
[
0
]
->
to_Slice
;
my
$last_slice
=
$segments
[
-
1
]
->
to_Slice
;
my
$last_slice
=
$segments
[
-
1
]
->
to_Slice
;
return
undef
if
(
$self
->
check_length
and
my
$length_mismatch
=
((
$last_slice
->
end
-
$first_slice
->
start
+
1
)
!=
(
$last_slice
->
end
-
$first_slice
->
start
+
1
)
!=
$object
->
length
);
$object
->
length
);
return
undef
if
(
$self
->
check_length
and
$length_mismatch
);
push
@status
,
'
length_mismatch
'
if
(
$length_mismatch
);
#warn "DEBUG: passed test 3\n";
#warn "DEBUG: passed test 3\n";
# test (4)
# test (4)
...
@@ -316,6 +327,9 @@ sub project {
...
@@ -316,6 +327,9 @@ sub project {
return
undef
if
(
scalar
(
keys
%sr_names
)
>
1
or
scalar
(
keys
%strands
)
>
1
);
return
undef
if
(
scalar
(
keys
%sr_names
)
>
1
or
scalar
(
keys
%strands
)
>
1
);
#warn "DEBUG: passed test 4\n";
#warn "DEBUG: passed test 4\n";
# remember rule status
$self
->
last_status
(
join
('
|
',
@status
));
# everything looks fine, so adjust the coords of your feature/slice
# everything looks fine, so adjust the coords of your feature/slice
my
$new_slice
=
$first_slice
;
my
$new_slice
=
$first_slice
;
$new_slice
->
{'
end
'}
=
$last_slice
->
end
;
$new_slice
->
{'
end
'}
=
$last_slice
->
end
;
...
@@ -426,6 +440,13 @@ sub check_length {
...
@@ -426,6 +440,13 @@ sub check_length {
}
}
sub
last_status
{
my
$self
=
shift
;
$self
->
{'
last_status
'}
=
shift
if
(
@
_
);
return
$self
->
{'
last_status
'};
}
1
;
1
;
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