Skip to content

Commit

Permalink
feat(backend): show sequences in the order that they will be processe…
Browse files Browse the repository at this point in the history
…d by #1036
  • Loading branch information
fengelniederhammer committed Mar 18, 2024
1 parent 18080b7 commit edac41d
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class SubmissionDatabaseService(
where = { table.statusIs(RECEIVED) and table.isMaxVersion and table.organismIs(organism) },
)
.limit(numberOfSequenceEntries)
.orderBy(table.accessionColumn)
.map {
UnprocessedData(
it[table.accessionColumn],
Expand Down Expand Up @@ -274,9 +275,11 @@ class SubmissionDatabaseService(
AccessionVersion(it[table.accessionColumn], it[table.versionColumn])
}

table.update(where = {
table.accessionVersionIsIn(accessionVersionsToUpdate)
}) {
table.update(
where = {
table.accessionVersionIsIn(accessionVersionsToUpdate)
},
) {
it[statusColumn] = APPROVED_FOR_RELEASE.name
it[releasedAtColumn] = now
}
Expand Down Expand Up @@ -317,10 +320,14 @@ class SubmissionDatabaseService(
fun streamReleasedSubmissions(organism: Organism): Sequence<RawProcessedData> {
return sequenceEntriesTableProvider.get(organism).let { table ->

table.join(DataUseTermsTable, JoinType.LEFT, additionalConstraint = {
(table.accessionColumn eq DataUseTermsTable.accessionColumn) and
(DataUseTermsTable.isNewestDataUseTerms)
})
table.join(
DataUseTermsTable,
JoinType.LEFT,
additionalConstraint = {
(table.accessionColumn eq DataUseTermsTable.accessionColumn) and
(DataUseTermsTable.isNewestDataUseTerms)
},
)
.slice(
table.accessionColumn,
table.versionColumn,
Expand Down

0 comments on commit edac41d

Please sign in to comment.