Skip to content

Commit

Permalink
ingest: fix csvtk quotes
Browse files Browse the repository at this point in the history
We can now use `csvtk fix-quotes` and `csvtk del-quotes` to work around
quoting issues (e.g. internal quotes in the submitter.affiliation).

Copied commit from Zika repo:

* nextstrain/zika#58
  • Loading branch information
j23414 committed May 2, 2024
1 parent ceb7fbc commit c0b9e50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ingest/rules/fetch_from_ncbi.smk
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ rule format_ncbi_dataset_report:
--package {input.dataset_package} \
--fields {params.ncbi_datasets_fields:q} \
--elide-header \
| csvtk fix-quotes -Ht \
| csvtk add-header -t -l -n {params.ncbi_datasets_fields:q} \
| csvtk rename -t -f accession -n accession_version \
| csvtk -tl mutate -f accession_version -n accession -p "^(.+?)\." \
| csvtk -t mutate -f accession_version -n accession -p "^(.+?)\." \
| csvtk del-quotes -t \
| tsv-select -H -f accession --rest last \
> {output.ncbi_dataset_tsv}
"""
Expand Down

0 comments on commit c0b9e50

Please sign in to comment.