-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1493 from nextstrain/curate-internal-quotes
Stop quoting TSV outputs from augur curate
- Loading branch information
Showing
4 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
tests/functional/curate/cram/metadata-output-with-internal-quotes.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Setup | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Testing metadata outputs with internal quotes for the curate command. | ||
Running the `passthru` subcommand since it does not do any data transformations. | ||
|
||
Create NDJSON with internal quotes | ||
|
||
$ cat >records.ndjson <<~~ | ||
> {"strain": "sequence_A", "submitting_lab": "SRC VB \"Vector\", Molecular Biology of Genomes"} | ||
> ~~ | ||
|
||
Test passthru with output to TSV. | ||
This should not add any quotes around the field with internal quotes. | ||
|
||
$ cat records.ndjson \ | ||
> | ${AUGUR} curate passthru \ | ||
> --output-metadata output-metadata.tsv | ||
|
||
$ cat output-metadata.tsv | ||
strain\tsubmitting_lab (esc) | ||
sequence_A\tSRC VB "Vector", Molecular Biology of Genomes (esc) | ||
|
||
Run the output TSV through augur curate passthru again. | ||
The new output should still be identical to the first output. | ||
|
||
$ ${AUGUR} curate passthru \ | ||
> --metadata output-metadata.tsv \ | ||
> --output-metadata output-metadata-2.tsv | ||
|
||
$ diff -u output-metadata.tsv output-metadata-2.tsv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters