Skip to content

Commit

Permalink
Compar: fixed category config loading when PURPLE & LINX are specified
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesshale committed Jan 12, 2024
1 parent 931b770 commit 4302ad1
Showing 1 changed file with 7 additions and 27 deletions.
34 changes: 7 additions & 27 deletions compar/src/main/java/com/hartwig/hmftools/compar/ComparConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,38 +125,18 @@ else if(categoriesStr.contains(PANEL_CATEGORIES))
if(categoriesStr.contains(PANEL_CATEGORIES))
Category.panelCategories().forEach(x -> Categories.put(x, matchLevel));
}
else if(categoriesStr.contains(PURPLE_CATEGORIES) || categoriesStr.contains(LINX_CATEGORIES))
{
if(categoriesStr.contains(PURPLE_CATEGORIES))
purpleCategories().forEach(x -> Categories.put(x, matchLevel));

if(categoriesStr.contains(LINX_CATEGORIES))
linxCategories().forEach(x -> Categories.put(x, matchLevel));
}
else
{
final String[] catDataList = configBuilder.getValue(CATEGORIES).split(CSV_DELIM);
final String[] categoryStrings = configBuilder.getValue(CATEGORIES).split(CSV_DELIM);

for(String catData : catDataList)
for(String catStr : categoryStrings)
{
Category category;
MatchLevel specificMatchLevel;

if(catData.contains("="))
{
String[] catItems = catData.split("=");
category = Category.valueOf(catItems[0]);
specificMatchLevel = MatchLevel.valueOf(catItems[1]);

CMP_LOGGER.info("specific category({}) and matchLevel({})", category, specificMatchLevel);
}
if(catStr.equals(PURPLE_CATEGORIES))
purpleCategories().forEach(x -> Categories.put(x, matchLevel));
else if(catStr.equals(LINX_CATEGORIES))
linxCategories().forEach(x -> Categories.put(x, matchLevel));
else
{
category = Category.valueOf(catData);
specificMatchLevel = matchLevel;
}

Categories.put(category, specificMatchLevel);
Categories.put(Category.valueOf(catStr), matchLevel);
}
}

Expand Down

0 comments on commit 4302ad1

Please sign in to comment.