From feec2e3704d02f5f29e11bbd7d21a75d52efb5c6 Mon Sep 17 00:00:00 2001 From: Jiahang Li <55948986+Djokovic0311@users.noreply.github.com> Date: Tue, 22 Aug 2023 14:35:42 -0400 Subject: [PATCH] Generic assay binary types (#10335) * update possible valid binary types * Update ExpressionEnrichmentUtil.java * modify postypelist datatype --- .../service/util/ExpressionEnrichmentUtil.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/service/src/main/java/org/cbioportal/service/util/ExpressionEnrichmentUtil.java b/service/src/main/java/org/cbioportal/service/util/ExpressionEnrichmentUtil.java index 79c4ace75a7..2fedb6eb5dd 100644 --- a/service/src/main/java/org/cbioportal/service/util/ExpressionEnrichmentUtil.java +++ b/service/src/main/java/org/cbioportal/service/util/ExpressionEnrichmentUtil.java @@ -48,8 +48,8 @@ public class ExpressionEnrichmentUtil { private static final double LOG2 = Math.log(2); private static final String RNA_SEQ = "rna_seq"; - private static final String POS = "true"; - private static final String NEG = "false"; + private static final List posTypeList = Arrays.asList("true", "yes"); + private static final List negTypeList = Arrays.asList("false", "no"); private static final String ALTERED = "1"; private static final String UNALTERED = "0"; public List getEnrichments( @@ -205,7 +205,15 @@ public List g List molecularDataValues = group.getValue().stream() .map(sampleIndex -> ma.getSplitValues()[sampleIndex]) .filter(StringUtils::isNotEmpty) - .map(a -> a.equals(POS) ? ALTERED : UNALTERED) + .map(a ->{ + if (posTypeList.contains(a)) { + return ALTERED; + } else if (negTypeList.contains(a)) { + return UNALTERED; + } else { + return a; + } + }) .collect(Collectors.toList()); // ignore group if there are less than 2 values