Skip to content

Commit

Permalink
add in detailed case summary input format to cardea plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
grapigeau committed Oct 11, 2024
1 parent 05627fb commit 516b5b1
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package ca.on.oicr.gsi.shesmu.cardea;

import ca.on.oicr.gsi.shesmu.plugin.input.InputFormat;

public class CaseSummaryDetailedFormatDefinition extends InputFormat {

public CaseSummaryDetailedFormatDefinition() {
super("case_detailed_summary", CaseSummaryDetailedValue.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
package ca.on.oicr.gsi.shesmu.cardea;

import ca.on.oicr.gsi.shesmu.plugin.Tuple;
import ca.on.oicr.gsi.shesmu.plugin.input.ShesmuVariable;
import java.time.Instant;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class CaseSummaryDetailedValue {
private final String assayName;
private final String assayVersion;
private final String caseIdentifier;
private final String caseStatus;
private final Optional<Instant> completedDate;
private final Set<Tuple> sequencing;
private final long requisitionId;
private final String requisitionName;
private final boolean stopped;
private final boolean paused;

public CaseSummaryDetailedValue(
String assayName,
String assayVersion,
String caseIdentifier,
String caseStatus,
Optional<Instant> completedDate,
Stream<SequencingTestValue> sequencingTestValueStream,
long requisitionId,
String requisitionName,
boolean stopped,
boolean paused) {
super();
this.assayName = assayName;
this.assayVersion = assayVersion;
this.caseIdentifier = caseIdentifier;
this.caseStatus = caseStatus;
this.completedDate = completedDate;
this.sequencing =
sequencingTestValueStream
.map(
sequencingTest ->
new Tuple(
sequencingTest.test(),
sequencingTest.type(),
sequencingTest.isComplete(),
sequencingTest.limsIds()))
.collect(Collectors.toSet());
this.requisitionId = requisitionId;
this.requisitionName = requisitionName;
this.stopped = stopped;
this.paused = paused;
}

@ShesmuVariable
public String assay_name() {
return assayName;
}

@ShesmuVariable
public String assay_version() {
return assayVersion;
}

@ShesmuVariable
public String case_identifier() {
return caseIdentifier;
}

@ShesmuVariable
public String case_status() {
return caseStatus;
}

@ShesmuVariable
public Optional<Instant> completed_date() {
return completedDate;
}

@ShesmuVariable(type = "ao4test$stype$sis_complete$blims_ids$ao2lims_id$ssupplemental$b")
public Set<Tuple> sequencing() {
return sequencing;
}

@ShesmuVariable
public long requisition_id() {
return requisitionId;
}

@ShesmuVariable
public String requisition_name() {
return requisitionName;
}

@ShesmuVariable
public boolean stopped() {
return stopped;
}

@ShesmuVariable
public boolean paused() {
return paused;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package ca.on.oicr.gsi.shesmu.cardea;

import ca.on.oicr.gsi.shesmu.plugin.input.ShesmuVariable;

public class LimsSequencingInfo {
private final String limsId;
private final boolean supplemental;

public LimsSequencingInfo(String limsId, boolean supplemental) {
super();
this.limsId = limsId;
this.supplemental = supplemental;
}

@ShesmuVariable
public String limsId() {
return limsId;
}

@ShesmuVariable
public boolean supplemental() {
return supplemental;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package ca.on.oicr.gsi.shesmu.cardea;

import ca.on.oicr.gsi.shesmu.plugin.Tuple;
import ca.on.oicr.gsi.shesmu.plugin.input.ShesmuVariable;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class SequencingTestValue {
private final String test;
private final String type;
private final Set<Tuple> limsIds;
private final boolean isComplete;

public SequencingTestValue(
String test, String type, Stream<LimsSequencingInfo> limsIds, boolean isComplete) {
super();
this.test = test;
this.type = type;
this.limsIds =
limsIds
.map(info -> new Tuple(info.limsId(), info.supplemental()))
.collect(Collectors.toSet());
this.isComplete = isComplete;
}

@ShesmuVariable
public String test() {
return test;
}

@ShesmuVariable
public String type() {
return type;
}

@ShesmuVariable
public Set<Tuple> limsIds() {
return limsIds;
}

@ShesmuVariable
public boolean isComplete() {
return isComplete;
}
}
4 changes: 3 additions & 1 deletion plugin-cardea/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ca.on.oicr.gsi.shesmu.cardea.CaseSummaryDetailedFormatDefinition;
import ca.on.oicr.gsi.shesmu.cardea.CaseSummaryFormatDefinition;
import ca.on.oicr.gsi.shesmu.plugin.input.InputFormat;

Expand All @@ -7,5 +8,6 @@
requires ca.on.oicr.gsi.shesmu;

provides InputFormat with
CaseSummaryFormatDefinition;
CaseSummaryFormatDefinition,
CaseSummaryDetailedFormatDefinition;
}

0 comments on commit 516b5b1

Please sign in to comment.