Skip to content

Commit 3a7a484

Browse files
committed
Change preference hierarchy behavior -- user settings for generic alignment tracks ("Alignments" tab) will now cascade down to RNA and 3rd gen alignments if there is no specific user setting for those types. Fixes igvteam#760.
1 parent 679098c commit 3a7a484

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

src/main/java/org/broad/igv/prefs/IGVPreferences.java

+11-13
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,15 @@ public IGVPreferences(Map<String, String> userPreferences,
8686
public String get(String key) {
8787
key = key.trim();
8888

89-
if(userPreferences.containsKey(key)) {
89+
if (userPreferences.containsKey(key)) {
9090
return userPreferences.get(key);
91-
}
92-
else if(defaults != null && defaults.containsKey(key)) {
91+
} else if (parent != null && parent.userPreferences.containsKey(key)) {
92+
return parent.userPreferences.get(key);
93+
} else if (defaults != null && defaults.containsKey(key)) {
9394
return defaults.get(key);
94-
}
95-
else if(parent != null) {
95+
} else if (parent != null) {
9696
return parent.get(key);
97-
}
98-
else {
97+
} else {
9998
return null;
10099
}
101100
}
@@ -104,6 +103,7 @@ else if(parent != null) {
104103
/**
105104
* Return preference with given key and specified default value. If key is not present defaultValue is returned,
106105
* no search through defaults or hierarchy is performed.
106+
*
107107
* @param key
108108
* @param defaultValue
109109
* @return
@@ -115,7 +115,6 @@ public String get(String key, String defaultValue) {
115115
}
116116

117117

118-
119118
/**
120119
* Return the preference as a boolean value.
121120
*
@@ -243,10 +242,9 @@ public void addOverrides(Map<String, String> newPrefs) {
243242

244243
public boolean getAntiAliasing() {
245244

246-
if(userPreferences.containsKey(Constants.ENABLE_ANTIALISING) || Globals.IS_LINUX == false) {
245+
if (userPreferences.containsKey(Constants.ENABLE_ANTIALISING) || Globals.IS_LINUX == false) {
247246
return getAsBoolean(Constants.ENABLE_ANTIALISING);
248-
}
249-
else {
247+
} else {
250248
// Linux with no explicit setting
251249
return false;
252250
}
@@ -792,7 +790,7 @@ private PaletteColorTable getLegacyMutationColorScheme() {
792790
}
793791

794792
static String getMutationColorKey(String type) {
795-
switch(type) {
793+
switch (type) {
796794
case "Indel":
797795
return MUTATION_INDEL_COLOR_KEY;
798796
case "Missense":
@@ -934,6 +932,6 @@ public void print(PrintWriter pw) {
934932
pw.println(entry.getValue());
935933
}
936934
}
937-
935+
938936

939937
}

src/main/resources/org/broad/igv/prefs/preferences.tab

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ CN_FREQ.AMP_THRESHOLD CN freq amplification threshold float 0.1
6262
CN_FREQ.DEL_THRESHOLD CN freq deletion threshold float -0.1
6363

6464
#Alignments
65+
info Settings for alignment tracks. See the RNA or Third Gen tabs to override for specific types.
6566

6667
##Track Display
6768
SAM.SHOW_ALIGNMENT_TRACK Show alignment track boolean TRUE

0 commit comments

Comments
 (0)