Skip to content

deposition: correctly handle case where only raw reads are updated not consensus sequence  #7245

Description

@anna-parker

[P2] Replacing only the raw reads leaves the ENA assembly linked to the old run

I looked into the revision path and reproduced an edge case here. RUN_REF now comes from raw_reads_table, but has_assembly_data_changed still compares the consensus, flat-file metadata, and mapped fields in seq_metadata. It doesn't see changes to the generated run accession.

For example:

  1. Version 1 deposits reads as ERR111 and an assembly referencing ERR111.
  2. Version 2 replaces the read files but keeps the consensus and assembly metadata unchanged, producing ERR222.
  3. Assembly creation retrieves ERR222 here, then takes the unchanged-assembly shortcut at lines 525–528 and copies the previous assembly result without submitting an updated manifest.

Loculus consequently reports the new run, while the ENA assembly remains linked to ERR111. The raw-read workflow can also request suppression of that old run. Adding reads to an existing assembly without otherwise changing it has the same missing-link-update problem.

I reproduced the shortcut using the actual PR functions with database calls mocked: the new run was present, but the previous assembly was copied and no new manifest was generated. The existing raw-read revision test misses this because get_revisions defaults to modify_assembly=True, so it changes assembly metadata too.

It would be good to compare the previous and current effective run references before reusing an assembly result, and add a test with modify_raw_reads=True, modify_assembly=False. If updating the link needs manual handling, that could be flagged explicitly instead.

This could be turned into a follow-up issue if you'd prefer to handle it separately.

Originally posted by @theosanderson-agent in #6816 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    depositionrelated to ENA/INSDC deposition

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions