diff --git a/src/main/java/InteractiveInterface.java b/src/main/java/InteractiveInterface.java index 87d1fa1..ef79319 100644 --- a/src/main/java/InteractiveInterface.java +++ b/src/main/java/InteractiveInterface.java @@ -275,10 +275,16 @@ public class InteractiveInterface { readDepth = sc.nextInt(); System.out.print("\nPlease enter probability of a sequence read error (0.0 to 1.0): "); readErrorRate = sc.nextDouble(); + if(readErrorRate < 0.0 || readErrorRate > 1.0) { + throw new InputMismatchException("The read error rate must be in the range [0.0, 1.0]"); + } System.out.println("\nPlease enter the probability of read error collision"); System.out.println("(the likelihood that two read errors produce the same spurious sequence)"); System.out.print("(0.0 to 1.0): "); errorCollisionRate = sc.nextDouble(); + if(errorCollisionRate < 0.0 || errorCollisionRate > 1.0) { + throw new InputMismatchException("The error collision rate must be in the range [0.0, 1.0]"); + } } System.out.println("\nThe graph and occupancy data will be written to a file."); System.out.print("Please enter a name for the output file: ");