Skip to content

Commit 4584daa

Browse files
committed
Begin NCBI_SRA exports
1 parent b31a061 commit 4584daa

File tree

5 files changed

+1140
-1081
lines changed

5 files changed

+1140
-1081
lines changed

web/templates/wastewater/export.js

+61-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,62 @@
11
// A dictionary of possible export formats
2-
export default {};
2+
export default {
3+
NCBI_SRA: {
4+
fileType: 'xls',
5+
status: 'published',
6+
method: function(dh) {
7+
const exportHeaders = new Map([
8+
["sample_name", []],
9+
["library_ID", []],
10+
["title", []],
11+
["library_strategy", []],
12+
["library_source", []],
13+
["library_selection", []],
14+
["library_layout", []],
15+
["platform (click for details)", []],
16+
["instrument_model", []],
17+
["design_description", []],
18+
["filetype", []],
19+
["filename", []],
20+
["filename2", []],
21+
["filename3", []],
22+
["filename4", []],
23+
["assembly", []],
24+
["fasta_file", []],
25+
["enrichment_kit", []],
26+
["amplicon_PCR_primer_scheme", []],
27+
["library_preparation_kit", []],
28+
["amplicon_size", []],
29+
["quality_control_method", []],
30+
["quality_control_method_version", []],
31+
["quality_control_determination", []],
32+
["quality_control_issues", []],
33+
["quality_control_details", []],
34+
["dehosting_method", []],
35+
["sequence_submitter_contact_email", []],
36+
["raw_sequence_data_processing_method", []],
37+
]);
38+
const outputMatrix = [[...exportHeaders.keys()]];
39+
const sourceFields = dh.getFields(dh.table);
40+
const sourceFieldNameMap = dh.getFieldNameMap(sourceFields);
41+
dh.getHeaderMap(exportHeaders, sourceFields, 'NCBI_SRA');
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_SRA'
54+
);
55+
outputRow.push(value);
56+
}
57+
outputMatrix.push(outputRow);
58+
}
59+
return outputMatrix;
60+
},
61+
},
62+
};

web/templates/wastewater/schema.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -8666,7 +8666,7 @@
86668666
"description": "The date the sample was sequenced.",
86678667
"title": "sequencing date",
86688668
"todos": [
8669-
">={sample_collection_date}",
8669+
">={sample_collection_start_date}",
86708670
"<={today}"
86718671
],
86728672
"comments": [
@@ -8790,7 +8790,7 @@
87908790
"from_schema": "https://example.com/GRDI",
87918791
"exact_mappings": [
87928792
"NCBI_SRA:library_strategy",
8793-
"NCBI_SRA:%20library_source"
8793+
"NCBI_SRA:library_source"
87948794
],
87958795
"slot_uri": "GENEPIO:0100997",
87968796
"domain_of": [
@@ -8892,7 +8892,7 @@
88928892
"from_schema": "https://example.com/GRDI",
88938893
"exact_mappings": [
88948894
"NCBI_SRA:library_selection",
8895-
"NCBI_SRA:%20design_description"
8895+
"NCBI_SRA:design_description"
88968896
],
88978897
"slot_uri": "GENEPIO:0100966",
88988898
"domain_of": [
@@ -15981,7 +15981,7 @@
1598115981
"description": "The date the sample was sequenced.",
1598215982
"title": "sequencing date",
1598315983
"todos": [
15984-
">={sample_collection_date}",
15984+
">={sample_collection_start_date}",
1598515985
"<={today}"
1598615986
],
1598715987
"comments": [
@@ -16121,7 +16121,7 @@
1612116121
"from_schema": "https://example.com/GRDI",
1612216122
"exact_mappings": [
1612316123
"NCBI_SRA:library_strategy",
16124-
"NCBI_SRA:%20library_source"
16124+
"NCBI_SRA:library_source"
1612516125
],
1612616126
"rank": 152,
1612716127
"slot_uri": "GENEPIO:0100997",
@@ -23214,7 +23214,7 @@
2321423214
"description": "The date the sample was sequenced.",
2321523215
"title": "sequencing date",
2321623216
"todos": [
23217-
">={sample_collection_date}",
23217+
">={sample_collection_start_date}",
2321823218
"<={today}"
2321923219
],
2322023220
"comments": [
@@ -23354,7 +23354,7 @@
2335423354
"from_schema": "https://example.com/GRDI",
2335523355
"exact_mappings": [
2335623356
"NCBI_SRA:library_strategy",
23357-
"NCBI_SRA:%20library_source"
23357+
"NCBI_SRA:library_source"
2335823358
],
2335923359
"rank": 153,
2336023360
"slot_uri": "GENEPIO:0100997",
@@ -23472,7 +23472,7 @@
2347223472
"from_schema": "https://example.com/GRDI",
2347323473
"exact_mappings": [
2347423474
"NCBI_SRA:library_selection",
23475-
"NCBI_SRA:%20design_description"
23475+
"NCBI_SRA:design_description"
2347623476
],
2347723477
"rank": 157,
2347823478
"slot_uri": "GENEPIO:0100966",
@@ -30919,7 +30919,7 @@
3091930919
"description": "The date the sample was sequenced.",
3092030920
"title": "sequencing date",
3092130921
"todos": [
30922-
">={sample_collection_date}",
30922+
">={sample_collection_start_date}",
3092330923
"<={today}"
3092430924
],
3092530925
"comments": [
@@ -31059,7 +31059,7 @@
3105931059
"from_schema": "https://example.com/GRDI",
3106031060
"exact_mappings": [
3106131061
"NCBI_SRA:library_strategy",
31062-
"NCBI_SRA:%20library_source"
31062+
"NCBI_SRA:library_source"
3106331063
],
3106431064
"rank": 167,
3106531065
"slot_uri": "GENEPIO:0100997",
@@ -31177,7 +31177,7 @@
3117731177
"from_schema": "https://example.com/GRDI",
3117831178
"exact_mappings": [
3117931179
"NCBI_SRA:library_selection",
31180-
"NCBI_SRA:%20design_description"
31180+
"NCBI_SRA:design_description"
3118131181
],
3118231182
"rank": 171,
3118331183
"slot_uri": "GENEPIO:0100966",

web/templates/wastewater/schema.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -4730,7 +4730,7 @@ slots:
47304730
slot_uri: GENEPIO:0001447
47314731
range: date
47324732
todos:
4733-
- '>={sample_collection_date}'
4733+
- '>={sample_collection_start_date}'
47344734
- <={today}
47354735
examples:
47364736
- value: '2020-06-22'
@@ -4795,7 +4795,7 @@ slots:
47954795
- value: whole genome sequencing assay
47964796
exact_mappings:
47974797
- NCBI_SRA:library_strategy
4798-
- NCBI_SRA:%20library_source
4798+
- NCBI_SRA:library_source
47994799
library_preparation_kit:
48004800
name: library_preparation_kit
48014801
title: library preparation kit
@@ -4847,7 +4847,7 @@ slots:
48474847
- value: hybrid selection method
48484848
exact_mappings:
48494849
- NCBI_SRA:library_selection
4850-
- NCBI_SRA:%20design_description
4850+
- NCBI_SRA:design_description
48514851
genomic_target_enrichment_method_details:
48524852
name: genomic_target_enrichment_method_details
48534853
title: genomic target enrichment method details

0 commit comments

Comments
 (0)