-
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 #1241: Minor improvements
- Loading branch information
Showing
7 changed files
with
104 additions
and
5 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
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
48 changes: 48 additions & 0 deletions
48
tests/functional/filter/cram/filter-output-metadata-header.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,48 @@ | ||
Setup | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Since Pandas's read_csv() and to_csv() are used with a double-quote character as | ||
the default quotechar, any column names with that character may be altered. | ||
Quoted columns containing the tab delimiter are left unchanged. | ||
$ cat >metadata.tsv <<~~ | ||
> strain "col 1" | ||
> SEQ_1 a | ||
> ~~ | ||
$ ${AUGUR} filter \ | ||
> --metadata metadata.tsv \ | ||
> --output-metadata filtered_metadata.tsv > /dev/null | ||
$ head -n 1 filtered_metadata.tsv | ||
strain "col 1" | ||
Quoted columns without the tab delimiter are stripped of the quotes. | ||
$ cat >metadata.tsv <<~~ | ||
> strain "col1" | ||
> SEQ_1 a | ||
> ~~ | ||
$ ${AUGUR} filter \ | ||
> --metadata metadata.tsv \ | ||
> --output-metadata filtered_metadata.tsv > /dev/null | ||
$ head -n 1 filtered_metadata.tsv | ||
strain col1 | ||
Any other columns with quotes are quoted, and pre-existing quotes are escsaped by doubling up. | ||
$ cat >metadata.tsv <<~~ | ||
> strain col"1 col2" | ||
> SEQ_1 a b | ||
> ~~ | ||
$ ${AUGUR} filter \ | ||
> --metadata metadata.tsv \ | ||
> --output-metadata filtered_metadata.tsv > /dev/null | ||
$ head -n 1 filtered_metadata.tsv | ||
strain "col""1" "col2""" |
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
31 changes: 31 additions & 0 deletions
31
tests/functional/filter/cram/subsample-group-by-empty-value.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,31 @@ | ||
Setup | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
$ cat >metadata-no-date.tsv <<~~ | ||
> strain col1 col2 col3 | ||
> SEQ1 b | ||
> SEQ2 b | ||
> SEQ3 c d | ||
> SEQ4 c d | ||
> ~~ | ||
An empty value in a --group-by column is still treated as a value for grouping. | ||
I.e. the groups here are: | ||
1. (None, None, b) | ||
2. (None, c , d) | ||
$ ${AUGUR} filter \ | ||
> --metadata metadata-no-date.tsv \ | ||
> --group-by col1 col2 col3 \ | ||
> --sequences-per-group 1 \ | ||
> --subsample-seed 0 \ | ||
> --output-log filtered-log.tsv \ | ||
> --output-strains filtered-strains.txt > /dev/null | ||
$ cat filtered-strains.txt | ||
SEQ1 | ||
SEQ3 | ||
$ tail -n+2 filtered-log.tsv | sort | ||
SEQ2\tsubsampling\t (esc) | ||
SEQ4\tsubsampling\t (esc) |
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