-
Notifications
You must be signed in to change notification settings - Fork 3
Use Pathoplexus #113
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
base: main
Are you sure you want to change the base?
Use Pathoplexus #113
Changes from all commits
2dab3d7
248ea15
1898ef3
3fe7663
34ea83e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,70 +4,38 @@ | ||||||||||||||||||||||||||||||||||||||||||||||
| # Define optional config parameters with their default values here so that users | |||||||||||||||||||||||||||||||||||||||||||||||
| # do not have to dig through the workflows to figure out the default values | |||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||
| # Required to fetch from NCBI Datasets | |||||||||||||||||||||||||||||||||||||||||||||||
| ncbi_taxon_id: "11082" | |||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||
| # The list of NCBI Datasets fields to include from NCBI Datasets output | |||||||||||||||||||||||||||||||||||||||||||||||
| # These need to be the "mnemonics" of the NCBI Datasets fields, see docs for full list of fields | |||||||||||||||||||||||||||||||||||||||||||||||
| # https://www.ncbi.nlm.nih.gov/datasets/docs/v2/reference-docs/command-line/dataformat/tsv/dataformat_tsv_virus-genome/#fields | |||||||||||||||||||||||||||||||||||||||||||||||
| # Note: the "accession" field MUST be provided to match with the sequences | |||||||||||||||||||||||||||||||||||||||||||||||
| ncbi_datasets_fields: | |||||||||||||||||||||||||||||||||||||||||||||||
| - accession | |||||||||||||||||||||||||||||||||||||||||||||||
| - sourcedb | |||||||||||||||||||||||||||||||||||||||||||||||
| - isolate-lineage | |||||||||||||||||||||||||||||||||||||||||||||||
| - geo-region | |||||||||||||||||||||||||||||||||||||||||||||||
| - geo-location | |||||||||||||||||||||||||||||||||||||||||||||||
| - isolate-collection-date | |||||||||||||||||||||||||||||||||||||||||||||||
| - release-date | |||||||||||||||||||||||||||||||||||||||||||||||
| - update-date | |||||||||||||||||||||||||||||||||||||||||||||||
| - length | |||||||||||||||||||||||||||||||||||||||||||||||
| - host-name | |||||||||||||||||||||||||||||||||||||||||||||||
| - is-lab-host | |||||||||||||||||||||||||||||||||||||||||||||||
| - isolate-lineage-source | |||||||||||||||||||||||||||||||||||||||||||||||
| - bioprojects | |||||||||||||||||||||||||||||||||||||||||||||||
| - biosample-acc | |||||||||||||||||||||||||||||||||||||||||||||||
| - sra-accs | |||||||||||||||||||||||||||||||||||||||||||||||
| - submitter-names | |||||||||||||||||||||||||||||||||||||||||||||||
| - submitter-affiliation | |||||||||||||||||||||||||||||||||||||||||||||||
| ppx_fetch: | |||||||||||||||||||||||||||||||||||||||||||||||
| seqs: https://lapis.pathoplexus.org/west-nile/sample/unalignedNucleotideSequences?versionStatus=LATEST_VERSION | |||||||||||||||||||||||||||||||||||||||||||||||
| meta: https://lapis.pathoplexus.org/west-nile/sample/details?dataFormat=csv&versionStatus=LATEST_VERSION | |||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||
| # Config parameters related to the curate pipeline | |||||||||||||||||||||||||||||||||||||||||||||||
| curate: | |||||||||||||||||||||||||||||||||||||||||||||||
| # The path to the local geolocation rules within the pathogen repo | |||||||||||||||||||||||||||||||||||||||||||||||
| # The path should be relative to the ingest directory. | |||||||||||||||||||||||||||||||||||||||||||||||
| local_geolocation_rules: "defaults/geolocation-rules.tsv" | |||||||||||||||||||||||||||||||||||||||||||||||
| # The original field names should match the ncbi_datasets_fields provided above. | |||||||||||||||||||||||||||||||||||||||||||||||
| # This is the first step in the pipeline, so any references to field names in the configs below should use the new field names | |||||||||||||||||||||||||||||||||||||||||||||||
| field_map: | |||||||||||||||||||||||||||||||||||||||||||||||
| accession: accession | |||||||||||||||||||||||||||||||||||||||||||||||
| accession_version: accession_version | |||||||||||||||||||||||||||||||||||||||||||||||
| sourcedb: database | |||||||||||||||||||||||||||||||||||||||||||||||
| isolate-lineage: strain | |||||||||||||||||||||||||||||||||||||||||||||||
| geo-region: region | |||||||||||||||||||||||||||||||||||||||||||||||
| geo-location: location | |||||||||||||||||||||||||||||||||||||||||||||||
| isolate-collection-date: date | |||||||||||||||||||||||||||||||||||||||||||||||
| release-date: date_released | |||||||||||||||||||||||||||||||||||||||||||||||
| update-date: date_updated | |||||||||||||||||||||||||||||||||||||||||||||||
| length: length | |||||||||||||||||||||||||||||||||||||||||||||||
| host-name: host | |||||||||||||||||||||||||||||||||||||||||||||||
| is-lab-host: is_lab_host | |||||||||||||||||||||||||||||||||||||||||||||||
| isolate-lineage-source: sample_type | |||||||||||||||||||||||||||||||||||||||||||||||
| biosample-acc: biosample_accessions | |||||||||||||||||||||||||||||||||||||||||||||||
| sra-accs: sra_accessions | |||||||||||||||||||||||||||||||||||||||||||||||
| submitter-names: full_authors | |||||||||||||||||||||||||||||||||||||||||||||||
| submitter-affiliation: institution | |||||||||||||||||||||||||||||||||||||||||||||||
| # Standardized strain name regex | |||||||||||||||||||||||||||||||||||||||||||||||
| # Currently accepts any characters because we do not have a clear standard for strain names across pathogens | |||||||||||||||||||||||||||||||||||||||||||||||
| strain_regex: "^.+$" | |||||||||||||||||||||||||||||||||||||||||||||||
| # Back up strain name field to use if "strain" doesn"t match regex above | |||||||||||||||||||||||||||||||||||||||||||||||
| strain_backup_fields: ["accession"] | |||||||||||||||||||||||||||||||||||||||||||||||
| accessionVersion: PPX_accession | |||||||||||||||||||||||||||||||||||||||||||||||
| insdcAccessionFull: INSDC_accession | |||||||||||||||||||||||||||||||||||||||||||||||
| insdcRawReadsAccession: sra_accession | |||||||||||||||||||||||||||||||||||||||||||||||
| displayName: strain | |||||||||||||||||||||||||||||||||||||||||||||||
| geoLocCountry: country | |||||||||||||||||||||||||||||||||||||||||||||||
| geoLocAdmin1: division | |||||||||||||||||||||||||||||||||||||||||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DivisionSimilar to nextstrain/rsv#99,
I believe all of these are simply |
|||||||||||||||||||||||||||||||||||||||||||||||
| geoLocAdmin2: location | |||||||||||||||||||||||||||||||||||||||||||||||
| sampleCollectionDate: date | |||||||||||||||||||||||||||||||||||||||||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DateThere are some date differences in the current preview datasets compared to the live datasets. These have been addressed by properly applying the curated annotations in 34ea83e, I just haven't updated the previews. The remaining differences seem to be improvements:
diffing commandawk -F'\t' '
NR==FNR {
if (FNR==1) {
for (i=1; i<=NF; i++) metaCol[$i]=i
metaAccIdx=metaCol["accession"]
metaDateIdx=metaCol["date"]
next
}
metaDate[$(metaAccIdx)]=$(metaDateIdx)
next
}
FNR==1 {
for (i=1; i<=NF; i++) openCol[$i]=i
openAccIdx=openCol["INSDC_accession"]
openDateIdx=openCol["date"]
print "accession\tmetadata_date\tmetadata_open_date"
next
}
{
acc=$(openAccIdx)
sub(/\.[0-9]+$/, "", acc)
if (acc in metaDate) {
metaVal=metaDate[acc]
openVal=$(openDateIdx)
if (metaVal != openVal)
printf "%s\t%s\t%s\n", acc, metaVal, openVal
}
}
' ingest/results/metadata_ncbi_datasets.tsv ingest/results/metadata_open.tsv |
|||||||||||||||||||||||||||||||||||||||||||||||
| earliestReleaseDate: date_submitted | |||||||||||||||||||||||||||||||||||||||||||||||
| hostNameCommon: host | |||||||||||||||||||||||||||||||||||||||||||||||
| isLabHost: is_lab_host | |||||||||||||||||||||||||||||||||||||||||||||||
| dataUseTermsRestrictedUntil: restrictedUntil | |||||||||||||||||||||||||||||||||||||||||||||||
| dataUseTermsUrl: dataUseTerms__url | |||||||||||||||||||||||||||||||||||||||||||||||
| authors: full_authors | |||||||||||||||||||||||||||||||||||||||||||||||
| authorAffiliations: institution | |||||||||||||||||||||||||||||||||||||||||||||||
| # List of date fields to standardize to ISO format YYYY-MM-DD | |||||||||||||||||||||||||||||||||||||||||||||||
| date_fields: ["date", "date_released", "date_updated"] | |||||||||||||||||||||||||||||||||||||||||||||||
| date_fields: ["date", "date_submitted"] | |||||||||||||||||||||||||||||||||||||||||||||||
| # List of expected date formats that are present in the date fields provided above | |||||||||||||||||||||||||||||||||||||||||||||||
| # These date formats should use directives expected by datetime | |||||||||||||||||||||||||||||||||||||||||||||||
| # See https://docs.python.org/3.9/library/datetime.html#strftime-and-strptime-format-codes | |||||||||||||||||||||||||||||||||||||||||||||||
| expected_date_formats: ["%Y", "%Y-%m", "%Y-%m-%d", "%Y-%m-%dT%H:%M:%SZ"] | |||||||||||||||||||||||||||||||||||||||||||||||
| # The expected field that contains the GenBank geo_loc_name | |||||||||||||||||||||||||||||||||||||||||||||||
| genbank_location_field: location | |||||||||||||||||||||||||||||||||||||||||||||||
| titlecase: | |||||||||||||||||||||||||||||||||||||||||||||||
| # List of string fields to titlecase | |||||||||||||||||||||||||||||||||||||||||||||||
| fields: ["region", "country", "division", "location"] | |||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -93,16 +61,19 @@ curate: | ||||||||||||||||||||||||||||||||||||||||||||||
| output_id_field: "accession" | |||||||||||||||||||||||||||||||||||||||||||||||
| # The field in the NDJSON record that contains the actual genomic sequence | |||||||||||||||||||||||||||||||||||||||||||||||
| output_sequence_field: "sequence" | |||||||||||||||||||||||||||||||||||||||||||||||
| # The field in the NDJSON record that contains the actual GenBank accession | |||||||||||||||||||||||||||||||||||||||||||||||
| genbank_accession: 'accession' | |||||||||||||||||||||||||||||||||||||||||||||||
| # The field in the NDJSON record that contains the actual Pathoplexus accession | |||||||||||||||||||||||||||||||||||||||||||||||
| pathoplexus_accession: 'PPX_accession' | |||||||||||||||||||||||||||||||||||||||||||||||
| # The field in the NDJSON record that contains the actual INSDC accession | |||||||||||||||||||||||||||||||||||||||||||||||
| insdc_accession: 'INSDC_accession' | |||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||
| # The list of metadata columns to keep in the final output of the curation pipeline. | |||||||||||||||||||||||||||||||||||||||||||||||
| metadata_columns: [ | |||||||||||||||||||||||||||||||||||||||||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exported columns
|
|||||||||||||||||||||||||||||||||||||||||||||||
| 'accession', | |||||||||||||||||||||||||||||||||||||||||||||||
| #'genbank_accession_rev', | |||||||||||||||||||||||||||||||||||||||||||||||
| 'PPX_accession', | |||||||||||||||||||||||||||||||||||||||||||||||
| 'PPX_accession__url', | |||||||||||||||||||||||||||||||||||||||||||||||
| 'INSDC_accession', | |||||||||||||||||||||||||||||||||||||||||||||||
| 'INSDC_accession__url', | |||||||||||||||||||||||||||||||||||||||||||||||
| #'strain', | |||||||||||||||||||||||||||||||||||||||||||||||
| #'strain_s', | |||||||||||||||||||||||||||||||||||||||||||||||
| #'viruslineage_ids', | |||||||||||||||||||||||||||||||||||||||||||||||
| 'date', | |||||||||||||||||||||||||||||||||||||||||||||||
| #'updated', | |||||||||||||||||||||||||||||||||||||||||||||||
| 'region', | |||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -116,15 +87,11 @@ curate: | ||||||||||||||||||||||||||||||||||||||||||||||
| 'is_lab_host', | |||||||||||||||||||||||||||||||||||||||||||||||
| #'date_submitted', | |||||||||||||||||||||||||||||||||||||||||||||||
| #'sra_accession', | |||||||||||||||||||||||||||||||||||||||||||||||
| #'full_authors', | |||||||||||||||||||||||||||||||||||||||||||||||
| #'reverse', | |||||||||||||||||||||||||||||||||||||||||||||||
| 'authors', | |||||||||||||||||||||||||||||||||||||||||||||||
| #'institution', | |||||||||||||||||||||||||||||||||||||||||||||||
| #'title', | |||||||||||||||||||||||||||||||||||||||||||||||
| #'journal', | |||||||||||||||||||||||||||||||||||||||||||||||
| #'publications', | |||||||||||||||||||||||||||||||||||||||||||||||
| #'paper_url', | |||||||||||||||||||||||||||||||||||||||||||||||
| 'url', | |||||||||||||||||||||||||||||||||||||||||||||||
| 'institution', | |||||||||||||||||||||||||||||||||||||||||||||||
| 'dataUseTerms', | |||||||||||||||||||||||||||||||||||||||||||||||
| 'dataUseTerms__url', | |||||||||||||||||||||||||||||||||||||||||||||||
| 'restrictedUntil', | |||||||||||||||||||||||||||||||||||||||||||||||
| 'length', | |||||||||||||||||||||||||||||||||||||||||||||||
| ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -135,5 +102,72 @@ nextclade: | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||
| pathoplexus: | |||||||||||||||||||||||||||||||||||||||||||||||
| URL: 'https://lapis.pathoplexus.org/west-nile/sample/details' | |||||||||||||||||||||||||||||||||||||||||||||||
| fields: 'insdcAccessionBase,lineage' | |||||||||||||||||||||||||||||||||||||||||||||||
| accession_field: 'insdcAccessionBase' | |||||||||||||||||||||||||||||||||||||||||||||||
| fields: 'accession,lineage' | |||||||||||||||||||||||||||||||||||||||||||||||
| accession_field: 'accession' | |||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||
| ppx_metadata_fields: | |||||||||||||||||||||||||||||||||||||||||||||||
| - "accessionVersion" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "accession" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "version" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "submitter" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "groupName" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "submittedDate" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "releasedDate" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "dataUseTerms" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "dataUseTermsRestrictedUntil" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "dataUseTermsUrl" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "assemblyReferenceGenomeAccession" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "authorAffiliations" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "authors" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "bioprojectAccession" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "biosampleAccession" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "completeness" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "displayName" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "earliestReleaseDate" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "frameShifts" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "geoLocAdmin1" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "geoLocAdmin2" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "geoLocCity" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "geoLocCountry" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "geoLocLatitude" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "geoLocLongitude" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "geoLocSite" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "hostAge" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "hostAgeBin" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "hostDisease" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "hostGender" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "hostHealthOutcome" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "hostHealthState" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "hostNameCommon" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "hostOriginCountry" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "hostVaccinationStatus" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "insdcAccessionBase" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "insdcAccessionFull" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "insdcRawReadsAccession" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "insdcVersion" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "isLabHost" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "length" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "ncbiReleaseDate" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "ncbiSourceDb" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "ncbiSubmitterCountry" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "ncbiUpdateDate" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "ncbiVirusName" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "ncbiVirusTaxId" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "purposeOfSampling" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "purposeOfSequencing" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "qualityControlDetails" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "qualityControlDetermination" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "qualityControlIssues" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "qualityControlMethodName" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "qualityControlMethodVersion" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "sampleCollectionDate" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "sampleCollectionDateRangeLower" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "sampleCollectionDateRangeUpper" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "sampleType" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "totalAmbiguousNucs" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "totalDeletedNucs" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "totalFrameShifts" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "totalInsertedNucs" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "totalSnps" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "totalUnknownNucs" | |||||||||||||||||||||||||||||||||||||||||||||||
| - "travelHistory" | |||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Display name
displayName: strainwas copied from the mapping in ebola, butstrainis not exported inmetadata_columnsso this line is not necessary and should be removed.If we wanted to provide a proper strain name, it might require something like nextstrain/ebola@de65325. I had started on that in 3b78d9a, but I think that can be a separate effort independent from using Pathoplexus.