Skip to content
Snippets Groups Projects
Commit d8d316b7 authored by Graham McVicker's avatar Graham McVicker
Browse files

bug fix: transcript inversions were not being detected correctly

parent 5f40ce7d
No related branches found
No related tags found
No related merge requests found
......@@ -114,7 +114,8 @@ sub check_iexons {
my $itranscript = shift;
my $itranscript_array = shift;
my $prev_end = 0;
my $prev_start = undef;
my $prev_end = undef;
my $transcript_seq_region = undef;
my $transcript_strand = undef;
......@@ -185,9 +186,12 @@ sub check_iexons {
}
if ($prev_end > $iexon->start()) {
# something funny has happened, this exon starts before end of previous
# exon
# watch out for exons that come in the wrong order
if((defined($prev_end) && $iexon->strand() == 1 &&
$prev_end > $iexon->start()) ||
(defined($prev_start) && $iexon->strand() == -1 &&
$prev_start < $iexon->end())) {
debug(" inversion, splitting transcript");
......@@ -204,6 +208,9 @@ sub check_iexons {
return check_iexons($itranscript, $itranscript_array);
}
$prev_end = $iexon->end();
$prev_start = $iexon->start();
if (!defined($transcript_strand)) {
$transcript_strand = $iexon->strand();
} elsif ($transcript_strand != $iexon->strand()) {
......@@ -405,6 +412,7 @@ sub make_Transcript {
-STABLE_ID => $iexon->stable_id(),
-SLICE => $slice);
#print STDERR "Adding exon " . $exon->stable_id . " to final transcript\n";
$transcript->add_Exon($exon);
#
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment