-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
39 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# version requirement? | ||
dpath==2.0.6 | ||
black | ||
linkml_runtime | ||
linkml-runtime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,38 @@ | ||
|
||
// A list of the export functions keyed by the Export menu name they should appear as: | ||
var EXPORT_FORMATS = { | ||
/* | ||
Example_Format_Name: { | ||
'fileType': 'xls', // or 'xlsx', 'tsv', 'csv' | ||
'status': 'published', // or 'draft' | ||
method: function (dh) { | ||
// Conversion code | ||
const ExportHeaders = new Map([ | ||
['sample_name', [optional list of source fields to join values from; delimiter is usually semicolon]], | ||
/// ... list of export table fields in order. | ||
]) | ||
}; | ||
const sourceFields = dh.getFields(dh.table); | ||
const sourceFieldNameMap = dh.getFieldNameMap(sourceFields); | ||
// Fills in the above mapping (or just set manually above) | ||
dh.getHeaderMap(ExportHeaders, sourceFields, 'BIOSAMPLE'); | ||
/* | ||
// Examples: | ||
var EXPORT_FORMATS = { | ||
"IRIDA": {'method': exportIRIDA, 'fileType': 'xls', 'status': 'published'}, | ||
"GISAID": {'method': exportGISAID,'fileType': 'xls', 'status': 'published'}, | ||
"BioSample": {'method': exportBioSample,'fileType': 'xls', 'status': 'published'}, | ||
"CNPHI LaSER": {'method': exportLASER, 'fileType': 'csv (ASCII)', 'status': 'published'} | ||
// Copy headers to 1st row of new export table | ||
const outputMatrix = [[...ExportHeaders.keys()]]; | ||
for (const inputRow of dh.getTrimmedData(dh.hot)) { | ||
const outputRow = []; | ||
for (const [headerName, sources] of ExportHeaders) { | ||
// Any custom rules here for data conversions | ||
// Otherwise apply source (many to one) to target field transform: | ||
const value = dh.getMappedField(headerName, inputRow, sources, sourceFields,sourceFieldNameMap, ':', 'Example_Format_Name') | ||
outputRow.push(value); | ||
} | ||
outputMatrix.push(outputRow); | ||
} | ||
return outputMatrix | ||
} | ||
*/ | ||
}; | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters