Unverified Commit e3f8508b authored by Magali Ruffier's avatar Magali Ruffier Committed by GitHub
Browse files

Merge pull request #331 from thibauthourlier/hotfix/gene_update_coords

Use seq_region_start and seq_region_end when updating gene coordinate…
parents 5f04c24a 366fca53
......@@ -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,23 @@ 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
# to avoid setting the start and end relative to a sub Slice
# correct coords: 30735607 - 30815178
# wrong coords: 1 - 79572
my $update_slice = $db->get_SliceAdaptor()->fetch_by_gene_stable_id('ENSG00000171456');
# Make sure that the slice of the gene is a sub Slice
my $update_genes = $update_slice->get_all_Genes();
# Update the coordinates of the gene in the database
foreach my $gene_to_update (@$update_genes) {
$ga->update_coords($gene_to_update);
}
# Fetch the gene again to check the coordinates
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
#
......
Markdown is supported
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