Skip to content

Commit

Permalink
Merge pull request #438 from sanger/average_size
Browse files Browse the repository at this point in the history
x1221 change: max/min size -> average size
  • Loading branch information
khelwood authored Jul 23, 2024
2 parents 6b0af1e + 517066d commit 17ba414
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class OpWithSlotMeasurementsServiceImp implements OpWithSlotMeasurementsS
OP_QPCR = "qPCR results";
public static final String MEAS_CQ = "Cq value", MEAS_CDNA = "cDNA concentration",
MEAS_LIBR = "Library concentration", MEAS_CYC = "Cycles",
MEAS_MIN_SIZE = "Minimum size", MEAS_MAX_SIZE = "Maximum size", MEAS_PEAK_SIZE = "Main peak size"
AVERAGE_SIZE = "Average size", MEAS_PEAK_SIZE = "Main peak size"
;

private final MeasurementRepo measurementRepo;
Expand Down Expand Up @@ -66,7 +66,7 @@ public OpWithSlotMeasurementsServiceImp(MeasurementRepo measurementRepo, Operati
this.valHelperFactory = valHelperFactory;
UCMap<List<String>> opTypeMeasurements = new UCMap<>(3);
opTypeMeasurements.put(OP_AMP, List.of(MEAS_CQ, MEAS_CYC));
opTypeMeasurements.put(OP_VISIUM_CONC, List.of(MEAS_CDNA, MEAS_LIBR, MEAS_MIN_SIZE, MEAS_MAX_SIZE, MEAS_PEAK_SIZE));
opTypeMeasurements.put(OP_VISIUM_CONC, List.of(MEAS_CDNA, MEAS_LIBR, AVERAGE_SIZE, MEAS_PEAK_SIZE));
opTypeMeasurements.put(OP_QPCR, List.of(MEAS_CQ));
this.opTypeMeasurements = Collections.unmodifiableMap(opTypeMeasurements);
}
Expand Down Expand Up @@ -268,7 +268,7 @@ public String sanitiseMeasurementName(OperationType opType, String name) {
public String sanitiseMeasurementValue(Collection<String> problems, String name, String value) {
return switch (name) {
case MEAS_CDNA, MEAS_LIBR -> concentrationSanitiser.sanitise(problems, value);
case MEAS_MIN_SIZE, MEAS_MAX_SIZE, MEAS_PEAK_SIZE -> sizeSanitiser.sanitise(problems, value);
case AVERAGE_SIZE, MEAS_PEAK_SIZE -> sizeSanitiser.sanitise(problems, value);
case MEAS_CQ -> cqSanitiser.sanitise(problems, value);
case MEAS_CYC -> cycleSanitiser.sanitise(problems, value);
default -> null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public class HistoryServiceImp implements HistoryService {
static final String RELEASE_EVENT_TYPE = "Release", DESTRUCTION_EVENT_TYPE = "Destruction",
SOLUTION_TRANSFER_OP_NAME = "Solution transfer";
static final Pattern SIZE_BP_PTN = Pattern.compile("^M((in|ax)imum|ain peak) size$", Pattern.CASE_INSENSITIVE);
static final Pattern SIZE_BP_PTN = Pattern.compile("^(Average|Main peak) size$", Pattern.CASE_INSENSITIVE);

private final OperationRepo opRepo;
private final OperationTypeRepo opTypeRepo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,15 +441,14 @@ public void testValidateComments() {
"Sploop,20,,",
"Cq value,20,x!,,Bad value",
"Cycles,024,24,",
"Minimum size,20,20,",
"Maximum size,40,40,",
"Average size,20,20,",
"Main peak size,30,30,",
})
public void testSanitiseMeasurementValue(String name, String value, String sanValue, String problem) {
List<Sanitiser<String>> sans = List.of(mockConcSan, mockCqSan, mockCycSan);
Sanitiser<String> san = switch (name) {
case "cDNA concentration", "Library concentration" -> mockConcSan;
case "Minimum size", "Maximum size", "Main peak size" -> mockSizeSan;
case "Average size", "Main peak size" -> mockSizeSan;
case "Cq value" -> mockCqSan;
case "Cycles" -> mockCycSan;
default -> null;
Expand Down

0 comments on commit 17ba414

Please sign in to comment.