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
6f1d9f98
Commit
6f1d9f98
authored
Oct 08, 2002
by
Dan T Andrews
Browse files
Changes to deal with negative hit strand features.
parent
71393822
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
8 deletions
+23
-8
modules/Bio/EnsEMBL/BaseAlignFeature.pm
modules/Bio/EnsEMBL/BaseAlignFeature.pm
+23
-8
No files found.
modules/Bio/EnsEMBL/BaseAlignFeature.pm
View file @
6f1d9f98
...
...
@@ -534,6 +534,7 @@ sub _parse_features {
#
# Loop through each portion of alignment and construct cigar string
#
foreach
my
$f
(
@f
)
{
#
# Sanity checks
...
...
@@ -804,14 +805,13 @@ sub _transform_to_rawcontig{
my
$contig_id
=
$mf
->
seqname
;
if
(
!
$rc_features
{
$contig_id
}){
$rc_features
{
$contig_id
}
=
[]
;
push
(
@
{
$rc_features
{
$contig_id
}},
$mf
);
}
else
{
push
(
@
{
$rc_features
{
$contig_id
}},
$mf
);
}
push
(
@
{
$rc_features
{
$contig_id
}},
$mf
);
}
foreach
my
$contig_id
(
keys
(
%rc_features
)){
my
$outputf
=
$self
->
new
(
-
features
=>
\
@
{
$rc_features
{
$contig_id
}
}
);
my
$outputf
=
$self
->
new
(
-
features
=>
$rc_features
{
$contig_id
}
);
$outputf
->
analysis
(
$self
->
analysis
()
);
$outputf
->
score
(
$self
->
score
()
);
$outputf
->
percent_id
(
$self
->
percent_id
()
);
...
...
@@ -895,8 +895,14 @@ sub _transform_feature_to_rawcontig{
$self
->
throw
(
"
couldn't map
"
.
$self
.
"
\n
"
);
return
$self
;
}
my
(
$hit_start
,
$hit_end
);
if
(
scalar
(
@mapped
)
>
1
)
{
my
$hit_start
=
$feature
->
hstart
;
if
(
$feature
->
hstrand
==
1
)
{
$hit_start
=
$feature
->
hstart
();
}
else
{
$hit_end
=
$feature
->
hend
();
}
#print STDERR " feature is being mapped across multiple contigs ".$feature->gffstring."\n";
SPLIT:
for
(
my
$i
=
0
;
$i
<=
$#mapped
;
$i
++
)
{
if
(
$mapped
[
$i
]
->
isa
("
Bio::EnsEMBL::Mapper::Gap
")){
...
...
@@ -920,8 +926,11 @@ sub _transform_feature_to_rawcontig{
$hit_length
=
sprintf
"
%.0f
",
$tmp
;
}
#print STDERR "hit length ".$hit_length."\n";
my
$hit_end
=
(
$hit_start
+
$hit_length
)
-
1
;
if
(
$feature
->
hstrand
()
==
1
)
{
$hit_end
=
(
$hit_start
+
$hit_length
)
-
1
;
}
else
{
$hit_start
=
(
$hit_end
-
$hit_length
+
1
);
}
#print "hit start ".$hit_start." hit end ".$hit_end."\n";
my
$rawContig
=
$rcAdaptor
->
fetch_by_dbID
(
$mapped
[
$i
]
->
id
()
);
my
$f1
=
new
Bio::EnsEMBL::
SeqFeature
();
...
...
@@ -943,9 +952,15 @@ sub _transform_feature_to_rawcontig{
#$new_feature->hscore($feature->score);
$new_feature
->
analysis
(
$feature
->
analysis
);
$new_feature
->
attach_seq
(
$rawContig
);
#print STDERR "FEATURE: ",join( " ", ( $new_feature->start(), $new_feature->end(), $new_feature->seqname,
# $new_feature->contig(), $new_feature->hstart(), $new_feature->hend() )),"\n";
#print STDERR "split feature ".$new_feature->gffstring."\n";
push
(
@out
,
$new_feature
);
$hit_start
=
(
$hit_end
+
1
);
if
(
$feature
->
hstrand
()
==
1
)
{
$hit_start
=
(
$hit_end
+
1
);
}
else
{
$hit_end
=
$hit_start
-
1
;
}
}
}
else
{
if
(
$mapped
[
0
]
->
isa
("
Bio::EnsEMBL::Mapper::Gap
")){
...
...
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