my$interpro_test_sth=$self->xref->dbc->prepare('select count(1) from xref x, source s where x.source_id = s.source_id and s.name like "InterPro"');
$interpro_test_sth->execute();
my($int_count);
$interpro_test_sth->bind_columns(\$int_count);
$interpro_test_sth->fetch();
if(defined($int_count)and$int_count){
my$ex_id=$name_to_external_db_id{"InterPro"};
$xref_sth->execute($ex_id);
}
$interpro_test_sth->finish;
$synonym_sth->finish;
$go_sth->finish;
$identity_sth->finish;
...
...
@@ -193,7 +212,7 @@ sub update{
my$direct_sth=$self->xref->dbc->prepare('select x.xref_id, x.accession, x.label, x.version, x.description, x.info_text, ox.object_xref_id, ox.ensembl_id, ox.ensembl_object_type from xref x, object_xref ox where ox.ox_status = "DUMP_OUT" and ox.xref_id = x.xref_id and x.source_id = ? and x.info_type = ? order by x.xref_id');
# $dependent_sth = $self->xref->dbc->prepare('select x.xref_id, x.accession, x.label, x.version, x.description, x.info_text, ox.object_xref_id, ox.ensembl_id, ox.ensembl_object_type, d.master_xref_id from xref x, object_xref ox, dependent_xref d where ox.ox_status = "DUMP_OUT" and ox.xref_id = x.xref_id and d.object_xref_id = ox.object_xref_id and x.source_id = ? and x.info_type = ? order by x.xref_id, ox.ensembl_id');
# $dependent_sth = $self->xref->dbc->prepare('select x.xref_id, x.accession, x.label, x.version, x.description, x.info_text, ox.object_xref_id, ox.ensembl_id, ox.ensembl_object_type, d.master_xref_id from xref x, object_xref ox, dependent_xref d where ox.ox_status = "DUMP_OUT" and ox.xref_id = x.xref_id and d.object_xref_id = ox.object_xref_id and x.source_id = ? and x.info_type = ? order by x.xref_id, ox.ensembl_id');
$dependent_sth=$self->xref->dbc->prepare('select x.xref_id, x.accession, x.label, x.version, x.description, x.info_text, ox.object_xref_id, ox.ensembl_id, ox.ensembl_object_type, ox.master_xref_id from xref x, object_xref ox where ox.ox_status = "DUMP_OUT" and ox.xref_id = x.xref_id and x.source_id = ? and x.info_type = ? order by x.xref_id, ox.ensembl_id');
...
...
@@ -212,6 +231,8 @@ GSQL
my$seq_sth=$self->xref->dbc->prepare('select x.xref_id, x.accession, x.label, x.version, x.description, x.info_text, ox.object_xref_id, ox.ensembl_id, ox.ensembl_object_type, i.query_identity, i.target_identity, i.hit_start, i.hit_end, i.translation_start, i.translation_end, i.cigar_line, i.score, i.evalue from xref x, object_xref ox, identity_xref i where ox.ox_status = "DUMP_OUT" and i.object_xref_id = ox.object_xref_id and ox.xref_id = x.xref_id and x.source_id = ? and x.info_type = ? order by x.xref_id');
my$sql='select tsi.stable_id, x.display_label from xref x, object_xref ox , transcript_stable_id tsi, external_db e where e.external_db_id = x.external_db_id and x.xref_id = ox.xref_id and tsi.transcript_id = ox.ensembl_id and e.db_name like ?';
...
...
@@ -97,15 +98,114 @@ sub run_script {
my$xref_count=0;
my$dbi=$self->dbi();
my%synonym;
my$dbname="HGNC";
my$syn;
my$name;
$sth=$dbi->prepare('select es.synonym, x.label from synonym es, xref x, source s where x.xref_id = es.xref_id and x.source_id = s.source_id and s.name = "EntrezGene"');
$sth->execute();
$sth->bind_columns(\$syn,\$name);
while($sth->fetch){
$synonym{$syn}=$name;
}
$sth->finish;
$sth=$dbi->prepare('select es.synonym, x.label from synonym es, xref x, source s where x.xref_id = es.xref_id and x.source_id = s.source_id and s.name = "'.$dbname.'" and s.priority_description like "desc_only"');
$sth->execute();
$sth->bind_columns(\$syn,\$name);
while($sth->fetch){
$synonym{$syn}=$name;
}
$sth->finish;
#get the source ids for HGNC sources
my(%accession,%version,%description);
$sql='select source_id from source where name like "HGNC" ';
$sql.='and priority_description like "desc_only" ';
$sth=$dbi->prepare($sql);
$sth->execute();
my($hgnc_source_id);
$sth->bind_columns(\$hgnc_source_id);
my@arr;
while($sth->fetch()){
push@arr,$hgnc_source_id;
}
$sth->finish;
$sql="select accession, label, version, description from xref where source_id in (".join(", ",@arr).")";