Skip to content

Commit

Permalink
Begin NCBI_SRA exports
Browse files Browse the repository at this point in the history
  • Loading branch information
ivansg44 committed Dec 9, 2024
1 parent b31a061 commit 4584daa
Show file tree
Hide file tree
Showing 5 changed files with 1,140 additions and 1,081 deletions.
62 changes: 61 additions & 1 deletion web/templates/wastewater/export.js
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;
},
},
};
22 changes: 11 additions & 11 deletions web/templates/wastewater/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -8666,7 +8666,7 @@
"description": "The date the sample was sequenced.",
"title": "sequencing date",
"todos": [
">={sample_collection_date}",
">={sample_collection_start_date}",
"<={today}"
],
"comments": [
Expand Down Expand Up @@ -8790,7 +8790,7 @@
"from_schema": "https://example.com/GRDI",
"exact_mappings": [
"NCBI_SRA:library_strategy",
"NCBI_SRA:%20library_source"
"NCBI_SRA:library_source"
],
"slot_uri": "GENEPIO:0100997",
"domain_of": [
Expand Down Expand Up @@ -8892,7 +8892,7 @@
"from_schema": "https://example.com/GRDI",
"exact_mappings": [
"NCBI_SRA:library_selection",
"NCBI_SRA:%20design_description"
"NCBI_SRA:design_description"
],
"slot_uri": "GENEPIO:0100966",
"domain_of": [
Expand Down Expand Up @@ -15981,7 +15981,7 @@
"description": "The date the sample was sequenced.",
"title": "sequencing date",
"todos": [
">={sample_collection_date}",
">={sample_collection_start_date}",
"<={today}"
],
"comments": [
Expand Down Expand Up @@ -16121,7 +16121,7 @@
"from_schema": "https://example.com/GRDI",
"exact_mappings": [
"NCBI_SRA:library_strategy",
"NCBI_SRA:%20library_source"
"NCBI_SRA:library_source"
],
"rank": 152,
"slot_uri": "GENEPIO:0100997",
Expand Down Expand Up @@ -23214,7 +23214,7 @@
"description": "The date the sample was sequenced.",
"title": "sequencing date",
"todos": [
">={sample_collection_date}",
">={sample_collection_start_date}",
"<={today}"
],
"comments": [
Expand Down Expand Up @@ -23354,7 +23354,7 @@
"from_schema": "https://example.com/GRDI",
"exact_mappings": [
"NCBI_SRA:library_strategy",
"NCBI_SRA:%20library_source"
"NCBI_SRA:library_source"
],
"rank": 153,
"slot_uri": "GENEPIO:0100997",
Expand Down Expand Up @@ -23472,7 +23472,7 @@
"from_schema": "https://example.com/GRDI",
"exact_mappings": [
"NCBI_SRA:library_selection",
"NCBI_SRA:%20design_description"
"NCBI_SRA:design_description"
],
"rank": 157,
"slot_uri": "GENEPIO:0100966",
Expand Down Expand Up @@ -30919,7 +30919,7 @@
"description": "The date the sample was sequenced.",
"title": "sequencing date",
"todos": [
">={sample_collection_date}",
">={sample_collection_start_date}",
"<={today}"
],
"comments": [
Expand Down Expand Up @@ -31059,7 +31059,7 @@
"from_schema": "https://example.com/GRDI",
"exact_mappings": [
"NCBI_SRA:library_strategy",
"NCBI_SRA:%20library_source"
"NCBI_SRA:library_source"
],
"rank": 167,
"slot_uri": "GENEPIO:0100997",
Expand Down Expand Up @@ -31177,7 +31177,7 @@
"from_schema": "https://example.com/GRDI",
"exact_mappings": [
"NCBI_SRA:library_selection",
"NCBI_SRA:%20design_description"
"NCBI_SRA:design_description"
],
"rank": 171,
"slot_uri": "GENEPIO:0100966",
Expand Down
6 changes: 3 additions & 3 deletions web/templates/wastewater/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4730,7 +4730,7 @@ slots:
slot_uri: GENEPIO:0001447
range: date
todos:
- '>={sample_collection_date}'
- '>={sample_collection_start_date}'
- <={today}
examples:
- value: '2020-06-22'
Expand Down Expand Up @@ -4795,7 +4795,7 @@ slots:
- value: whole genome sequencing assay
exact_mappings:
- NCBI_SRA:library_strategy
- NCBI_SRA:%20library_source
- NCBI_SRA:library_source
library_preparation_kit:
name: library_preparation_kit
title: library preparation kit
Expand Down Expand Up @@ -4847,7 +4847,7 @@ slots:
- value: hybrid selection method
exact_mappings:
- NCBI_SRA:library_selection
- NCBI_SRA:%20design_description
- NCBI_SRA:design_description
genomic_target_enrichment_method_details:
name: genomic_target_enrichment_method_details
title: genomic target enrichment method details
Expand Down
Loading

0 comments on commit 4584daa

Please sign in to comment.