Skip to content

Commit

Permalink
Additional warning messages
Browse files Browse the repository at this point in the history
  • Loading branch information
svkazakov committed Aug 4, 2016
1 parent 4ab5b0c commit 0d1eca4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/tools/ComponentCutterMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -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...");
Expand All @@ -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());
Expand Down
3 changes: 1 addition & 2 deletions src/tools/FeaturesCalculatorMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
5 changes: 5 additions & 0 deletions src/tools/KmersCounterMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 3 additions & 0 deletions src/tools/SeqBuilderMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0d1eca4

Please sign in to comment.