From c644d51a0393962d519f8f4b7b439614afe3d94b Mon Sep 17 00:00:00 2001 From: jrobinso <933148+jrobinso@users.noreply.github.com> Date: Mon, 30 Sep 2024 12:06:33 -0700 Subject: [PATCH] fix for chrom alias defaults --- .../broad/igv/feature/genome/ChromAlias.java | 20 +++++++++++-------- .../feature/genome/ChromAliasDefaults.java | 1 + 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/broad/igv/feature/genome/ChromAlias.java b/src/main/java/org/broad/igv/feature/genome/ChromAlias.java index 2dac9e06d..dc1de69ab 100644 --- a/src/main/java/org/broad/igv/feature/genome/ChromAlias.java +++ b/src/main/java/org/broad/igv/feature/genome/ChromAlias.java @@ -5,34 +5,38 @@ import java.util.Map; public class ChromAlias { - + private String chr; + + /** + * Map of name set -> alias + */ private Map aliases; public ChromAlias(String chr) { this.chr = chr; this.aliases = new HashMap<>(); } - + public String getChr() { return chr; } - + public void put(String nameSet, String alias) { aliases.put(nameSet, alias); } + public String get(String nameSet) { return aliases.get(nameSet); } - + public boolean containsKey(String nameSet) { return aliases.containsKey(nameSet); } - + public Collection values() { return aliases.values(); } - - - + + } diff --git a/src/main/java/org/broad/igv/feature/genome/ChromAliasDefaults.java b/src/main/java/org/broad/igv/feature/genome/ChromAliasDefaults.java index 964967508..f930e4353 100644 --- a/src/main/java/org/broad/igv/feature/genome/ChromAliasDefaults.java +++ b/src/main/java/org/broad/igv/feature/genome/ChromAliasDefaults.java @@ -23,6 +23,7 @@ private void init(String id, List chromosomeNames) { boolean skipRest = false; ChromAlias record = new ChromAlias(name); + record.put("__CANONICAL__", name); aliasRecords.add(record); //