Skip to content

Commit

Permalink
Generic assay binary types (#10335)
Browse files Browse the repository at this point in the history
* update possible valid binary types

* Update ExpressionEnrichmentUtil.java

* modify postypelist datatype
  • Loading branch information
Djokovic0311 authored Aug 22, 2023
1 parent 7f6471a commit feec2e3
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> posTypeList = Arrays.asList("true", "yes");
private static final List<String> negTypeList = Arrays.asList("false", "no");
private static final String ALTERED = "1";
private static final String UNALTERED = "0";
public <T extends MolecularAlteration, S extends ExpressionEnrichment> List<S> getEnrichments(
Expand Down Expand Up @@ -205,7 +205,15 @@ public <T extends MolecularAlteration, S extends ExpressionEnrichment> List<S> g
List<String> 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
Expand Down

0 comments on commit feec2e3

Please sign in to comment.