From 53136563c75357e79a038466c26657d1869acb5f Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Mon, 8 Apr 2024 22:06:59 +1200 Subject: [PATCH] Add code to fix allele in --change-gene-id Refs pombase/canto#2677 --- lib/Canto/Track/TrackUtil.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Canto/Track/TrackUtil.pm b/lib/Canto/Track/TrackUtil.pm index b127be4c2..6d18641b3 100644 --- a/lib/Canto/Track/TrackUtil.pm +++ b/lib/Canto/Track/TrackUtil.pm @@ -459,6 +459,17 @@ sub change_gene_id $gene->update(); } } + + my $allele_rs = $cursdb->resultset('Allele'); + + while (defined (my $allele = $allele_rs->next())) { + my $primary_identifier = $allele->primary_identifier(); + if ($primary_identifier =~ /^$from_id:/) { + $primary_identifier =~ s/^$from_id:/$to_id:/; + $allele->primary_identifier($primary_identifier); + $allele->update(); + } + } }; Canto::Track::curs_map($self->config(), $track_schema, $proc);