Commit a2428670 authored by Ian Longden's avatar Ian Longden
Browse files

if noxref_database is specified do not try to write to the xref database....

if noxref_database is specified do not try to write to the xref database. Needed for -recalc_display_xrefs option
parent 4aa0c74b
...@@ -120,18 +120,26 @@ sub genes_and_transcripts_attributes_set{ ...@@ -120,18 +120,26 @@ sub genes_and_transcripts_attributes_set{
# build_meta_timestamp, and, if "-upload" is set, uses the SQL files # build_meta_timestamp, and, if "-upload" is set, uses the SQL files
# produced to update the core database. # produced to update the core database.
my ($self,$fullmode) = @_; my ($self, $fullmode, $noxref_database) = @_;
my $status = $self->mapper->xref_latest_status(); my $status;
if(defined($noxref_database)){
$status = "none";
}
else{
$status = $self->mapper->xref_latest_status();
}
if(!$fullmode){ if(!$fullmode){
if($status ne "display_xref_done"){ if($status ne "display_xref_done"){
$self->build_transcript_and_gene_display_xrefs(); $self->build_transcript_and_gene_display_xrefs();
my $sth_stat = $self->xref->dbc->prepare("insert into process_status (status, date) values('display_xref_done',now())"); if(!defined($noxref_database)){
$sth_stat->execute(); my $sth_stat = $self->xref->dbc->prepare("insert into process_status (status, date) values('display_xref_done',now())");
$sth_stat->finish; $sth_stat->execute();
$sth_stat->finish;
}
} }
...@@ -149,10 +157,12 @@ sub genes_and_transcripts_attributes_set{ ...@@ -149,10 +157,12 @@ sub genes_and_transcripts_attributes_set{
$self->build_meta_timestamp; $self->build_meta_timestamp;
my $sth_stat = $self->xref->dbc->prepare("insert into process_status (status, date) values('gene_description_done',now())"); if(!defined($noxref_database)){
$sth_stat->execute(); my $sth_stat = $self->xref->dbc->prepare("insert into process_status (status, date) values('gene_description_done',now())");
$sth_stat->finish; $sth_stat->execute();
$sth_stat->finish;
}
return 1; return 1;
} }
...@@ -722,6 +732,7 @@ GSQL ...@@ -722,6 +732,7 @@ GSQL
if ($filtered_description ne "") { if ($filtered_description ne "") {
$xref_descriptions{$xref_id} = $description; $xref_descriptions{$xref_id} = $description;
$xref_accessions{$xref_id} = $acc; $xref_accessions{$xref_id} = $acc;
$ex_db{$xref_id} = $ex_db_id;
if($level{$ex_db_id} > $best_gene_level){ if($level{$ex_db_id} > $best_gene_level){
$best_gene_xref = $xref_id; $best_gene_xref = $xref_id;
$best_gene_level = $level{$ex_db_id}; $best_gene_level = $level{$ex_db_id};
...@@ -885,6 +896,9 @@ GSQL ...@@ -885,6 +896,9 @@ GSQL
$description =~ s/\"//ig; # remove " as they will cause problems in .sql files $description =~ s/\"//ig; # remove " as they will cause problems in .sql files
if(!defined($ex_db_id_to_display_name{$ex_db{$best_gene_xref}})){
print STDERR "Could not find display name for gene $best_gene_xref for external db ".$ex_db{$best_gene_xref}."\n";
}
my $desc = $description . " [Source:".$ex_db_id_to_display_name{$ex_db{$best_gene_xref}}.";Acc:$acc]"; my $desc = $description . " [Source:".$ex_db_id_to_display_name{$ex_db{$best_gene_xref}}.";Acc:$acc]";
$update_gene_desc_sth->execute($desc, $gene_id) if($description); $update_gene_desc_sth->execute($desc, $gene_id) if($description);
......
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