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
8091a043
Commit
8091a043
authored
25 years ago
by
Michele Clamp
Browse files
Options
Downloads
Patches
Plain Diff
New object that is symmetrical in contig space
parent
7cf06d18
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/ContigOverlap.pm
+105
-62
105 additions, 62 deletions
modules/Bio/EnsEMBL/ContigOverlap.pm
with
105 additions
and
62 deletions
modules/Bio/EnsEMBL/ContigOverlap.pm
+
105
−
62
View file @
8091a043
...
...
@@ -20,9 +20,8 @@ Give standard usage here
=head1 DESCRIPTION
The contig overlap object is directional - you pick it up from a particular
contig and it tells you what position on that contig is equivalent to what
position on the other contig.
The contig overlap object is symmetrical. It describes the overlap between two
contigs.
http://www.ncbi.nlm.nih.gov/genome/seq/Hs_Data/contig.xml
...
...
@@ -59,132 +58,176 @@ sub _initialize {
my
$make
=
$self
->
SUPER::
_initialize
(
@args
);
my
(
$sister
,
$sisterpos
,
$sisterpolarity
,
$selfposition
)
=
$self
->
_rearrange
([
qw( SISTER
SISTERPOSITION
SISTERPOLARITY
SELFPOSITION
)
],
@args
);
if
(
!
defined
$sister
||
!
defined
$sisterpos
||
!
defined
$sisterpolarity
||
!
defined
$selfposition
)
{
$self
->
throw
("
You have to construct ContigOverlap objects with all four arguments, sisterid, sisterposition, sisterpolarity, and selfposition
");
my
(
$contiga
,
$contigb
,
$positiona
,
$positionb
,
$overlap_type
)
=
$self
->
_rearrange
([
qw( CONTIGA
CONTIGB
POSITIONA
POSITIONB
OVERLAP_TYPE
)
],
@args
);
if
(
!
defined
$contiga
||
!
defined
$contigb
||
!
defined
$positiona
||
!
defined
$positionb
||
!
defined
(
$overlap_type
))
{
$self
->
throw
("
You have to construct ContigOverlap objects with all five arguments, contiga,contigb,positiona,positionb,overlap_type
");
}
$self
->
sister
(
$sister
);
$self
->
sister_position
(
$sisterpos
);
$self
->
sister_polarity
(
$sisterpolarity
);
$self
->
self_position
(
$selfposition
);
$self
->
contiga
(
$contiga
);
$self
->
contigb
(
$contigb
);
$self
->
positiona
(
$positiona
);
$self
->
positionb
(
$positionb
);
$self
->
overlap_type
(
$overlap_type
);
# set stuff in self from @args
return
$make
;
# success - we hope!
}
=head2
sister
=head2
contiga
Title : sister
Usage : $obj->sister($newval)
Function: Returns the RawContigI implementing object of the sister
contig. ie the id of the sister object is
$obj->sister->id();
Returns : value of sister
Title : contiga
Usage : $obj->contiga($contig)
Function: Get/Set for the 1st contig in the overlap
Returns : Bio::EnsEMBL::DB::RawContigI
Args : newvalue (optional)
=cut
sub
sister
{
sub
contiga
{
my
$obj
=
shift
;
if
(
@
_
)
{
my
$value
=
shift
;
if
(
!
ref
$value
||
!
$value
->
isa
('
Bio::EnsEMBL::DB::
Raw
ContigI
')
)
{
if
(
!
ref
$value
||
!
$value
->
isa
('
Bio::EnsEMBL::DB::ContigI
')
)
{
$obj
->
throw
("
Value [
$value
] is not a RawContigI. Problemo...
");
}
$obj
->
{'
sister_
contig
'}
=
$value
;
$obj
->
{'
contig
a
'}
=
$value
;
}
return
$obj
->
{'
sister_
contig
'};
return
$obj
->
{'
contig
a
'};
}
=head2 sister_position
=head2 contigb
Title : contigb
Usage : $obj->contigb($contig)
Function: Get/Set for the 2nd contig in the overlap
Returns : Bio::EnsEMBL::DB::RawContigI
Args : newvalue (optional)
=cut
sub
contigb
{
my
$obj
=
shift
;
if
(
@
_
)
{
my
$value
=
shift
;
if
(
!
ref
$value
||
!
$value
->
isa
('
Bio::EnsEMBL::DB::ContigI
')
)
{
$obj
->
throw
("
Value [
$value
] is not a RawContigI. Problemo...
");
}
$obj
->
{'
contigb
'}
=
$value
;
}
return
$obj
->
{'
contigb
'};
}
=head2 positiona
Title :
sister_
position
Usage : $obj->
sister_
position($newval)
Title : position
a
Usage : $obj->position
a
($newval)
Function:
Returns : value of
sister_
position
Returns : value of position
a
Args : newvalue (optional)
=cut
sub
sister_
position
{
sub
position
a
{
my
$obj
=
shift
;
if
(
@
_
)
{
my
$value
=
shift
;
$obj
->
{'
sister_
position
'}
=
$value
;
$obj
->
{'
position
a
'}
=
$value
;
}
return
$obj
->
{'
sister_
position
'};
return
$obj
->
{'
position
a
'};
}
=head2
sister_polarity
Title :
sister_polarity
Usage : $obj->
sister_polarity
($newval)
=head2
positionb
Title :
positionb
Usage : $obj->
positionb
($newval)
Function:
Returns : value of
sister_polarity
Returns : value of
positionb
Args : newvalue (optional)
=cut
sub
sister_polarity
{
sub
positionb
{
my
$obj
=
shift
;
if
(
@
_
)
{
my
$value
=
shift
;
$obj
->
{'
sister_contig_polarity
'}
=
$value
;
$obj
->
{'
positionb
'}
=
$value
;
}
return
$obj
->
{'
sister_contig_polarity
'};
return
$obj
->
{'
positionb
'};
}
=head2
self_position
=head2
overlap_type
Title :
self_position
Usage : $obj->
self_position($newval)
Title :
overlap_type
Usage : $obj->
overlap_type
Function:
Returns : value of
self_position
Returns : value of
overlap_type
Args : newvalue (optional)
=cut
sub
self_position
{
my
$obj
=
shift
;
sub
overlap_type
{
my
$obj
=
shift
;
if
(
@
_
)
{
my
$value
=
shift
;
$obj
->
{'
self_contig_position
'}
=
$value
;
}
return
$obj
->
{'
self_contig_position
'};
my
$value
=
shift
;
$obj
->
{'
overlap_type
'}
=
$value
;
}
return
$obj
->
{'
overlap_type
'};
}
=head2
distance
=head2
invert
Title :
distance
Usage : $obj->
distance($newval)
Title :
invert
Usage : $obj->
invert
Function:
Example :
Returns : value of distance
Returns : Reverses the sense of the overlap
Args : newvalue (optional)
=cut
sub
distance
{
my
(
$obj
,
$value
)
=
@_
;
if
(
defined
$value
)
{
$obj
->
{'
distance
'}
=
$value
;
}
return
$obj
->
{'
distance
'};
sub
invert
{
my
$self
=
shift
;
my
$tmp
=
$self
->
contiga
;
$self
->
contiga
(
$self
->
contigb
);
$self
->
contigb
(
$tmp
);
$tmp
=
$self
->
positiona
;
$self
->
positiona
(
$self
->
positionb
);
$self
->
positionb
(
$tmp
);
my
$oldtype
=
$self
->
overlap_type
;
if
(
$oldtype
eq
'
right2left
')
{
$self
->
overlap_type
('
left2right
');
}
elsif
(
$oldtype
eq
'
left2right
')
{
$self
->
overlap_type
('
right2left
');
}
elsif
(
$oldtype
eq
'
left2left
')
{
$self
->
overlap_type
('
right2right
');
}
elsif
(
$oldtype
eq
'
right2right
')
{
$self
->
overlap_type
('
left2left
');
}
else
{
$self
->
throw
("
Unknown overlap type [
"
.
$self
->
overlap_type
.
"
]
");
}
}
...
...
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