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

Replace fetch-from-biosample with NCBI Dataset CLI #480

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

joverlee521
Copy link
Contributor

@joverlee521 joverlee521 commented Oct 7, 2024

Description of proposed changes

Originally I was going to update fetch-from-biosample to use the v2 NCBI Dataset API as described in #477. However, I remembered #420 and realized that we can remove the script entirely if we just download the BioSample report as part of the NCBI Dataset CLI command.

Related issue(s)

Resolves #477, #420

Checklist

Originally I was going to update `fetch-from-biosample` to use the v2
NCBI Dataset API as described in #477.
However, I remembered #420
and realized that we can remove the script entirely if we just download
the BioSample report as part of the NCBI Dataset CLI command.
@joverlee521
Copy link
Contributor Author

Trial run successfully completed!

Compared the uploaded biosample.tsv.zst from the trial run with the production run and found no difference 🎉
  1. Download files from S3, specifically used older version from prod that was uploaded the same day as the trial run.
$ aws s3 cp s3://nextstrain-data/files/ncov/open/trial/update-biosample/biosample.tsv.zst data/new-biosample.tsv.zst
$ zstd -T0 -dcq data/new-biosample.tsv.zst > data/new-biosample.tsv
$ aws s3api get-object --bucket nextstrain-data --key files/ncov/open/biosample.tsv.zst --version-id HTrEUbLJK2Qpauj_qv11Ehrv3j40Zf3o data/old-biosample.tsv.zst
$ zstd -T0 -dcq data/old-biosample.tsv.zst > data/old-biosample.tsv
  1. Sort records by BioSample accession
$ csvtk sort -t -k biosample_accession data/new-biosample.tsv > data/sorted-new-biosample.tsv
$ csvtk sort -t -k biosample_accession data/old-biosample.tsv > data/sorted-old-biosample.tsv
  1. Diff files
diff data/sorted-old-biosample.tsv data/sorted-new-biosample.tsv > /tmp/diff

No difference between the files 🎉

@joverlee521
Copy link
Contributor Author

I plan to merge this tomorrow morning if there's no feedback.

@joverlee521 joverlee521 merged commit 61cf98e into master Oct 9, 2024
10 checks passed
@joverlee521 joverlee521 deleted the update-biosample branch October 9, 2024 17:02
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.

Update to NCBI Dataset v2 API
1 participant