Skip to content

Commit

Permalink
WIP: properly handle TSVs w/ csvtk/tsv-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
joverlee521 committed Nov 26, 2024
1 parent f55c6c2 commit 0d70fe0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ingest/rules/fetch_from_ncbi.smk
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ 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 add-header -t -n {params.ncbi_datasets_fields:q} \
| csvtk rename -t -f accession -n accession_version \
| csvtk -t mutate -f accession_version -n accession -p "^(.+?)\." \
| csvtk del-quotes -t \
| csv2tsv --csv-delim $'\t' \
| tsv-select -H -f accession --rest last \
| csvtk fix-quotes -t \
> {output.ncbi_dataset_tsv}
"""

Expand Down

0 comments on commit 0d70fe0

Please sign in to comment.