Created
April 8, 2011 09:51
-
-
Save dbolser/909576 to your computer and use it in GitHub Desktop.
meh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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