Skip to content

Instantly share code, notes, and snippets.

@dbolser
Created April 8, 2011 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbolser/909576 to your computer and use it in GitHub Desktop.
Save dbolser/909576 to your computer and use it in GitHub Desktop.
meh
#!/usr/bin/perl -w
use strict;
use Bio::DB::SeqFeature::Store;
my $db = Bio::DB::SeqFeature::Store->
new( -adaptor => 'DBI::mysql',
-dsn => 'dbolser_004:mysql.compbio.dundee.ac.uk',
-user => 'dbolser',
-pass => 'abc123',
);
my $iterator = $db->
get_seq_stream();
while (my $f = $iterator->next_seq) {
warn "doing ", join(" ", $f->seq_id, $f->load_id), "\n";
if( !$f->has_tag('Name') ){
warn "\tName is not set\n";
warn "\tsetting name from ID\n";
$f->display_name($f->load_id);
$db->update($f) or die "Couldn't update!";
}
else{
warn "\tName is set '", $f->display_name(), ";\n";
}
exit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment