Skip to content
Snippets Groups Projects
Commit 075cc425 authored by Steve Trevanion's avatar Steve Trevanion
Browse files

clone name conversion for vega

parent ae67d5ba
No related branches found
No related tags found
No related merge requests found
......@@ -141,4 +141,44 @@ sub remove_supercontigs {
"WHERE coord_system_id = 2");
}
sub copy_internal_clone_names {
my $self = shift;
my $target = $self->target();
my $source = $self->source();
my $dbh = $self->dbh();
$self->debug("Vega Danio specific - copying internal clone names to seq_region_attrib");
#get id for 'name' attribute
my ($attrib_id) = $dbh->selectrow_array("Select attrib_type_id from $target.attrib_type where code = 'name'");
warn "No attrib id found\n" unless defined($attrib_id);
#get clone details
my $select1_sth = $dbh->prepare
("SELECT seq_region_id, name from $target.seq_region where coord_system_id = 3;");
$select1_sth->execute();
my ($seq_region_id, $embl_name);
$select1_sth->bind_columns(\$seq_region_id, \$embl_name);
my $clone_name;
my $select2_sth = $dbh->prepare("select name from $source.clone where embl_acc= ?");
my $insert_sth = $dbh->prepare("insert into $target.seq_region_attrib values (?,$attrib_id,?)");
while ($select1_sth->fetch()) {
$embl_name =~ s/([\d\w]+).*/$1/;
$select2_sth->bind_param(1,$embl_name);
$select2_sth->execute;
$insert_sth->bind_param(1,$seq_region_id);
while (my ($clone_name) = $select2_sth->fetchrow_array()) {
$insert_sth->bind_param(2,$clone_name);
# print "$seq_region_id\t$attrib_id\t$clone_name\n";
$insert_sth->execute();
}
}
}
1;
......@@ -83,5 +83,8 @@ sub remove_supercontigs {
"WHERE coord_system_id = 2");
}
sub copy_internal_clone_names {
return;
}
1;
......@@ -82,4 +82,8 @@ sub remove_supercontigs {
"WHERE coord_system_id = 2");
}
sub copy_internal_clone_names {
return;
}
1;
......@@ -103,6 +103,7 @@ for my $converter ( @all_species_converters ) {
if ($vega_schema) {
$converter->update_clone_info();
$converter->remove_supercontigs();
$converter->copy_internal_clone_names();
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment