-
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
5 changed files
with
1,140 additions
and
1,081 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,2 +1,62 @@ | ||
// A dictionary of possible export formats | ||
export default {}; | ||
export default { | ||
NCBI_SRA: { | ||
fileType: 'xls', | ||
status: 'published', | ||
method: function(dh) { | ||
const exportHeaders = new Map([ | ||
["sample_name", []], | ||
["library_ID", []], | ||
["title", []], | ||
["library_strategy", []], | ||
["library_source", []], | ||
["library_selection", []], | ||
["library_layout", []], | ||
["platform (click for details)", []], | ||
["instrument_model", []], | ||
["design_description", []], | ||
["filetype", []], | ||
["filename", []], | ||
["filename2", []], | ||
["filename3", []], | ||
["filename4", []], | ||
["assembly", []], | ||
["fasta_file", []], | ||
["enrichment_kit", []], | ||
["amplicon_PCR_primer_scheme", []], | ||
["library_preparation_kit", []], | ||
["amplicon_size", []], | ||
["quality_control_method", []], | ||
["quality_control_method_version", []], | ||
["quality_control_determination", []], | ||
["quality_control_issues", []], | ||
["quality_control_details", []], | ||
["dehosting_method", []], | ||
["sequence_submitter_contact_email", []], | ||
["raw_sequence_data_processing_method", []], | ||
]); | ||
const outputMatrix = [[...exportHeaders.keys()]]; | ||
const sourceFields = dh.getFields(dh.table); | ||
const sourceFieldNameMap = dh.getFieldNameMap(sourceFields); | ||
dh.getHeaderMap(exportHeaders, sourceFields, 'NCBI_SRA'); | ||
for (const inputRow of dh.getTrimmedData(dh.hot)) { | ||
const outputRow = []; | ||
let value; | ||
for (const [headerName, sources] of exportHeaders) { | ||
value = dh.getMappedField( | ||
headerName, | ||
inputRow, | ||
sources, | ||
sourceFields, | ||
sourceFieldNameMap, | ||
':', | ||
'NCBI_SRA' | ||
); | ||
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
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
Oops, something went wrong.