EdgeExpressDB
view release on metacpan or search on metacpan
lib/EEDB/Chrom.pm view on Meta::CPAN
=head2 update
Description : updates the data of this instance. require the Chrom to have been
fetched from database. It must have database() and primary_id()
Returntype : $self
Exceptions : none
=cut
sub update {
my $self = shift;
return undef unless($self->database and $self->id);
my $dbh = $self->database->get_connection;
my $sql = "UPDATE chrom set chrom_length=?, description=?, chrom_type=? where chrom_id=?";
my $sth = $dbh->prepare($sql);
$sth->execute($self->chrom_length,
$self->description,
$self->chrom_type,
lib/EEDB/Experiment.pm view on Meta::CPAN
my $mdata_list = $self->metadataset->metadata_list;
foreach my $mdata (@$mdata_list) {
if(!defined($mdata->primary_id)) {
$mdata->store($self->database);
$mdata->store_link_to_experiment($self);
}
}
}
sub update {
my $self = shift;
die("error no database set\n") unless($self->database);
dies("Experiment with undef id") unless(defined($self->primary_id));
my $dbc = $self->database->get_connection;
my $sql = "UPDATE experiment SET display_name=? WHERE experiment_id=?";
my $sth = $dbc->prepare($sql);
$sth->execute($self->display_name,
$self->id);
lib/EEDB/Feature.pm view on Meta::CPAN
#first do insert ignore to make sure symbol is in the database
my $dbc = $self->database->get_connection;
my $sql = "INSERT ignore INTO edge ".
"(feature1_id, feature2_id, direction, sub_type, weight, edge_source_id) VALUES(?,?,?,?,?,0)";
my $sth = $dbc->prepare($sql);
$sth->execute($self->id, $feature->id, $dir, $link_type, $weight);
$sth->finish;
}
sub update_location {
my $self = shift;
die("error no database set\n") unless($self->database);
dies("Feature with undef id") unless(defined($self->primary_id));
my $chrom_id = undef;
if($self->chrom) { $chrom_id = $self->chrom_id; }
my $sql = "UPDATE feature SET primary_name=?, chrom_id=?, chrom_start=?, chrom_end=?, strand=? WHERE feature_id=?";
$self->database->execute_sql($sql,
lib/EEDB/Metadata.pm view on Meta::CPAN
$sth->finish;
if($dbID) {
$self->primary_id($dbID);
$self->database($db);
return $self;
} else {
return undef;
}
}
sub update {
#use with extreme caution!!!! I should not even include it
my $self = shift;
my $sql = "UPDATE metadata set data_type=?, data=? where metadata_id=?";
$self->database->execute_sql($sql, $self->type, $self->data, $self->id);
}
sub check_exists_db {
my $self = shift;
my $db = shift;
lib/EEDB/Tools/MultiLoader.pm view on Meta::CPAN
foreach my $feature (@feature_array) {
#
# do some metadata additions here
#
$multiLoad->update_feature_metadata($feature);
}
$multiLoad->update_feature_metadata(); #to flush the queues
=cut
sub update_feature_metadata {
my $self = shift;
my $feature = shift;
if(defined($feature)) {
if($feature->database->url ne $self->database->url) { return; }
#first queue up the metadata
my $mdata_list = $feature->metadataset->metadata_list;
my $mdata_count = 0;
foreach my $mdata (@$mdata_list) {
scripts/eedb_sync_entrezgene.pl view on Meta::CPAN
exit(1);
}
##################################################################
#
# new XML webservice based mathods
#
##################################################################
sub update_from_webservice {
my $url = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?".
"db=gene&retmax=100000";
$url .= sprintf("&term=%d[taxid]%%20AND%%20gene_all[filter]", $assembly->taxon_id);
printf("URL: %s\n", $url);
my $tpp = XML::TreePP->new();
my $tree = $tpp->parsehttp( GET => $url );
#print $tree, "\n";
my $search_count = $tree->{'eSearchResult'}->{'Count'};
printf("search returned %d genes\n", $search_count);
( run in 0.265 second using v1.01-cache-2.11-cpan-ec4f86ec37b )