XrefParser WormbaseDatabaseStableIDParser
Included librariesPackage variablesGeneral documentationMethods
Toolbar
WebCvsRaw content
Package variables
No package variables defined.
Inherit
XrefParser::DatabaseParser
Synopsis
No synopsis!
Description
No description!
Methods
run
No description
Code
Methods description
None available.
Methods code
rundescriptionprevnextTop
sub run {
  my ($self, $dsn, $source_id, $species_id, $verbose) = @_;

  my $db = $self->connect($dsn); # source db (probably core)
my $xref_db = $self->dbi(); my $xref_sth = $xref_db->prepare( "INSERT INTO xref (accession,label,source_id,species_id) VALUES (?,?,?,?)" ); my $direct_xref_sth = $xref_db->prepare( "INSERT INTO direct_xref (general_xref_id,ensembl_stable_id,type,linkage_xref) VALUES (?,?,?,?)" ); # read stable IDs
foreach my $type ('gene', 'transcript') { print "Building xrefs from $type stable IDs\n" if($verbose); my $wb_source_id = $self->get_source_id_for_source_name("wormbase_$type"); my $sth = $db->prepare( "SELECT stable_id FROM ${type}_stable_id" ); $sth->execute(); while(my @row = $sth->fetchrow_array()) { my $id = $row[0]; # add an xref & a direct xref
$xref_sth->execute($id, $id, $wb_source_id, $species_id); my $xref_id = $xref_sth->{'mysql_insertid'}; $direct_xref_sth->execute($xref_id, $id, $type, "Stable ID direct xref"); } # while fetch stable ID
} # foreach type
return 0; } 1;
}
General documentation
No general documentation available.