Skip to content

Commit 1b953c9

Browse files
committed
new NCBI_SRAGenomeTrakr export
1 parent 2609ed2 commit 1b953c9

File tree

5 files changed

+1788
-1263
lines changed

5 files changed

+1788
-1263
lines changed

web/templates/wastewater/export.js

+48-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// A dictionary of possible export formats
22
export default {
3-
NCBI_SRA: {
3+
NCBI_SRAGenomeTrakr: {
44
fileType: 'xlsx',
55
status: 'published',
66
method: function(dh) {
@@ -38,6 +38,53 @@ export default {
3838
const outputMatrix = [[...exportHeaders.keys()]];
3939
const sourceFields = dh.getFields(dh.table);
4040
const sourceFieldNameMap = dh.getFieldNameMap(sourceFields);
41+
dh.getHeaderMap(exportHeaders, sourceFields, 'NCBI_SRAGenomeTrakr');
42+
for (const inputRow of dh.getTrimmedData(dh.hot)) {
43+
const outputRow = [];
44+
let value;
45+
for (const [headerName, sources] of exportHeaders) {
46+
value = dh.getMappedField(
47+
headerName,
48+
inputRow,
49+
sources,
50+
sourceFields,
51+
sourceFieldNameMap,
52+
'; ',
53+
'NCBI_SRAGenomeTrakr'
54+
);
55+
outputRow.push(value);
56+
}
57+
outputMatrix.push(outputRow);
58+
}
59+
return outputMatrix;
60+
},
61+
},
62+
NCBI_SRA: {
63+
fileType: 'xlsx',
64+
status: 'published',
65+
method: function(dh) {
66+
const exportHeaders = new Map([
67+
["sample_name", []],
68+
["library_ID", []],
69+
["title", []],
70+
["library_strategy", []],
71+
["library_source", []],
72+
["library_selection", []],
73+
["library_layout", []],
74+
["platform", []],
75+
["instrument_model", []],
76+
["design_description", []],
77+
["filetype", []],
78+
["filename", []],
79+
["filename2", []],
80+
["filename3", []],
81+
["filename4", []],
82+
["assembly", []],
83+
["fasta_file", []],
84+
]);
85+
const outputMatrix = [[...exportHeaders.keys()]];
86+
const sourceFields = dh.getFields(dh.table);
87+
const sourceFieldNameMap = dh.getFieldNameMap(sourceFields);
4188
dh.getHeaderMap(exportHeaders, sourceFields, 'NCBI_SRA');
4289
for (const inputRow of dh.getTrimmedData(dh.hot)) {
4390
const outputRow = [];

0 commit comments

Comments
 (0)