Skip to content

Commit

Permalink
Stop displaying undefined values in side table of vcf-report (#145)
Browse files Browse the repository at this point in the history
* Stop displaying undefined values in side table of vcf-report
This fixes #144.

* Update CHANGELOG.md

Co-authored-by: Johannes Köster <[email protected]>
  • Loading branch information
fxwiegand and johanneskoester committed Apr 19, 2021
1 parent c957c81 commit 0688651
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [0.20.5] - 2021-04-19
### Changed
- Bugfix for `rbt vcf-report` that stops displaying undefined values in the table-report.
### Added
- New parameter `--pin-until` for `rbt csv-report`.
- `--pin-until` pins the table until the given column such that scrolling to the right does not hide the given column and those before.
- New parameter `--pin-until` for `rbt csv-report`. `--pin-until` pins the table until the given column such that scrolling to the right does not hide the given column and those before.

## [0.20.4] - 2021-04-15
### Changed
Expand Down
44 changes: 24 additions & 20 deletions src/bcf/report/js/table-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,29 +83,33 @@ $(document).ready(function () {
let ix = x + 1;
let field = 'ann[' + j + '][' + ix + ']';
let vl = $(that).data(field);
if (name === "Existing_variation" && vl) {
let fields = vl.split('&');
let result = "";
for (var o = 0; o < fields.length; o++) {
let val = fields[o];
if (val.startsWith("rs")) {
result = result + "<a href='https://www.ncbi.nlm.nih.gov/snp/" + val + "'>" + val + "</a>";
} else if (val.startsWith("COSM")) {
let num = val.replace( /^\D+/g, '');
result = result + "<a href='https://cancer.sanger.ac.uk/cosmic/mutation/overview?id=" + num + "'>" + val + "</a>";
} else if (val.startsWith("COSN")) {
let num = val.replace( /^\D+/g, '');
result = result + "<a href='https://cancer.sanger.ac.uk/cosmic/ncv/overview?id=" + num + "'>" + val + "</a>";
} else {
result = result + val;
}
if (!(o === fields.length - 1)) {
result = result + ", ";
if (vl) {
if (name === "Existing_variation") {
let fields = vl.split('&');
let result = "";
for (var o = 0; o < fields.length; o++) {
let val = fields[o];
if (val.startsWith("rs")) {
result = result + "<a href='https://www.ncbi.nlm.nih.gov/snp/" + val + "'>" + val + "</a>";
} else if (val.startsWith("COSM")) {
let num = val.replace( /^\D+/g, '');
result = result + "<a href='https://cancer.sanger.ac.uk/cosmic/mutation/overview?id=" + num + "'>" + val + "</a>";
} else if (val.startsWith("COSN")) {
let num = val.replace( /^\D+/g, '');
result = result + "<a href='https://cancer.sanger.ac.uk/cosmic/ncv/overview?id=" + num + "'>" + val + "</a>";
} else {
result = result + val;
}
if (!(o === fields.length - 1)) {
result = result + ", ";
}
}
vl = result;
}
vl = result;
$('#ann-sidebar').append('<td>' + vl + '</td>');
} else {
$('#ann-sidebar').append('<td></td>');
}
$('#ann-sidebar').append('<td>' + vl + '</td>');
}
$('#ann-sidebar').append('</tr>');
});
Expand Down

0 comments on commit 0688651

Please sign in to comment.