@@ -40,13 +45,17 @@ my $t_db = new Bio::EnsEMBL::DBSQL::DBAdaptor('-host' => $t_host,
...
@@ -40,13 +45,17 @@ my $t_db = new Bio::EnsEMBL::DBSQL::DBAdaptor('-host' => $t_host,
# TODO fix this when external db is sorted out
# TODO fix this when external db is sorted out
my$restrict_sql="x.external_db_id > 3000 AND x.external_db_id < 3210";
my$restrict_sql="x.external_db_id > 3000 AND x.external_db_id < 3210";
$restrict_sql=" e.db_name='$array'"if($array);
run();
run();
sub run{
sub run{
print"Using only array $array\n"if($array);
# compare total counts first
# compare total counts first
my$count_sql="SELECT COUNT(*) FROM xref x, object_xref ox WHERE x.xref_id=ox.xref_id AND ox.ensembl_object_type='Transcript' AND $restrict_sql";
my$count_sql="SELECT COUNT(*) FROM xref x, object_xref ox, external_db e WHERE e.external_db_id=x.external_db_id AND x.xref_id=ox.xref_id AND ox.ensembl_object_type='Transcript' AND $restrict_sql";
my$s_sth=$s_db->dbc()->prepare($count_sql);
my$s_sth=$s_db->dbc()->prepare($count_sql);
$s_sth->execute();
$s_sth->execute();
my$count=($s_sth->fetchrow_array())[0];
my$count=($s_sth->fetchrow_array())[0];
...
@@ -55,7 +64,7 @@ sub run {
...
@@ -55,7 +64,7 @@ sub run {
my$t_sth=$t_db->dbc()->prepare($count_sql);
my$t_sth=$t_db->dbc()->prepare($count_sql);
$t_sth->execute();
$t_sth->execute();
$count=($t_sth->fetchrow_array())[0];
$count=($t_sth->fetchrow_array())[0];
print"Total oligo_xrefs in $t_dbname: $count\n";
print"Total oligoxrefs in $t_dbname: $count\n";
# cache all mappings from each database
# cache all mappings from each database
# key format: transcript_stable_id:array:probe
# key format: transcript_stable_id:array:probe
...
@@ -103,7 +112,7 @@ sub run {
...
@@ -103,7 +112,7 @@ sub run {
sub cache_mappings{
sub cache_mappings{
my($db)=@_;
my($db,$print)=@_;
my%mappings;
my%mappings;
...
@@ -112,10 +121,12 @@ sub cache_mappings {
...
@@ -112,10 +121,12 @@ sub cache_mappings {
$sth->execute();
$sth->execute();
while(my@row=$sth->fetchrow_array()){
while(my@row=$sth->fetchrow_array()){
#my $key = $row[0] . ":" . $row[1]. ":" . $row[2]; # TODO - add array back in