Add exception handling
This commit is contained in:
@@ -275,10 +275,16 @@ public class InteractiveInterface {
|
|||||||
readDepth = sc.nextInt();
|
readDepth = sc.nextInt();
|
||||||
System.out.print("\nPlease enter probability of a sequence read error (0.0 to 1.0): ");
|
System.out.print("\nPlease enter probability of a sequence read error (0.0 to 1.0): ");
|
||||||
readErrorRate = sc.nextDouble();
|
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("\nPlease enter the probability of read error collision");
|
||||||
System.out.println("(the likelihood that two read errors produce the same spurious sequence)");
|
System.out.println("(the likelihood that two read errors produce the same spurious sequence)");
|
||||||
System.out.print("(0.0 to 1.0): ");
|
System.out.print("(0.0 to 1.0): ");
|
||||||
errorCollisionRate = sc.nextDouble();
|
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.println("\nThe graph and occupancy data will be written to a file.");
|
||||||
System.out.print("Please enter a name for the output file: ");
|
System.out.print("Please enter a name for the output file: ");
|
||||||
|
|||||||
Reference in New Issue
Block a user