Skip to content

Commit

Permalink
Cuppa: Fix alt sj prep not warning when rna data is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
luan-n-nguyen committed Dec 16, 2024
1 parent 8f60a60 commit 61e9f0d
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -52,15 +52,15 @@ public List<DataItem> extractSampleData(final String sampleId)
if(mRefAsjIndexMap.isEmpty())
return null;

List<DataItem> dataItems = Lists.newArrayList();

final String filename = mConfig.altSpliceJunctionFile(sampleId);

if(!Files.exists(Paths.get(filename)))
return dataItems;
return null;

try
{
List<DataItem> dataItems = new ArrayList<>();

final List<String> lines = Files.readAllLines(Paths.get(filename));
String fileDelim = inferFileDelimiter(filename);

Expand Down Expand Up @@ -103,15 +103,16 @@ public List<DataItem> 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";
Expand Down

0 comments on commit 61e9f0d

Please sign in to comment.