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
9d319d6b
Commit
9d319d6b
authored
17 years ago
by
Andreas Kusalananda Kähäri
Browse files
Options
Downloads
Patches
Plain Diff
More reformatting of my old code.
parent
8625b487
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/Exon.pm
+136
-147
136 additions, 147 deletions
modules/Bio/EnsEMBL/Exon.pm
with
136 additions
and
147 deletions
modules/Bio/EnsEMBL/Exon.pm
+
136
−
147
View file @
9d319d6b
...
...
@@ -376,35 +376,33 @@ sub strand {
=cut
sub
cdna_start
{
my
$self
=
shift
;
my
(
$transcript
)
=
@_
;
if
(
!
defined
$transcript
||
!
ref
$transcript
||
!
$transcript
->
isa
('
Bio::EnsEMBL::Transcript
')
)
{
throw
("
Argument is not a transcript
");
}
my
$self
=
shift
;
my
(
$transcript
)
=
@_
;
my
$transcript_id
=
$transcript
->
dbID
();
if
(
!
defined
(
$transcript
)
||
!
ref
(
$transcript
)
||
!
$transcript
->
isa
('
Bio::EnsEMBL::Transcript
')
)
{
throw
("
Argument is not a transcript
");
}
if
(
!
exists
$self
->
{'
cdna_start
'}
->
{
$transcript_id
}
)
{
my
@coords
=
$transcript
->
genomic2cdna
(
$self
->
start
(),
$self
->
end
(),
$self
->
strand
()
);
my
$transcript_id
=
$transcript
->
dbID
();
if
(
@coords
&&
!
$coords
[
0
]
->
isa
('
Bio::EnsEMBL::Mapper::Gap
')
)
{
$self
->
{'
cdna_start
'}
->
{
$transcript_id
}
=
$coords
[
0
]
->
start
();
}
elsif
(
@coords
)
{
throw
("
First part of exon maps into a gap
");
}
else
{
throw
("
Can not map exon
");
}
if
(
!
exists
(
$self
->
{'
cdna_start
'}
->
{
$transcript_id
}
)
)
{
my
@coords
=
$transcript
->
genomic2cdna
(
$self
->
start
(),
$self
->
end
(),
$self
->
strand
()
);
if
(
@coords
&&
!
$coords
[
0
]
->
isa
('
Bio::EnsEMBL::Mapper::Gap
')
)
{
$self
->
{'
cdna_start
'}
->
{
$transcript_id
}
=
$coords
[
0
]
->
start
();
}
elsif
(
@coords
)
{
throw
("
First part of exon maps into a gap
");
}
else
{
throw
("
Can not map exon
");
}
}
return
$self
->
{'
cdna_start
'}
->
{
$transcript_id
};
return
$self
->
{'
cdna_start
'}
->
{
$transcript_id
};
}
## end sub cdna_start
=head2 cdna_end
...
...
@@ -428,34 +426,33 @@ sub cdna_start {
=cut
sub
cdna_end
{
my
$self
=
shift
;
my
(
$transcript
)
=
@_
;
if
(
!
defined
$transcript
||
!
ref
$transcript
||
!
$transcript
->
isa
('
Bio::EnsEMBL::Transcript
')
)
{
throw
("
Argument is not a transcript
");
}
my
$self
=
shift
;
my
(
$transcript
)
=
@_
;
if
(
!
defined
(
$transcript
)
||
!
ref
(
$transcript
)
||
!
$transcript
->
isa
('
Bio::EnsEMBL::Transcript
')
)
{
throw
("
Argument is not a transcript
");
}
my
$transcript_id
=
$transcript
->
dbID
();
my
$transcript_id
=
$transcript
->
dbID
();
if
(
!
exists
$self
->
{'
cdna_end
'}
->
{
$transcript_id
}
)
{
my
@coords
=
$transcript
->
genomic2cdna
(
$self
->
start
(),
$self
->
end
(),
$self
->
strand
()
);
if
(
!
exists
(
$self
->
{'
cdna_end
'}
->
{
$transcript_id
}
)
)
{
my
@coords
=
$transcript
->
genomic2cdna
(
$self
->
start
(),
$self
->
end
(),
$self
->
strand
()
);
if
(
@coords
&&
!
$coords
[
-
1
]
->
isa
('
Bio::EnsEMBL::Mapper::Gap
')
)
{
$self
->
{'
cdna_end
'}
->
{
$transcript_id
}
=
$coords
[
-
1
]
->
end
();
}
elsif
(
@coords
)
{
throw
("
Last part of exon maps into gap
");
}
else
{
throw
("
Can not map exon
");
}
if
(
@coords
&&
!
$coords
[
-
1
]
->
isa
('
Bio::EnsEMBL::Mapper::Gap
')
)
{
$self
->
{'
cdna_end
'}
->
{
$transcript_id
}
=
$coords
[
-
1
]
->
end
();
}
elsif
(
@coords
)
{
throw
("
Last part of exon maps into gap
");
}
else
{
throw
("
Can not map exon
");
}
}
return
$self
->
{'
cdna_end
'}
->
{
$transcript_id
};
return
$self
->
{'
cdna_end
'}
->
{
$transcript_id
};
}
## end sub cdna_end
=head2 cdna_coding_start
...
...
@@ -478,60 +475,56 @@ sub cdna_end {
=cut
sub
cdna_coding_start
{
my
$self
=
shift
;
my
(
$transcript
)
=
@_
;
if
(
!
defined
$transcript
||
!
ref
$transcript
||
!
$transcript
->
isa
('
Bio::EnsEMBL::Transcript
')
)
{
throw
("
Argument is not a transcript
");
}
my
$self
=
shift
;
my
(
$transcript
)
=
@_
;
my
$transcript_id
=
$transcript
->
dbID
();
if
(
!
defined
(
$transcript
)
||
!
ref
(
$transcript
)
||
!
$transcript
->
isa
('
Bio::EnsEMBL::Transcript
')
)
{
throw
("
Argument is not a transcript
");
}
my
$transcript_id
=
$transcript
->
dbID
();
if
(
!
exists
(
$self
->
{'
cdna_coding_start
'}
->
{
$transcript_id
}
)
)
{
my
$transcript_coding_start
=
$transcript
->
cdna_coding_start
();
if
(
!
defined
(
$transcript_coding_start
)
)
{
# This is a non-coding transcript.
$self
->
{'
cdna_coding_start
'}
->
{
$transcript_id
}
=
undef
;
$self
->
{'
cdna_coding_end
'}
->
{
$transcript_id
}
=
undef
;
}
else
{
my
$cdna_start
=
$self
->
cdna_start
(
$transcript
);
if
(
$transcript_coding_start
<
$cdna_start
)
{
# Coding region starts upstream of this exon...
if
(
!
exists
$self
->
{'
cdna_coding_start
'}
->
{
$transcript_id
}
)
{
my
$transcript_coding_start
=
$transcript
->
cdna_coding_start
();
if
(
$transcript
->
cdna_coding_end
()
<
$cdna_start
)
{
# ... and also ends upstream of this exon.
$self
->
{'
cdna_coding_start
'}
->
{
$transcript_id
}
=
undef
;
}
else
{
# ... and does not end upstream of this exon.
$self
->
{'
cdna_coding_start
'}
->
{
$transcript_id
}
=
$cdna_start
;
}
}
else
{
# Coding region starts either within or downstream of this
# exon.
if
(
!
defined
$transcript_coding_start
)
{
# This is a non-coding transcript.
$self
->
{'
cdna_coding_start
'}
->
{
$transcript_id
}
=
undef
;
$self
->
{'
cdna_coding_end
'}
->
{
$transcript_id
}
=
undef
;
if
(
$transcript_coding_start
<=
$self
->
cdna_end
(
$transcript
)
)
{
# Coding region starts within this exon.
$self
->
{'
cdna_coding_start
'}
->
{
$transcript_id
}
=
$transcript_coding_start
;
}
else
{
my
$cdna_start
=
$self
->
cdna_start
(
$transcript
);
if
(
$transcript_coding_start
<
$cdna_start
)
{
# Coding region starts upstream of this exon...
if
(
$transcript
->
cdna_coding_end
()
<
$cdna_start
)
{
# ... and also ends upstream of this exon.
$self
->
{'
cdna_coding_start
'}
->
{
$transcript_id
}
=
undef
;
}
else
{
# ... and does not end upstream of this exon.
$self
->
{'
cdna_coding_start
'}
->
{
$transcript_id
}
=
$cdna_start
;
}
}
else
{
# Coding region starts either within or downstream of this
# exon.
if
(
$transcript_coding_start
<=
$self
->
cdna_end
(
$transcript
)
)
{
# Coding region starts within this exon.
$self
->
{'
cdna_coding_start
'}
->
{
$transcript_id
}
=
$transcript_coding_start
;
}
else
{
# Coding region starts downstream of this exon.
$self
->
{'
cdna_coding_start
'}
->
{
$transcript_id
}
=
undef
;
}
}
}
## end else [ if ( !defined $transcript_coding_start)
}
## end if ( !exists $self->{'cdna_coding_start'...
return
$self
->
{'
cdna_coding_start
'}
->
{
$transcript_id
};
# Coding region starts downstream of this exon.
$self
->
{'
cdna_coding_start
'}
->
{
$transcript_id
}
=
undef
;
}
}
}
## end else [ if ( !defined($transcript_coding_start...
}
## end if ( !exists( $self->{...
return
$self
->
{'
cdna_coding_start
'}
->
{
$transcript_id
};
}
## end sub cdna_coding_start
=head2 cdna_coding_end
...
...
@@ -554,60 +547,56 @@ sub cdna_coding_start {
=cut
sub
cdna_coding_end
{
my
$self
=
shift
;
my
(
$transcript
)
=
@_
;
if
(
!
defined
$transcript
||
!
ref
$transcript
||
!
$transcript
->
isa
('
Bio::EnsEMBL::Transcript
')
)
{
throw
("
Argument is not a transcript
");
}
my
$self
=
shift
;
my
(
$transcript
)
=
@_
;
if
(
!
defined
(
$transcript
)
||
!
ref
(
$transcript
)
||
!
$transcript
->
isa
('
Bio::EnsEMBL::Transcript
')
)
{
throw
("
Argument is not a transcript
");
}
my
$transcript_id
=
$transcript
->
dbID
();
my
$transcript_id
=
$transcript
->
dbID
();
if
(
!
exists
$self
->
{'
cdna_coding_end
'}
->
{
$transcript_id
}
)
{
my
$transcript_coding_end
=
$transcript
->
cdna_coding_end
();
if
(
!
exists
(
$self
->
{'
cdna_coding_end
'}
->
{
$transcript_id
}
)
)
{
my
$transcript_coding_end
=
$transcript
->
cdna_coding_end
();
if
(
!
defined
$transcript_coding_end
)
{
# This is a non-coding transcript.
$self
->
{'
cdna_coding_start
'}
->
{
$transcript_id
}
=
undef
;
$self
->
{'
cdna_coding_end
'}
->
{
$transcript_id
}
=
undef
;
if
(
!
defined
(
$transcript_coding_end
)
)
{
# This is a non-coding transcript.
$self
->
{'
cdna_coding_start
'}
->
{
$transcript_id
}
=
undef
;
$self
->
{'
cdna_coding_end
'}
->
{
$transcript_id
}
=
undef
;
}
else
{
my
$cdna_end
=
$self
->
cdna_end
(
$transcript
);
if
(
$transcript_coding_end
>
$cdna_end
)
{
# Coding region ends downstream of this exon...
if
(
$transcript
->
cdna_coding_start
()
>
$cdna_end
)
{
# ... and also starts downstream of this exon.
$self
->
{'
cdna_coding_end
'}
->
{
$transcript_id
}
=
undef
;
}
else
{
my
$cdna_end
=
$self
->
cdna_end
(
$transcript
);
if
(
$transcript_coding_end
>
$cdna_end
)
{
# Coding region ends downstream of this exon...
if
(
$transcript
->
cdna_coding_start
()
>
$cdna_end
)
{
# ... and also starts downstream of this exon.
$self
->
{'
cdna_coding_end
'}
->
{
$transcript_id
}
=
undef
;
}
else
{
# ... and does not start downstream of this exon.
$self
->
{'
cdna_coding_end
'}
->
{
$transcript_id
}
=
$cdna_end
;
}
}
else
{
# Coding region ends either within or upstream of this
# exon.
if
(
$transcript_coding_end
>=
$self
->
cdna_start
(
$transcript
)
)
{
# Coding region ends within this exon.
$self
->
{'
cdna_coding_end
'}
->
{
$transcript_id
}
=
$transcript_coding_end
;
}
else
{
# Coding region ends upstream of this exon.
$self
->
{'
cdna_coding_end
'}
->
{
$transcript_id
}
=
undef
;
}
}
}
## end else [ if ( !defined $transcript_coding_end)
}
## end if ( !exists $self->{'cdna_coding_end'...
return
$self
->
{'
cdna_coding_end
'}
->
{
$transcript_id
};
# ... and does not start downstream of this exon.
$self
->
{'
cdna_coding_end
'}
->
{
$transcript_id
}
=
$cdna_end
;
}
}
else
{
# Coding region ends either within or upstream of this
# exon.
if
(
$transcript_coding_end
>=
$self
->
cdna_start
(
$transcript
)
)
{
# Coding region ends within this exon.
$self
->
{'
cdna_coding_end
'}
->
{
$transcript_id
}
=
$transcript_coding_end
;
}
else
{
# Coding region ends upstream of this exon.
$self
->
{'
cdna_coding_end
'}
->
{
$transcript_id
}
=
undef
;
}
}
}
## end else [ if ( !defined($transcript_coding_end...
}
## end if ( !exists( $self->{...
return
$self
->
{'
cdna_coding_end
'}
->
{
$transcript_id
};
}
## end sub cdna_coding_end
=head2 coding_region_start
...
...
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