-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GLT-4274] show omissions on the Run Details page
- Loading branch information
Showing
22 changed files
with
442 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Omissions table on the Run Details page, showing libraries that are included in the run but not a | ||
part of any case |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
src/main/java/ca/on/oicr/gsi/dimsum/data/RunAndLibraries.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package ca.on.oicr.gsi.dimsum.data; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
import java.util.Collections; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
import ca.on.oicr.gsi.cardea.data.OmittedRunSample; | ||
import ca.on.oicr.gsi.cardea.data.Run; | ||
import ca.on.oicr.gsi.cardea.data.Sample; | ||
|
||
/** | ||
* Immutable RunAndLibraries | ||
*/ | ||
public class RunAndLibraries { | ||
|
||
private final Set<Sample> fullDepthSequencings; | ||
private final Set<Sample> libraryQualifications; | ||
private final Set<OmittedRunSample> omittedSamples; | ||
private final Run run; | ||
|
||
private RunAndLibraries(Builder builder) { | ||
this.run = requireNonNull(builder.run); | ||
this.libraryQualifications = Collections.unmodifiableSet(builder.libraryQualifications); | ||
this.fullDepthSequencings = Collections.unmodifiableSet(builder.fullDepthSequencings); | ||
this.omittedSamples = Collections.unmodifiableSet(builder.omittedSamples); | ||
} | ||
|
||
public Set<Sample> getFullDepthSequencings() { | ||
return fullDepthSequencings; | ||
} | ||
|
||
public Set<Sample> getLibraryQualifications() { | ||
return libraryQualifications; | ||
} | ||
|
||
public Set<OmittedRunSample> getOmittedSamples() { | ||
return omittedSamples; | ||
} | ||
|
||
public Run getRun() { | ||
return run; | ||
} | ||
|
||
public static class Builder { | ||
|
||
private Set<Sample> fullDepthSequencings = new HashSet<>(); | ||
private Set<Sample> libraryQualifications = new HashSet<>(); | ||
private Set<OmittedRunSample> omittedSamples = new HashSet<>(); | ||
private Run run; | ||
|
||
public Builder addFullDepthSequencing(Sample sample) { | ||
fullDepthSequencings.add(sample); | ||
return this; | ||
} | ||
|
||
public Builder addLibraryQualification(Sample sample) { | ||
libraryQualifications.add(sample); | ||
return this; | ||
} | ||
|
||
public Builder addOmittedSample(OmittedRunSample sample) { | ||
omittedSamples.add(sample); | ||
return this; | ||
} | ||
|
||
public RunAndLibraries build() { | ||
return new RunAndLibraries(this); | ||
} | ||
|
||
public Builder run(Run run) { | ||
this.run = run; | ||
return this; | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/main/java/ca/on/oicr/gsi/dimsum/service/filtering/OmittedRunSampleSort.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package ca.on.oicr.gsi.dimsum.service.filtering; | ||
|
||
import java.util.Comparator; | ||
import java.util.Map; | ||
import java.util.function.Function; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.Stream; | ||
import ca.on.oicr.gsi.cardea.data.OmittedRunSample; | ||
import ca.on.oicr.gsi.dimsum.util.DataUtils; | ||
|
||
public enum OmittedRunSampleSort { | ||
|
||
// @formatter:off | ||
NAME("Name", Comparator.comparing(OmittedRunSample::getName)), | ||
QC_STATUS("QC Status", Comparator.comparing(OmittedRunSampleSort::getQcStatusSortPriority)); | ||
// @formatter:on | ||
|
||
private static final Map<String, OmittedRunSampleSort> map = | ||
Stream.of(OmittedRunSampleSort.values()) | ||
.collect(Collectors.toMap(OmittedRunSampleSort::getLabel, Function.identity())); | ||
|
||
public static OmittedRunSampleSort getByLabel(String label) { | ||
return map.get(label); | ||
} | ||
|
||
private final String label; | ||
private final Comparator<OmittedRunSample> comparator; | ||
|
||
private OmittedRunSampleSort(String label, Comparator<OmittedRunSample> comparator) { | ||
this.label = label; | ||
this.comparator = comparator; | ||
} | ||
|
||
public String getLabel() { | ||
return label; | ||
} | ||
|
||
public Comparator<OmittedRunSample> comparator() { | ||
return comparator; | ||
} | ||
|
||
protected static int getQcStatusSortPriority(OmittedRunSample sample) { | ||
if (sample.getQcDate() == null) { | ||
return 1; | ||
} else if (sample.getDataReviewDate() == null) { | ||
return 2; | ||
} else if (DataUtils.isTopUpRequired(sample)) { | ||
return 3; | ||
} else if (Boolean.TRUE.equals(sample.getQcPassed())) { | ||
return 4; | ||
} else { | ||
return 5; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.