diff --git a/src/tools/ComponentCutterMain.java b/src/tools/ComponentCutterMain.java index c9b9d85..6b3cdf8 100644 --- a/src/tools/ComponentCutterMain.java +++ b/src/tools/ComponentCutterMain.java @@ -75,6 +75,9 @@ protected void runImpl() throws ExecutionFailedException { BigLong2ShortHashMap hm = IOUtils.loadReads(sequencesFiles.get(), k.get(), minLen.get(), availableProcessors.get(), logger); debug("Memory used = " + Misc.usedMemoryAsString() + ", time = " + t); + if (hm.size() == 0) { + throw new ExecutionFailedException("No sequences were found in input files! The following steps will be useless"); + } info("Searching for components..."); @@ -91,6 +94,9 @@ protected void runImpl() throws ExecutionFailedException { return; } info("Total " + NumUtils.groupDigits(components.size()) + " components were found"); + if (components.size() == 0) { + warn("No components were extracted! Perhaps you should decrease --min-component-size value"); + } try { ConnectedComponent.saveComponents(components, componentsFile.get().getAbsolutePath()); diff --git a/src/tools/FeaturesCalculatorMain.java b/src/tools/FeaturesCalculatorMain.java index a69fe5f..acc3005 100644 --- a/src/tools/FeaturesCalculatorMain.java +++ b/src/tools/FeaturesCalculatorMain.java @@ -76,8 +76,7 @@ protected void runImpl() throws ExecutionFailedException { info(NumUtils.groupDigits(components.size()) + " components loaded from " + componentsFile.get()); if (components.size() == 0) { - error("No components were found!!! Can't continue the calculations."); - System.exit(1); + throw new ExecutionFailedException("No components were found in input files! Can't continue the calculations."); } String compName = FileUtils.removeExtension(componentsFile.get().getName(), ".bin"); diff --git a/src/tools/KmersCounterMain.java b/src/tools/KmersCounterMain.java index 5706f05..08d1dc4 100644 --- a/src/tools/KmersCounterMain.java +++ b/src/tools/KmersCounterMain.java @@ -105,6 +105,11 @@ protected void runImpl() throws ExecutionFailedException { info(NumUtils.groupDigits(hm.size()) + " k-mers found, " + NumUtils.groupDigits(c) + " (" + String.format("%.1f", c * 100.0 / hm.size()) + "%) of them is good (not erroneous)"); + if (hm.size() == 0) { + warn("No k-mers found in reads! Perhaps you reads file is empty or k-mer size is too big"); + } else if (c == 0 || c < (long) (hm.size() * 0.03)) { + warn("Too few good k-mers were found! Perhaps you should decrease k-mer size or --maximal-bad-frequency value"); + } long allKmersNumber = (1L << (2*k.get())) / 2; // (4^k)/2 if (hm.size() == allKmersNumber) { warn("All possible k-mers were found in reads! Perhaps you should increase k-mer size"); diff --git a/src/tools/SeqBuilderMain.java b/src/tools/SeqBuilderMain.java index aea379d..d27cd20 100644 --- a/src/tools/SeqBuilderMain.java +++ b/src/tools/SeqBuilderMain.java @@ -151,6 +151,9 @@ protected void runImpl() throws ExecutionFailedException { return; } info(NumUtils.groupDigits(sequences.size()) + " sequences found"); + if (sequences.size() == 0) { + warn("No sequences were found! Perhaps you should decrease --min-seq-len or --maximal-bad-frequency values"); + } debug("Memory used (without running GC) = " + Misc.usedMemoryWithoutRunningGCAsString()); try {