Commit 502dcfff authored by Marek Szuba's avatar Marek Szuba
Browse files

stable_id_lookup: extract RNAProduct stable IDs from core databases

Uses the same type of SQL SELECT queries as Translation, which makes
sense given how similar they are.

Tested on test-genome-DBs/homo_sapiens/core, works without errors.

Aborts upon encountering a core database missing the 'rnaproduct' table
but that is in my humble opinion very much desired behaviour, as it could
indicate incomplete application of schema patches in the release this
will be included in.
parent ccfc19a8
...@@ -12,6 +12,7 @@ core Exon ...@@ -12,6 +12,7 @@ core Exon
Translation Translation
Operon Operon
OperonTranscript OperonTranscript
RNAProduct
For Gene, Transcript and Translation, an archive_id_lookup is also created, containing all previously used ids For Gene, Transcript and Translation, an archive_id_lookup is also created, containing all previously used ids
......
...@@ -37,6 +37,7 @@ my %group_objects = ( ...@@ -37,6 +37,7 @@ my %group_objects = (
Transcript => 1, Transcript => 1,
Translation => 1, Translation => 1,
Operon => 1, Operon => 1,
RNAProduct => 1,
# OperonTranscript => 1, # these are in transcript table anyway # OperonTranscript => 1, # these are in transcript table anyway
GeneArchive => 1, GeneArchive => 1,
...@@ -417,7 +418,7 @@ sub load_ids { ...@@ -417,7 +418,7 @@ sub load_ids {
my $rows_inserted = build_insert_sql( $select_sql, $dbh_read, $dbh_write, $is_archive ); my $rows_inserted = build_insert_sql( $select_sql, $dbh_read, $dbh_write, $is_archive );
} }
elsif ( $object_name =~ /Translation/ ) { elsif ( $object_name =~ / RNAProduct | Translation /x ) {
my $sth = $dbh_read->prepare("SELECT COUNT(*) FROM $object"); my $sth = $dbh_read->prepare("SELECT COUNT(*) FROM $object");
$sth->execute(); $sth->execute();
my ($count) = $sth->fetchrow_array; my ($count) = $sth->fetchrow_array;
......
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