Skip to content

refactor: simplify ShigaPass/FastANI taxonomy reconciliation logic - #224

Open
weichisyu wants to merge 1 commit into
CDCgov:mainfrom
atgenomix:refactor/check_shigapass_taxa
Open

refactor: simplify ShigaPass/FastANI taxonomy reconciliation logic#224
weichisyu wants to merge 1 commit into
CDCgov:mainfrom
atgenomix:refactor/check_shigapass_taxa

Conversation

@weichisyu

@weichisyu weichisyu commented Sep 3, 2026

Copy link
Copy Markdown

Simplify ShigaPass taxonomy reconciliation ( issue #223)

This PR moves the ShigaPass/FastANI taxonomy reconciliation logic into check_taxa.py instead of splitting the decision-making between the Nextflow process and Python script.

Changes

  1. Move ShigaPass/FastANI taxonomy reconciliation logic into check_taxa.py
  2. Interpret ShigaPass results as either:
  • Shigella
  • Escherichia when the result is EIEC or Not Shigella/EIEC
  1. Convert FastANI Escherichia calls to Shigella when ShigaPass identifies a Shigella type.
  2. Convert FastANI Shigella calls to Escherichia coli when ShigaPass reports EIEC or Not Shigella/EIEC.
  3. Always update the Shigella species from the ShigaPass result when ShigaPass identifies Shigella.
  4. Validate that the incoming FastANI genus is either Escherichia or Shigella
  5. Preserve the original formatted ANI output when no taxonomy update is required.

Why update all Shigella species?

ShigaPass reports Shigella species using abbreviated identifiers such as SS, SF, SB, and SD, whereas the FastANI taxonomy contains full species names.
The previous Bash comparison therefore generally treats the ShigaPass and FastANI species values as different and passes the sample to check_taxa.py anyway.
Instead of keeping this redundant comparison in Nextflow, this PR sends the reconciliation decision directly to Python.
When ShigaPass identifies a sample as Shigella, the ShigaPass species assignment is used to update the taxonomy.

Resulting logic

ShigaPass classification FastANI classification Action
Shigella Escherichia Convert to Shigella and update species
Shigella Shigella Update species
EIEC ; Not Shigella/EIEC Shigella Convert to E. coli
EIEC ; Not Shigella/EIEC Escherichia No taxonomy change

This keeps the reconciliation logic in one place and makes the intended relationship between FastANI and ShigaPass easier to understand and maintain.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant