aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-12-17 16:00:33 -0600
committerFrederick Muriuki Muriithi2024-12-17 16:22:24 -0600
commitf44988df313ff2d40698589d092ad35f4fbf7583 (patch)
tree10a850e0268a2c0ed56e3db4bd8b8188b2587285
parent53e6d1a2b3899b16783655e6860617e27049d4df (diff)
downloadgn-uploader-f44988df313ff2d40698589d092ad35f4fbf7583.tar.gz
Handle non-existent values correctly.
-rw-r--r--uploader/templates/phenotypes/add-phenotypes-raw-files.html13
1 files changed, 12 insertions, 1 deletions
diff --git a/uploader/templates/phenotypes/add-phenotypes-raw-files.html b/uploader/templates/phenotypes/add-phenotypes-raw-files.html
index 833cd87..27e71c9 100644
--- a/uploader/templates/phenotypes/add-phenotypes-raw-files.html
+++ b/uploader/templates/phenotypes/add-phenotypes-raw-files.html
@@ -337,13 +337,24 @@
var tableheader = table.find("thead");
var tablebody = table.find("tbody");
var numheadings = 0;
+ var navalues = formdata
+ .na_strings
+ .split(" ")
+ .map((v) => {return v.trim();})
+ .filter((v) => {return Boolean(v);});
filedata.forEach((line) => {
if(line.startsWith(formdata.comment_char) || linenum >= numrows) {
return false;
}
var row = $("<tr></tr>");
line.split(formdata.separator)
- .map((field) => {return field.trim();})
+ .map((field) => {
+ var value = field.trim();
+ if(navalues.includes(value)) {
+ return "⋘NUL⋙";
+ }
+ return value;
+ })
.filter((field) => {
return (field !== "" && field != undefined && field != null);
})