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
99b71ab3
Commit
99b71ab3
authored
Feb 26, 2004
by
Jessica Severin
Browse files
added back in method alignment_length
parent
ad9f6b52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
modules/Bio/EnsEMBL/BaseAlignFeature.pm
modules/Bio/EnsEMBL/BaseAlignFeature.pm
+32
-0
No files found.
modules/Bio/EnsEMBL/BaseAlignFeature.pm
View file @
99b71ab3
...
...
@@ -183,6 +183,38 @@ sub cigar_string {
}
=head2 alignment_length
Arg [1] : None
Example :
Description: return the alignment length (including indels) based on the cigar_string
Returntype : int
Exceptions :
Caller :
=cut
sub
alignment_length
{
my
$self
=
shift
;
if
(
!
defined
$self
->
{'
_alignment_length
'}
&&
defined
$self
->
cigar_string
)
{
my
@pieces
=
(
$self
->
cigar_string
=~
/(\d*[MDI])/g
);
unless
(
@pieces
)
{
print
STDERR
"
Error parsing cigar_string
\n
";
}
my
$alignment_length
=
0
;
foreach
my
$piece
(
@pieces
)
{
my
(
$length
)
=
(
$piece
=~
/^(\d*)/
);
if
(
!
defined
$length
||
$length
eq
"")
{
$length
=
1
;
}
$alignment_length
+=
$length
;
}
$self
->
{'
_alignment_length
'}
=
$alignment_length
;
}
return
$self
->
{'
_alignment_length
'};
}
=head2 ungapped_features
...
...
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