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

Removed stable id check in loop. Added comments

parent a8b6934d
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…
......@@ -474,15 +474,18 @@ 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);
# 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();
cmp_ok(scalar(@$update_genes), '>=', 1, 'Check the region has at least one gene');
# Update the coordinates of the gene in the database
foreach my $gene_to_update (@$update_genes) {
if ($gene_to_update->stable_id() eq 'ENSG00000171456') {
$ga->update_coords($gene_to_update);
}
$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');
......
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