|
1 | 1 | // A dictionary of possible export formats
|
2 | 2 | export default {
|
3 |
| - NCBI_SRA: { |
| 3 | + NCBI_SRAGenomeTrakr: { |
4 | 4 | fileType: 'xlsx',
|
5 | 5 | status: 'published',
|
6 | 6 | method: function(dh) {
|
@@ -38,6 +38,53 @@ export default {
|
38 | 38 | const outputMatrix = [[...exportHeaders.keys()]];
|
39 | 39 | const sourceFields = dh.getFields(dh.table);
|
40 | 40 | 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); |
41 | 88 | dh.getHeaderMap(exportHeaders, sourceFields, 'NCBI_SRA');
|
42 | 89 | for (const inputRow of dh.getTrimmedData(dh.hot)) {
|
43 | 90 | const outputRow = [];
|
|
0 commit comments