Skip to content

Commit c579cfc

Browse files
committed
add Theo's suggestions
1 parent 5170601 commit c579cfc

18 files changed

Lines changed: 83 additions & 85 deletions

File tree

backend/docs/db/schema.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ CREATE TABLE public.sequence_entries (
516516
submitted_at timestamp without time zone NOT NULL,
517517
released_at timestamp without time zone,
518518
is_revocation boolean DEFAULT false NOT NULL,
519-
original_submission_data jsonb,
520-
submission_data jsonb
519+
archive_of_submitted_data jsonb,
520+
submitted_data jsonb
521521
);
522522

523523

@@ -557,12 +557,12 @@ CREATE VIEW public.sequence_entries_view AS
557557
se.submitted_at,
558558
se.released_at,
559559
se.is_revocation,
560-
se.submission_data,
560+
se.submitted_data,
561561
sepd.started_processing_at,
562562
sepd.finished_processing_at,
563563
sepd.processed_data,
564564
CASE
565-
WHEN se.is_revocation THEN jsonb_build_object('metadata', COALESCE((se.submission_data -> 'metadata'::text), '{}'::jsonb), 'unalignedNucleotideSequences', '{}'::jsonb, 'alignedNucleotideSequences', '{}'::jsonb, 'nucleotideInsertions', '{}'::jsonb, 'alignedAminoAcidSequences', '{}'::jsonb, 'aminoAcidInsertions', '{}'::jsonb, 'files', 'null'::jsonb)
565+
WHEN se.is_revocation THEN jsonb_build_object('metadata', COALESCE((se.submitted_data -> 'metadata'::text), '{}'::jsonb), 'unalignedNucleotideSequences', '{}'::jsonb, 'alignedNucleotideSequences', '{}'::jsonb, 'nucleotideInsertions', '{}'::jsonb, 'alignedAminoAcidSequences', '{}'::jsonb, 'aminoAcidInsertions', '{}'::jsonb, 'files', 'null'::jsonb)
566566
WHEN (aem.external_metadata IS NULL) THEN sepd.processed_data
567567
ELSE (sepd.processed_data || jsonb_build_object('metadata', ((sepd.processed_data -> 'metadata'::text) || aem.external_metadata)))
568568
END AS joint_metadata,

