From 61e9f0d8ece11254f9fda691ee34a9020e67b89f Mon Sep 17 00:00:00 2001 From: Luan Nguyen Date: Mon, 16 Dec 2024 13:07:51 +1100 Subject: [PATCH] Cuppa: Fix alt sj prep not warning when rna data is missing --- .../hmftools/cup/rna/AltSpliceJunctionPrep.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cuppa/src/main/java/com/hartwig/hmftools/cup/rna/AltSpliceJunctionPrep.java b/cuppa/src/main/java/com/hartwig/hmftools/cup/rna/AltSpliceJunctionPrep.java index f029d83553..34caaa3f7b 100644 --- a/cuppa/src/main/java/com/hartwig/hmftools/cup/rna/AltSpliceJunctionPrep.java +++ b/cuppa/src/main/java/com/hartwig/hmftools/cup/rna/AltSpliceJunctionPrep.java @@ -14,12 +14,12 @@ import java.io.BufferedReader; import java.nio.file.Files; import java.nio.file.Paths; +import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.hartwig.hmftools.common.rna.AltSpliceJunctionFile; import com.hartwig.hmftools.cup.prep.CategoryType; @@ -52,15 +52,15 @@ public List extractSampleData(final String sampleId) if(mRefAsjIndexMap.isEmpty()) return null; - List dataItems = Lists.newArrayList(); - final String filename = mConfig.altSpliceJunctionFile(sampleId); if(!Files.exists(Paths.get(filename))) - return dataItems; + return null; try { + List dataItems = new ArrayList<>(); + final List lines = Files.readAllLines(Paths.get(filename)); String fileDelim = inferFileDelimiter(filename); @@ -103,15 +103,16 @@ public List extractSampleData(final String sampleId) { CUP_LOGGER.warn("sample({}) had no matching alt-SJs of the {} provided in configItem(-{})", sampleId, mRefAsjIndexMap.size(), REF_ALT_SJ_SITES); } + + return dataItems; } catch(Exception e) { CUP_LOGGER.error("sample({}) failed to extract category({}):", sampleId, categoryType()); e.printStackTrace(); System.exit(1); + return null; } - - return dataItems; } public static final String FLD_POS_START = "PosStart";