Commit 19af3113 authored by nwillhoft's avatar nwillhoft
Browse files

Add fix to correctly increment exon stable ids

parent 775772cd
Pipeline #177479 failed with stage
in 18 minutes and 35 seconds
......@@ -118,7 +118,7 @@ sub increment_stable_id {
} elsif ( $stable_id =~ m/([a-zA-Z]+)/ ) {
$prefix = $stable_id;
} else {
die( "unrecongnized stable_id format "
die( "unrecognized stable_id format: $stable_id "
. "- should match ([a-zA-Z]+)([0-9]+) or ([a-zA-Z]+) !!\n" );
}
......@@ -171,7 +171,7 @@ sub get_highest_stable_id {
# Get highest stable ID from the relevant table.
my $sth = $dbi->prepare("SELECT MAX(stable_id) FROM $type");
my $sth = $dbi->prepare("SELECT MAX(stable_id) FROM $type WHERE stable_id LIKE 'ENS%'");
$sth->execute();
if ( my @row = $sth->fetchrow_array() ) {
......@@ -214,7 +214,11 @@ sub get_highest_stable_id {
}
} ## end if ( length($highest_from_current...))
return $highest_from_current;
# remove the 'E' from exon stable id prefix
my ( $prefix, $suffix ) = $highest_from_current =~ /([a-zA-Z]+)([0-9]+)/;
$prefix =~ s/E$//;
return $prefix . $suffix;
} ## end if ( $type eq "exon" )
# and from relevant archive
......@@ -234,7 +238,7 @@ sub get_highest_stable_id {
}
# Assuming that this is a correctly formatted stable id -> remove the
# G/T/P/E for exon etc.
# G/T/P for gene etc. (Exon dealt with above.)
my ( $prefix, $suffix ) = $max =~ /([a-zA-Z]+)([0-9]+)/;
if ( $type eq 'exon' ) {
......
Markdown is supported
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