Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,13 @@ private void makeRecordsList() {
for (String gene : genes) {
StringBuilder line = new StringBuilder(gene);
for (String sample : samples) {
String cnaValue = "0";
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: consider whether "0" or "NA" should be the default value in such cases

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In both cases (diploid / NA) there isn't a record added to the database, so they're equivalent.

String cnaValue;
Object value = cnaMap.get(gene, sample);
if (value != null) {
cnaValue = value.toString();
cnaValue = value.toString().trim();
cnaValue = cnaValue.isEmpty() ? "NA" : cnaValue;
} else {
cnaValue = "NA";
}
line.append("\t").append(cnaValue);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ public String process(CVRGenePanelRecord i) throws Exception {
List<String> record = new ArrayList<>();
record.add(cvrUtilities.convertWhitespace(i.getSAMPLE_ID()));
for (String profile : geneticProfiles) {
record.add(cvrUtilities.convertWhitespace(i.getPanelMap().get(profile)));
String raw = i.getPanelMap().get(profile);
String value = (raw == null || raw.trim().isEmpty()) ? "NA" : raw;
record.add(cvrUtilities.convertWhitespace(value));
}
return String.join("\t", record);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,21 @@ public void setSO_COMMENTS(String soComments) {
}

public String getSAMPLE_COVERAGE() {
return this.sampleCoverage != null ? this.sampleCoverage : "";
if (Strings.isNullOrEmpty(this.sampleCoverage) || "null".equals(this.sampleCoverage)) {
return "NA";
}
return this.sampleCoverage;
}

public void setSAMPLE_COVERAGE(String sampleCoverage) {
this.sampleCoverage = sampleCoverage;
}

public String getCYCLE_THRESHOLD() {
return this.cycleThreshold != null ? this.cycleThreshold : "";
if (Strings.isNullOrEmpty(this.cycleThreshold) || "null".equals(this.cycleThreshold)) {
return "NA";
}
return this.cycleThreshold;
}

public void setCYCLE_THRESHOLD(String cycleThreshold) {
Expand Down Expand Up @@ -301,7 +307,10 @@ public void setMSI_COMMENT(String msiComment) {
}

public String getMSI_SCORE() {
return this.msiScore != null ? this.msiScore : "";
if (Strings.isNullOrEmpty(this.msiScore) || "Not Available".equals(this.msiScore)) {
return "NA";
}
return this.msiScore;
}

public void setMSI_SCORE(String msiScore) {
Expand Down