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
8a513ee7
Commit
8a513ee7
authored
20 years ago
by
Abel Ureta-Vidal
Browse files
Options
Downloads
Patches
Plain Diff
Added functionality to get_SimpleAlign method such as translated and uc flags. Added pod doc
parent
05219a6a
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/DnaDnaAlignFeature.pm
+47
-12
47 additions, 12 deletions
modules/Bio/EnsEMBL/DnaDnaAlignFeature.pm
with
47 additions
and
12 deletions
modules/Bio/EnsEMBL/DnaDnaAlignFeature.pm
+
47
−
12
View file @
8a513ee7
...
...
@@ -256,8 +256,36 @@ sub alignment_strings {
}
return
[
$rseq
,
$rhseq
];
}
=head2 get_SimpleAlign
Arg [1] : list of string $flags
translated = by default, the sequence alignment will be on nucleotide. With translated flag
the aligned sequences are translated.
uc = by default aligned sequences are given in lower cases. With uc flag, the aligned
sequences are given in upper cases.
Example : $daf->get_SimpleAlign or
$daf->get_SimpleAlign("translated") or
$daf->get_SimpleAlign("translated","uc")
Description: Allows to rebuild the alignment string of both the seq and hseq sequence
using the cigar_string information and the slice and hslice objects
Returntype : a Bio::SimpleAlign object
Exceptions :
Caller :
=cut
sub
get_SimpleAlign
{
my
$ddaf
=
shift
;
my
(
$self
,
@flags
)
=
@_
;
# setting the flags
my
$uc
=
0
;
my
$translated
=
0
;
for
my
$flag
(
@flags
)
{
$uc
=
1
if
(
$flag
=~
/^uc$/i
);
$translated
=
1
if
(
$flag
=~
/^translated$/i
);
}
my
$sa
=
Bio::
SimpleAlign
->
new
();
...
...
@@ -268,19 +296,26 @@ sub get_SimpleAlign {
$bio07
=
1
;
}
my
(
$sb_seq
,
$qy_seq
)
=
@
{
$ddaf
->
alignment_strings
};
my
(
$sb_seq
,
$qy_seq
)
=
@
{
$self
->
alignment_strings
};
my
$loc_sb_seq
=
Bio::
LocatableSeq
->
new
(
-
SEQ
=>
$uc
?
uc
$sb_seq
:
lc
$sb_seq
,
-
START
=>
$self
->
seq_region_start
,
-
END
=>
$self
->
seq_region_end
,
-
ID
=>
$self
->
seqname
,
-
STRAND
=>
$self
->
strand
);
$loc_sb_seq
->
seq
(
$uc
?
uc
$loc_sb_seq
->
translate
->
seq
:
lc
$loc_sb_seq
->
translate
->
seq
)
if
(
$translated
);
my
$loc_qy_seq
=
Bio::
LocatableSeq
->
new
(
-
SEQ
=>
$uc
?
uc
$qy_seq
:
lc
$qy_seq
,
-
START
=>
$self
->
hseq_region_start
,
-
END
=>
$self
->
hseq_region_end
,
-
ID
=>
$self
->
hseqname
,
-
STRAND
=>
$self
->
hstrand
);
my
$loc_sb_seq
=
Bio::
LocatableSeq
->
new
(
-
SEQ
=>
$sb_seq
,
-
START
=>
$ddaf
->
seq_region_start
,
-
END
=>
$ddaf
->
seq_region_end
,
-
ID
=>
$ddaf
->
seqname
,
-
STRAND
=>
$ddaf
->
strand
);
$loc_qy_seq
->
seq
(
$uc
?
uc
$loc_qy_seq
->
translate
->
seq
:
lc
$loc_qy_seq
->
translate
->
seq
)
if
(
$translated
);
my
$loc_qy_seq
=
Bio::
LocatableSeq
->
new
(
-
SEQ
=>
$qy_seq
,
-
START
=>
$ddaf
->
hseq_region_start
,
-
END
=>
$ddaf
->
hseq_region_end
,
-
ID
=>
$ddaf
->
hseqname
,
-
STRAND
=>
$ddaf
->
hstrand
);
if
(
$bio07
)
{
$sa
->
addSeq
(
$loc_sb_seq
);
$sa
->
addSeq
(
$loc_qy_seq
);
...
...
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