Skip to content

Commit

Permalink
Merge pull request #1219 from hallieswan/AG-1183
Browse files Browse the repository at this point in the history
AG-1183: missing scores in csv should be represented by empty string instead of null
  • Loading branch information
JessterB authored Jul 7, 2023
2 parents 1f58ead + 4afad1e commit ed006c0
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -978,9 +978,9 @@ export class GeneComparisonToolComponent implements OnInit, AVI, OnDestroy {
const baseRow = [
g.ensembl_gene_id,
g.hgnc_symbol,
g.target_risk_score,
g.multi_omics_score,
g.genetics_score
this.returnEmptyStringIfNull(g.target_risk_score),
this.returnEmptyStringIfNull(g.multi_omics_score),
this.returnEmptyStringIfNull(g.genetics_score)
];

if ('Protein - Differential Expression' === this.category) {
Expand Down Expand Up @@ -1029,6 +1029,10 @@ export class GeneComparisonToolComponent implements OnInit, AVI, OnDestroy {
a.click();
}

returnEmptyStringIfNull(val: number | null) {
return val === null ? '' : val;
}

arrayToCSVString(values: string[]): string {
return values.map(value => `"${value}"`).join(',') + '\n';
}
Expand Down

0 comments on commit ed006c0

Please sign in to comment.