diff --git a/misc-scripts/surgery/SeqStoreConverter/vega/DanioRerio.pm b/misc-scripts/surgery/SeqStoreConverter/vega/DanioRerio.pm index 45c31fe7ed65ae53a157b3df644a97ff9dce000e..871cba8b6fb3d94da227d3b16a3da97062315878 100644 --- a/misc-scripts/surgery/SeqStoreConverter/vega/DanioRerio.pm +++ b/misc-scripts/surgery/SeqStoreConverter/vega/DanioRerio.pm @@ -67,49 +67,52 @@ sub update_clone_info { $self->debug("Danio_specific - Transforming clone_id into seq_region_id for clone_info and current_clone_info"); foreach my $table_name ('clone_info','current_clone_info') { - my $select_st1 = + my $select_st1 = "SELECT ctg.name, ctg.clone_id " . "FROM $source.contig ctg, $source.$table_name ci " . "WHERE ctg.clone_id = ci.clone_id " . "AND ctg.name not like 'ctg%' " . "AND ctg.name not like 'NA%'"; - - my $query_results1 = $dbh->selectall_arrayref($select_st1); - - my $i = 0; - foreach my $contig_name (@$query_results1) { - my $embl_acc = $contig_name->[0]; - my $select_st2 = - "SELECT sr.seq_region_id " . - "FROM $target.seq_region sr " . - "WHERE sr.name = '$embl_acc'"; - my @query_results2 = $dbh->selectrow_array($select_st2); - push @{$query_results1->[$i]},@query_results2; - $i++; - } - - foreach my $clone (@$query_results1) { - my $seq_reg_id = $clone->[2]; - my $clone_id = $clone->[1]; - - my $update_query = - "UPDATE $target.$table_name " . - "SET clone_id = '$seq_reg_id' " . - "WHERE clone_id = '$clone_id'"; - $dbh->do($update_query); - } - my $alter_struct_1 = + + my $query_results1 = $dbh->selectall_arrayref($select_st1); + + my $i = 0; + foreach my $contig_name (@$query_results1) { + my $embl_acc = $contig_name->[0]; + my $select_st2 = + "SELECT sr.seq_region_id " . + "FROM $target.seq_region sr " . + "WHERE sr.name = '$embl_acc'"; + my @query_results2 = $dbh->selectrow_array($select_st2); + push @{$query_results1->[$i]},@query_results2; + $i++; + } + + foreach my $clone (@$query_results1) { + my $seq_reg_id = $clone->[2]; + my $clone_id = $clone->[1]; + + my $update_query = + "UPDATE $target.$table_name " . + "SET clone_id = '$seq_reg_id' " . + "WHERE clone_id = '$clone_id'"; + $dbh->do($update_query); + } + my $alter_struct_1 = "ALTER table $target.$table_name " . "CHANGE clone_id seq_region_id int(10) not null"; - my $alter_struct_2 = + my $alter_struct_2 = "ALTER table $target.$table_name " . "add unique index (seq_region_id)"; - $dbh->do($alter_struct_1); - $dbh->do($alter_struct_2); - + $dbh->do($alter_struct_1); + $dbh->do($alter_struct_2); } +} - return; +sub remove_supercontigs { + my $self = shift; + my $target = $self->target(); + $self->debug("Vega Danio specific - NO supercontigs removed from $target"); } 1;