Skip to content

Commit fb11c1c

Browse files
committed
Unit test for ParseToPairs buildCmd
1 parent 2d368b5 commit fb11c1c

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
2+
nextflow_function {
3+
4+
name "ParseToPairs_buildCmd"
5+
script "contents/subwf/reads/ParseToPairs/functions.nf"
6+
7+
test("ParseToPairs_buildCmd_userCmds") {
8+
9+
function "buildCmd"
10+
11+
when {
12+
function {
13+
"""
14+
input = [
15+
"test", "test.bam", "hg38.sizes", "hg38",
16+
[
17+
pairtools_parse2_opts: ["--max-insert-size": 1000],
18+
pairtools_sort: ["--tmpdir":"./temp"],
19+
20+
],
21+
30, 16, 24
22+
]
23+
"""
24+
}
25+
}
26+
27+
then {
28+
assert function.success
29+
def (samtoolsCmd, parseCmd, sortCmd) = CommandChecker.getPipeParts(function.result[0])
30+
CommandChecker.checkCmd(samtoolsCmd, "samtools view", ["-b", "'test.bam'"])
31+
CommandChecker.checkCmd(
32+
parseCmd,
33+
"pairtools parse2",
34+
[
35+
"--flip",
36+
[
37+
"--assembly": "'hg38'",
38+
"--min-mapq": "'30'",
39+
"-c": "'hg38.sizes'",
40+
"--max-insert-size": "'1000'"
41+
]
42+
]
43+
)
44+
CommandChecker.checkCmd(
45+
sortCmd,
46+
"pairtools sort",
47+
[
48+
[
49+
"--output": "'test.pairs.gz'",
50+
"--memory": "'16G'",
51+
"--nproc-in": "'24'",
52+
"--nproc-out": "'24'",
53+
"--tmpdir": "'./temp'"
54+
]
55+
]
56+
)
57+
}
58+
}
59+
}

0 commit comments

Comments
 (0)