Skip to content

Commit

Permalink
update regression tests with no default discarded and demultiplexing …
Browse files Browse the repository at this point in the history
…--out options
  • Loading branch information
MikkelSchubert committed Jul 28, 2024
1 parent bec1e96 commit 078a5b6
Show file tree
Hide file tree
Showing 189 changed files with 763 additions and 95 deletions.
13 changes: 10 additions & 3 deletions scripts/regression_test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,20 @@ def classname(v: object) -> str:

################################################################################


def _is_str_list(value: object) -> bool:
return isinstance(value, list) and all(
isinstance(v, str) for v in cast(List[object], value)
)


# Wildcards with (limited) type checking
JSON_WILDCARDS: dict[str, Callable[[object], bool]] = {
"...": lambda _: True,
"...str": lambda it: isinstance(it, str),
"...float": lambda it: isinstance(it, float) and not math.isnan(it),
"...[str]": lambda it: isinstance(it, list)
and all(isinstance(v, str) for v in cast(List[object], it)),
"...[str]": _is_str_list,
"...[str] | None": lambda it: it is None or _is_str_list(it),
}

# JSON path elements that do not require quoting
Expand Down Expand Up @@ -540,7 +547,7 @@ def _mask_filenames(data: JSON) -> JSON:
data = dict(data)
for key, value in data.items():
if key == "filenames":
data[key] = "...[str]"
data[key] = "...[str] | None"
else:
new_value = _mask_filenames(value)
if new_value is not value:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"input_2.fastq"
],
"output": [
"your_output.discarded.fastq",
"your_output.r1.fastq",
"your_output.r2.fastq",
"your_output.singleton.fastq"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
"gc_content": null
},
"discarded": {
"filenames": ["your_output.discarded.fastq"],
"filenames": null,
"input_reads": 0,
"output_reads": 0,
"reads_sampled": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"input_2.fastq"
],
"output": [
"your_output.discarded.fastq",
"your_output.r1.fastq",
"your_output.r2.fastq",
"your_output.singleton.fastq"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
"gc_content": null
},
"discarded": {
"filenames": ["your_output.discarded.fastq"],
"filenames": null,
"input_reads": 0,
"output_reads": 0,
"reads_sampled": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"input_1.fastq"
],
"output": [
"your_output.discarded.fastq",
"your_output.r1.fastq"
],
"json": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"unidentified_2": null,
"singleton": null,
"discarded": {
"filenames": ["your_output.discarded.fastq"],
"filenames": null,
"input_reads": 0,
"output_reads": 0,
"reads_sampled": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"input_2.fastq"
],
"output": [
"your_output.discarded.fastq",
"your_output.r1.fastq",
"your_output.r2.fastq",
"your_output.singleton.fastq"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
"gc_content": null
},
"discarded": {
"filenames": ["your_output.discarded.fastq"],
"filenames": null,
"input_reads": 0,
"output_reads": 0,
"reads_sampled": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"input_1.fastq"
],
"output": [
"your_output.discarded.fastq",
"your_output.r1.fastq"
],
"json": [
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"unidentified_2": null,
"singleton": null,
"discarded": {
"filenames": ["your_output.discarded.fastq"],
"filenames": null,
"input_reads": 0,
"output_reads": 0,
"reads_sampled": 0,
Expand Down
4 changes: 3 additions & 1 deletion tests/regression/adapter_trimming/only_adapter/pe/test.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"arguments": [
"--basename",
"your_output"
"your_output",
"--out-discarded",
"your_output.discarded.fastq"
],
"files": {
"input_1": [
Expand Down
4 changes: 3 additions & 1 deletion tests/regression/adapter_trimming/only_adapter/se/test.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"arguments": [
"--basename",
"your_output"
"your_output",
"--out-discarded",
"your_output.discarded.fastq"
],
"files": {
"input_1": [
Expand Down
2 changes: 2 additions & 0 deletions tests/regression/demultiplexing/common/basenames/barcodes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sample_1 TGAGTCAT GTTAGTGG
sample_2 GCAGAGAT CCTAGGGT
483 changes: 483 additions & 0 deletions tests/regression/demultiplexing/common/basenames/basename_1.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@read_s1_000

+

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@read_s2_000

+

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@read_s1_075
GCACAGTTACACTGCCGTTTGTCTGTCCATGTAATTGTCTAATCACTTTAGAATACGGCTCCTGATATCATCACC
+
GGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCDDDDDDDEEEEEEEEEFFFFFFFFFGGGGGGGGGGG
@read_s1_150
AGAATGAGCGGGGTCGACTCGTAACGATCTCTGCAGGGCGATGGTCTACATAGGCCCCACATCCAGATTATCTCGTAAAAGGAAAAACGGTTGAAAGTACCAAAGGAGTATCACCAGTACGTGAGAAGTGAGCGGTTGCTATAACCACAT
+
GGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;<<<====>>>?????@@@@AAAAAABBBBBBCCCCCCCDDDDDDDEEEEEEEEEFFFFFFFFFGGGGGGGGGGG
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@read_s2_075
CCTACAAAAGTTAAGTGCGCGTTTGGGCATCGTCCCGACGACTTCCGCTGAGTTGACTTAATGGCTTGTCGGTAC
+
GGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCDDDDDDDEEEEEEEEEFFFFFFFFFGGGGGGGGGGG
@read_s2_150
TAGCCCCCGGGGTGTGGGGTTTTGCTTCCGCCACAAAAATGGTGCGCTAAATGACCATTGCGTACACTCCAACGCGAAATGTAGGGCGCCGAGCACAATCAGATAATAATATGCTGATCGTCAACAATTGGGTACTGCCGAATCGAGAGG
+
GGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;<<<====>>>?????@@@@AAAAAABBBBBBCCCCCCCDDDDDDDEEEEEEEEEFFFFFFFFFGGGGGGGGGGG
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@read_s1_200/1
ACATCCAAGTCGGGCAACCTCTCACATTACTTAGGCCAGGCACTTGCACATCGAAGCAAAGGAGAGATAATTGCCGTATCCTCTGTGCACGT
+
GGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@read_s2_200/1
GCCCATAAAATATTGCTCGCAACGGTATGCTAGACCCAGGACATCCGCTTTATCCGTGGTGATAGCAACTGGAGGCATCTAACGTTCACACG
+
GGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@read_s1_200/2
GATAATACGCTCTAGAGAAAAAGAGTGATAAGTGAATAACCGGGCTATAGTGACAAAGAATTCCGCGTTACTAAATCACCCAACCCACCTTC
+
GGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@read_s2_200/2
TTACTTTTGATTCAACACCGACTTGGTCCCGCCTCCACGTGCAACACCCCCTTTTAATAGCAACGCGCTCACCGAGGCTCCTCCCATCCACA
+
GGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
32 changes: 32 additions & 0 deletions tests/regression/demultiplexing/common/basenames/input_1.fastq
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@read_s2_000/1
GCAGAGATACCCTAGGAGATCGGAAGAGCACACGTCTGAACTCCAGTCACCAACCAATCTCGTATGCCGTCTTCTGCTTGAAAAAAAAAAAAAAAAAAAA
+
HHHHHHHHGGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
@read_s2_075/1
GCAGAGATCCTACAAAAGTTAAGTGCGCGTTTGGGCATCGTCCCGACGACTTCCGCTGAGTTGACTTAATGGCTTGTCGGTACACCCTAGGAGATCGGAA
+
HHHHHHHHGGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
@read_s1_000/1
TGAGTCATCCACTAACAGATCGGAAGAGCACACGTCTGAACTCCAGTCACCAACCAATCTCGTATGCCGTCTTCTGCTTGAAAAAAAAAAAAAAAAAAAA
+
HHHHHHHHGGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
@read_s1_075/1
TGAGTCATGCACAGTTACACTGCCGTTTGTCTGTCCATGTAATTGTCTAATCACTTTAGAATACGGCTCCTGATATCATCACCCCACTAACAGATCGGAA
+
HHHHHHHHGGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
@read_s1_200/1
TGAGTCATACATCCAAGTCGGGCAACCTCTCACATTACTTAGGCCAGGCACTTGCACATCGAAGCAAAGGAGAGATAATTGCCGTATCCTCTGTGCACGT
+
HHHHHHHHGGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
@read_s2_200/1
GCAGAGATGCCCATAAAATATTGCTCGCAACGGTATGCTAGACCCAGGACATCCGCTTTATCCGTGGTGATAGCAACTGGAGGCATCTAACGTTCACACG
+
HHHHHHHHGGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
@read_s1_150/1
TGAGTCATAGAATGAGCGGGGTCGACTCGTAACGATCTCTGCAGGGCGATGGTCTACATAGGCCCCACATCCAGATTATCTCGTAAAAGGAAAAACGGTT
+
HHHHHHHHGGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
@read_s2_150/1
GCAGAGATTAGCCCCCGGGGTGTGGGGTTTTGCTTCCGCCACAAAAATGGTGCGCTAAATGACCATTGCGTACACTCCAACGCGAAATGTAGGGCGCCGA
+
HHHHHHHHGGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
32 changes: 32 additions & 0 deletions tests/regression/demultiplexing/common/basenames/input_2.fastq
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@read_s2_000/2
CCTAGGGTATCTCTGCAGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATTAAAAAAAAAAAAAAAAAAAAAAAAAA
+
HHHHHHHHGGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
@read_s2_075/2
CCTAGGGTGTACCGACAAGCCATTAAGTCAACTCAGCGGAAGTCGTCGGGACGATGCCCAAACGCGCACTTAACTTTTGTAGGATCTCTGCAGATCGGAA
+
HHHHHHHHGGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
@read_s1_000/2
GTTAGTGGATGACTCAAGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATTAAAAAAAAAAAAAAAAAAAAAAAAAA
+
HHHHHHHHGGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
@read_s1_075/2
GTTAGTGGGGTGATGATATCAGGAGCCGTATTCTAAAGTGATTAGACAATTACATGGACAGACAAACGGCAGTGTAACTGTGCATGACTCAAGATCGGAA
+
HHHHHHHHGGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
@read_s1_200/2
GTTAGTGGGATAATACGCTCTAGAGAAAAAGAGTGATAAGTGAATAACCGGGCTATAGTGACAAAGAATTCCGCGTTACTAAATCACCCAACCCACCTTC
+
HHHHHHHHGGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
@read_s2_200/2
CCTAGGGTTTACTTTTGATTCAACACCGACTTGGTCCCGCCTCCACGTGCAACACCCCCTTTTAATAGCAACGCGCTCACCGAGGCTCCTCCCATCCACA
+
HHHHHHHHGGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
@read_s1_150/2
GTTAGTGGATGTGGTTATAGCAACCGCTCACTTCTCACGTACTGGTGATACTCCTTTGGTACTTTCAACCGTTTTTCCTTTTACGAGATAATCTGGATGT
+
HHHHHHHHGGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
@read_s2_150/2
CCTAGGGTCCTCTCGATTCGGCAGTACCCAATTGTTGACGATCAGCATATTATTATCTGATTGTGCTCGGCGCCCTACATTTCGCGTTGGAGTGTACGCA
+
HHHHHHHHGGGGGGGGGGGFFFFFFFFFEEEEEEEEEDDDDDDDCCCCCCCBBBBBBAAAAAA@@@@?????>>>====<<<;;:::9988766543210
52 changes: 52 additions & 0 deletions tests/regression/demultiplexing/common/basenames/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"description": "Demultiplexing, trimming, and merging of PE reads with custom basenames",
"exhaustive": true,
"arguments": [
"--basename",
"basename_1",
"--out-discarded",
"basename_2",
"--out-merged",
"basename_3",
"--out-singleton",
"basename_4",
"--out-file1",
"basename_5",
"--out-file2",
"basename_6",
"--barcode-list",
"barcodes.txt",
"--merge"
],
"files": {
"input_1": [
"input_1.fastq"
],
"input_2": [
"input_2.fastq"
],
"barcodes": [
"barcodes.txt"
],
"output": [
"basename_1.unidentified.r1.fastq",
"basename_1.unidentified.r2.fastq",
"basename_2.sample_1.discarded.fastq",
"basename_2.sample_2.discarded.fastq",
"basename_3.sample_1.merged.fastq",
"basename_3.sample_2.merged.fastq",
"basename_4.sample_1.singleton.fastq",
"basename_4.sample_2.singleton.fastq",
"basename_5.sample_1.r1.fastq",
"basename_5.sample_2.r1.fastq",
"basename_6.sample_1.r2.fastq",
"basename_6.sample_2.r2.fastq"
],
"json": [
"basename_1.json"
],
"html": [
"basename_1.html"
]
}
}
2 changes: 2 additions & 0 deletions tests/regression/demultiplexing/common/interleaved/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"arguments": [
"--basename",
"your_output",
"--out-discarded",
"your_output",
"--barcode-list",
"barcodes.txt",
"--interleaved-output"
Expand Down
2 changes: 2 additions & 0 deletions tests/regression/demultiplexing/common/merge/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"arguments": [
"--basename",
"your_output",
"--out-discarded",
"your_output",
"--barcode-list",
"barcodes.txt",
"--merge"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"arguments": [
"--basename",
"your_output",
"--out-discarded",
"your_output",
"--barcode-list",
"barcodes.txt",
"--threads",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"arguments": [
"--basename",
"your_output",
"--out-discarded",
"your_output",
"--barcode-list",
"barcodes.txt",
"--threads",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"arguments": [
"--basename",
"your_output",
"--out-discarded",
"your_output",
"--barcode-list",
"barcodes.txt",
"--threads",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"arguments": [
"--basename",
"your_output",
"--out-discarded",
"your_output",
"--barcode-list",
"barcodes.txt"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"arguments": [
"--basename",
"your_output",
"--out-discarded",
"your_output",
"--barcode-list",
"barcodes.txt",
"--threads",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"arguments": [
"--basename",
"your_output",
"--out-discarded",
"your_output",
"--barcode-list",
"barcodes.txt",
"--threads",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"arguments": [
"--basename",
"your_output",
"--out-discarded",
"your_output",
"--barcode-list",
"barcodes.txt",
"--threads",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"arguments": [
"--basename",
"your_output",
"--out-discarded",
"your_output",
"--barcode-list",
"barcodes.txt"
],
Expand Down
Loading

0 comments on commit 078a5b6

Please sign in to comment.