backend/docs/organismWithSuborganisms.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,13 @@ This affects all organisms, not just multi-pathogen organisms!
176176
"submissionId": "key1",
177177
"accession": "PP_0EYHTR4",
178178
"version": 1,
179-
"original_submission_data": {
179+
"archive_of_submitted_data": {
180180
"metadata": {...},
181181
"unalignedNucleotideSequences": {
182182
"key1": "ACTG"
183183
}
184184
}, // immutable, for administrator use only
185-
"submission_data": {
185+
"submitted_data": {
186186
"metadata": {...},
187187
"unalignedNucleotideSequences": {
188188
"key1": "ACTG"
@@ -198,14 +198,14 @@ Multiple segments:
198198
"submissionId": "key1",
199199
"accession": "PP_0EYHTR4",
200200
"version": 1,
201-
"original_submission_data": {
201+
"archive_of_submitted_data": {
202202
"metadata": {...},
203203
"unalignedNucleotideSequences": {
204204
"key1_myFirstSegment": "ACTG",
205205
"key1_mySecondSegment": "GTCA"
206206
}
207207
},
208-
"submission_data": {
208+
"submitted_data": {
209209
"metadata": {...},
210210
"unalignedNucleotideSequences": {
211211
"key1_myFirstSegment": "ACTG",

backend/docs/runtime_view.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,75 +81,75 @@ The new rows have an incremented version number (see diagram in the "Initial sub
8181

8282
In following, the changes of the databases are shown given a series of example events.
8383

84-
Note that although the column is omitted here for ease of reading there is also an `original_submission_data` column. This is initially set as a copy of the `submission_data` column, and is intended to be used as an immutable history of the original submission. Due to subsequent data migrations administrators might be forced to modify `submission_data` in order for newer pipelines to successfully reprocess older data. For example, if host validation is added at a later time point old `submission_data` entries with the metadata field `host:human` must be renamed to `host: homo sapiens` for validation to succeed, but `original_submission_data` would store the originally submitted field `host:human`. When revising sequences we expose only the `submission_data` to users as `original_submission_data` might no longer be accepted by the current pipeline.
84+
Note that although the column is omitted here for ease of reading there is also an `archive_of_submitted_data` column. This is initially set as a copy of the `submitted_data` column, and is intended to be used as an immutable history of the original submission. Due to subsequent data migrations administrators might be forced to modify `submitted_data` in order for newer pipelines to successfully reprocess older data. For example, if host validation is added at a later time point old `submitted_data` entries with the metadata field `host:human` must be renamed to `host: homo sapiens` for validation to succeed, but `archive_of_submitted_data` would store the originally submitted field `host:human`. When revising sequences we expose only the `submitted_data` to users as `archive_of_submitted_data` might no longer be accepted by the current pipeline.
8585

8686
**Event 1:** The user submits `[{data: d1}, {data: d2}]`.
8787

88-
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submission_data | processed_data | errors | warnings |
88+
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submitted_data | processed_data | errors | warnings |
8989
| --------- | ------- | --------- | ------------ | --------------------- | ---------------------- | ----------- | -------- | ------------- | ------------- | -------------- | ------ | -------- |
9090
| 1 | 1 | user1 | t1 | | | | RECEIVED | false | d1 | | | |
9191
| 2 | 1 | user1 | t1 | | | | RECEIVED | false | d2 | | | |
9292

9393
**Event 2:** The preprocessing pipeline processes the two sequence entries and found no errors.
9494

95-
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submission_data | processed_data | errors | warnings |
95+
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submitted_data | processed_data | errors | warnings |
9696
| --------- | ------- | --------- | ------------ | --------------------- | ---------------------- | ----------- | ----------------- | ------------- | ------------- | -------------- | ------ | -------- |
9797
| 1 | 1 | user1 | t1 | t2 | t3 | | PROCESSED | false | d1 | ... | [] | [] |
9898
| 2 | 1 | user1 | t1 | t2 | t3 | | PROCESSED | false | d2 | ... | [] | [] |
9999

100100
**Event 3:** The user approves accession 1 and rejects accession 2.
101101

102-
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submission_data | processed_data | errors | warnings |
102+
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submitted_data | processed_data | errors | warnings |
103103
| --------- | ------- | --------- | ------------ | --------------------- | ---------------------- | ----------- | -------------------- | ------------- | ------------- | -------------- | ------ | -------- |
104104
| 1 | 1 | user1 | t1 | t2 | t3 | t4 | APPROVED_FOR_RELEASE | false | d1 | ... | [] | [] |
105105

106106
**Event 4:** The user revises: `[{accession: 1, data: d3}]`
107107

108-
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submission_data | processed_data | errors | warnings |
108+
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submitted_data | processed_data | errors | warnings |
109109
| --------- | ------- | --------- | ------------ | --------------------- | ---------------------- | ----------- | -------------------- | ------------- | ------------- | -------------- | ------ | -------- |
110110
| 1 | 1 | user1 | t1 | t2 | t3 | t4 | APPROVED_FOR_RELEASE | false | d1 | ... | [] | [] |
111111
| 1 | 2 | user1 | t5 | | | | RECEIVED | false | d3 | | | |
112112

113113
**Event 5:** The preprocessing pipeline process the sequence entries and found no errors.
114114

115-
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submission_data | processed_data | errors | warnings |
115+
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submitted_data | processed_data | errors | warnings |
116116
| --------- | ------- | --------- | ------------ | --------------------- | ---------------------- | ----------- | -------------------- | ------------- | ------------- | -------------- | ------ | -------- |
117117
| 1 | 1 | user1 | t1 | t2 | t3 | t4 | APPROVED_FOR_RELEASE | false | d1 | ... | [] | [] |
118118
| 1 | 2 | user1 | t5 | t6 | t7 | | PROCESSED | false | d3 | ... | [] | [] |
119119

120120
**Event 6:** The user approves the revision.
121121

122-
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submission_data | processed_data | errors | warnings |
122+
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submitted_data | processed_data | errors | warnings |
123123
| --------- | ------- | --------- | ------------ | --------------------- | ---------------------- | ----------- | -------------------- | ------------- | ------------- | -------------- | ------ | -------- |
124124
| 1 | 1 | user1 | t1 | t2 | t3 | t4 | APPROVED_FOR_RELEASE | false | d1 | ... | [] | [] |
125125
| 1 | 2 | user1 | t5 | t6 | t7 | t8 | APPROVED_FOR_RELEASE | false | d3 | ... | [] | [] |
126126

127127
**Event 7:** The user revokes accession 1.
128128

129-
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submission_data | processed_data | errors | warnings |
129+
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submitted_data | processed_data | errors | warnings |
130130
| --------- | ------- | --------- | ------------ | --------------------- | ---------------------- | ----------- | -------------------- | ------------- | ------------- | -------------- | ------ | -------- |
131131
| 1 | 1 | user1 | t1 | t2 | t3 | t4 | APPROVED_FOR_RELEASE | false | d1 | ... | [] | [] |
132132
| 1 | 2 | user1 | t5 | t6 | t7 | t8 | APPROVED_FOR_RELEASE | false | d3 | ... | [] | [] |
133133
| 1 | 3 | user1 | t9 | | | | PROCESSED | true | | | | |
134134

135135
**Event 8:** The user rejects the revocation of accession 1.
136136

137-
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submission_data | processed_data | errors | warnings |
137+
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submitted_data | processed_data | errors | warnings |
138138
| --------- | ------- | --------- | ------------ | --------------------- | ---------------------- | ----------- | -------------------- | ------------- | ------------- | -------------- | ------ | -------- |
139139
| 1 | 1 | user1 | t1 | t2 | t3 | t4 | APPROVED_FOR_RELEASE | false | d1 | ... | [] | [] |
140140
| 1 | 2 | user1 | t5 | t6 | t7 | t8 | APPROVED_FOR_RELEASE | false | d3 | ... | [] | [] |
141141

142142
**Event 9:** The user revokes accession 1 again.
143143

144-
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submission_data | processed_data | errors | warnings |
144+
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submitted_data | processed_data | errors | warnings |
145145
| --------- | ------- | --------- | ------------ | --------------------- | ---------------------- | ----------- | -------------------- | ------------- | ------------- | -------------- | ------ | -------- |
146146
| 1 | 1 | user1 | t1 | t2 | t3 | t4 | APPROVED_FOR_RELEASE | false | d1 | ... | [] | [] |
147147
| 1 | 2 | user1 | t5 | t6 | t7 | t8 | APPROVED_FOR_RELEASE | false | d3 | ... | [] | [] |
148148
| 1 | 3 | user1 | t10 | | | | PROCESSED | true | | | | |
149149

150150
**Event 10:** The user approves the revocation.
151151

152-
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submission_data | processed_data | errors | warnings |
152+
| accession | version | submitter | submitted_at | started_processing_at | finished_processing_at | approved_at | status | is_revocation | submitted_data | processed_data | errors | warnings |
153153
| --------- | ------- | --------- | ------------ | --------------------- | ---------------------- | ----------- | -------------------- | ------------- | ------------- | -------------- | ------ | -------- |
154154
| 1 | 1 | user1 | t1 | t2 | t3 | t4 | APPROVED_FOR_RELEASE | false | d1 | ... | [] | [] |
155155
| 1 | 2 | user1 | t5 | t6 | t7 | t8 | APPROVED_FOR_RELEASE | false | d3 | ... | [] | [] |

backend/src/main/kotlin/org/loculus/backend/api/SubmissionTypes.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ data class ProcessedData<SequenceType>(
169169
val aminoAcidInsertions: Map<GeneName, List<Insertion>>,
170170
@Schema(
171171
example = """{"segment1": "fastaHeader1", "segment2": "fastaHeader2"}""",
172-
description = "The key is the segment name, the value is the fastaHeader of the original Data",
172+
description = "The key is the segment name, the value is the fastaHeader of the originally submitted data",
173173
)
174174
val sequenceNameToFastaId: Map<SegmentName, String> = emptyMap(),
175175
@Schema(

backend/src/main/kotlin/org/loculus/backend/controller/SubmissionControllerDescriptions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ state, if the pipeline submits invalid data or if the name of external metadata
8787
"""
8888

8989
const val GET_DATA_TO_EDIT_SEQUENCE_VERSION_DESCRIPTION = """
90-
Get original data for a single accession version for subsequent editing and edit/revision.
90+
Get originally submitted data for a single accession version for subsequent editing and edit/revision.
9191
"""
9292

9393
const val GET_SEQUENCES_DESCRIPTION = """

backend/src/main/kotlin/org/loculus/backend/service/submission/CompressionService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CompressionService(
2828
private val backendConfig: BackendConfig,
2929
) {
3030

31-
fun compressOriginalSequence(sequenceData: GeneticSequence, organism: Organism) = compress(
31+
fun compressSubmittedSequence(sequenceData: GeneticSequence, organism: Organism) = compress(
3232
sequenceData,
3333
compressionDictService.getDictForUnalignedSequence(organism),
3434
)
@@ -78,7 +78,7 @@ class CompressionService(
7878
.unalignedNucleotideSequences.mapValues { (_, sequenceData) ->
7979
when (sequenceData) {
8080
null -> null
81-
else -> compressOriginalSequence(sequenceData, organism)
81+
else -> compressSubmittedSequence(sequenceData, organism)
8282
}
8383
},
8484
submittedData.files,

0 commit comments

Comments
 (0)