Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge additional data during phylogenetic (instead of ingest) workflow #68

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

j23414
Copy link
Collaborator

@j23414 j23414 commented Feb 24, 2025

Description of proposed changes

This PR refines our approach to merging private data—such as latitude and longitude annotations for samples collected at mosquito traps—into state-level phylogenetic trees (e.g. Washington). Previously, we merged private data during the ingest workflow by extending an annotations.tsv file. This led to a convoluted phylogenetic config file that varied depending on whether data was sourced from S3 or from the ingest/results/* merged files.

In this update, private user data is incorporated directly during the phylogenetic workflow. We adopt a variation of the config.additional_inputs method (copied and modified from these lines in avian-flu) and further advocates for a generic pattern for including additional user data as being explored in the pathogen-repo-guide#72.

Config changes

Before

sequences_url: "https://data.nextstrain.org/files/workflows/WNV/sequences.fasta.zst"
metadata_url: "https://data.nextstrain.org/files/workflows/WNV/metadata.tsv.zst"

# Pull in metadata and sequences from the ingest directory after it has been annotated with Washington state-specific metadata
input_metadata: "../ingest/results/metadata.tsv"
input_sequences: "../ingest/results/sequences.fasta"

After

inputs:
  - name: ncbi
    metadata: "s3://nextstrain-data/files/workflows/WNV/metadata.tsv.zst"
    sequences: "s3://nextstrain-data/files/workflows/WNV/sequences.fasta.zst"

additional_inputs:
  - name: private-lat-longs
    metadata: "data-private/metadata.tsv"
    sequences: "data-private/sequences.fasta"

This updated configuration greatly simplifies our documentation, making it easier for other states to modify the Washington state builds and incorporate their own private data.

Related issue(s)

Checklist

  • Checks pass

if uri.startswith('s3://'):
return s3
elif uri.lower().startswith('http://') or uri.lower().startswith('https://'):
raise InvalidConfigError("Workflow cannot yet handle HTTP[S] inputs")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add support for HTTP[S] inputs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but there may be better ways of doing it than this. See this reply to the zika PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I'm comfortable continuing to use S3 inputs for WNV for now, as it simplifies documenting the API

@j23414 j23414 changed the title WIP: Refactor to merge additional data during phylogenetic (instead of ingest) workflow Merge additional data during phylogenetic (instead of ingest) workflow Feb 25, 2025
@j23414 j23414 marked this pull request as ready for review February 25, 2025 17:14
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.

Optional enhancement: Revisit current way of merging private data (via annotations.tsv)
2 participants