Skip to content
Snippets Groups Projects
Commit a8b6934d authored by Thibaut Hourlier's avatar Thibaut Hourlier
Browse files

Use seq_region_start and seq_region_end when updating gene coordinates in the database

parent 5f04c24a
No related branches found
No related tags found
4 merge requests!331Use seq_region_start and seq_region_end when updating gene coordinate…,!342Feature/schema update 96,!342Feature/schema update 96,!331Use seq_region_start and seq_region_end when updating gene coordinate…
......@@ -1655,8 +1655,8 @@ sub update_coords {
WHERE gene_id = ?
);
my $sth = $self->prepare($update_sql);
$sth->bind_param(1, $gene->start);
$sth->bind_param(2, $gene->end);
$sth->bind_param(1, $gene->seq_region_start);
$sth->bind_param(2, $gene->seq_region_end);
$sth->bind_param(3, $gene->dbID);
$sth->execute();
}
......
......@@ -473,6 +473,20 @@ my $new_gene = $ga->fetch_by_stable_id("ENSG00000171456");
cmp_ok($new_gene->start(), '==', 30735607, 'Updated gene start');
cmp_ok($new_gene->end(), '==', 30815178, 'Updated gene end');
# test update_coords method when working on sub Slice
my $update_slice = $db->get_SliceAdaptor()->fetch_by_region('chromosome', '20', 30730000, 30815178);
my $update_genes = $update_slice->get_all_Genes();
cmp_ok(scalar(@$update_genes), '>=', 1, 'Check the region has at least one gene');
foreach my $gene_to_update (@$update_genes) {
if ($gene_to_update->stable_id() eq 'ENSG00000171456') {
$ga->update_coords($gene_to_update);
}
}
my $updated_gene = $ga->fetch_by_stable_id("ENSG00000171456");
cmp_ok($updated_gene->start(), '==', 30735607, 'Updated gene start');
cmp_ok($updated_gene->end(), '==', 30815178, 'Updated gene end');
#
# test GeneAdaptor::fetch_all_by_domain
#
......
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