|
| 1 | +nextflow_process { |
| 2 | + |
| 3 | + name "Test Process GATK_HAPLOTYPECALLER" |
| 4 | + script "../main.nf" |
| 5 | + process "GATK_HAPLOTYPECALLER" |
| 6 | + |
| 7 | + test("Should call son's halotype correctly") { |
| 8 | + |
| 9 | + setup { |
| 10 | + run("SAMTOOLS_INDEX") { |
| 11 | + script "../../../samtools/index/main.nf" |
| 12 | + process { |
| 13 | + """ |
| 14 | + input[0] = file("${projectDir}/data/bam/reads_son.bam") |
| 15 | + """ |
| 16 | + } |
| 17 | + } |
| 18 | + } |
| 19 | + when { |
| 20 | + params { |
| 21 | + outdir = "tests/results" |
| 22 | + } |
| 23 | + process { |
| 24 | + """ |
| 25 | + input[0] = SAMTOOLS_INDEX.out |
| 26 | + input[1] = file("${projectDir}/data/ref/ref.fasta") |
| 27 | + input[2] = file("${projectDir}/data/ref/ref.fasta.fai") |
| 28 | + input[3] = file("${projectDir}/data/ref/ref.dict") |
| 29 | + input[4] = file("${projectDir}/data/ref/intervals.bed") |
| 30 | + """ |
| 31 | + } |
| 32 | + } |
| 33 | + |
| 34 | + then { |
| 35 | + assert process.success |
| 36 | + assert path(process.out[0][0]).readLines().contains('#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT reads_son') |
| 37 | + assert path(process.out[0][0]).readLines().contains('20_10037292_10066351 3277 . G <NON_REF> . . END=3282 GT:DP:GQ:MIN_DP:PL 0/0:25:72:24:0,72,719') |
| 38 | + } |
| 39 | + |
| 40 | + } |
| 41 | + |
| 42 | + test("Should call mother's halotype correctly") { |
| 43 | + |
| 44 | + setup { |
| 45 | + run("SAMTOOLS_INDEX") { |
| 46 | + script "../../../samtools/index/main.nf" |
| 47 | + process { |
| 48 | + """ |
| 49 | + input[0] = file("${projectDir}/data/bam/reads_mother.bam") |
| 50 | + """ |
| 51 | + } |
| 52 | + } |
| 53 | + } |
| 54 | + |
| 55 | + when { |
| 56 | + params { |
| 57 | + outdir = "tests/results" |
| 58 | + } |
| 59 | + process { |
| 60 | + """ |
| 61 | + input[0] = SAMTOOLS_INDEX.out |
| 62 | + input[1] = file("${projectDir}/data/ref/ref.fasta") |
| 63 | + input[2] = file("${projectDir}/data/ref/ref.fasta.fai") |
| 64 | + input[3] = file("${projectDir}/data/ref/ref.dict") |
| 65 | + input[4] = file("${projectDir}/data/ref/intervals.bed") |
| 66 | + """ |
| 67 | + } |
| 68 | + } |
| 69 | + |
| 70 | + then { |
| 71 | + assert process.success |
| 72 | + assert path(process.out[0][0]).readLines().contains('#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT reads_mother') |
| 73 | + assert path(process.out[0][0]).readLines().contains('20_10037292_10066351 3277 . G <NON_REF> . . END=3278 GT:DP:GQ:MIN_DP:PL 0/0:38:99:37:0,102,1530') |
| 74 | + } |
| 75 | + } |
| 76 | + |
| 77 | + test("Should call father's halotype correctly") { |
| 78 | + |
| 79 | + setup { |
| 80 | + run("SAMTOOLS_INDEX") { |
| 81 | + script "../../../samtools/index/main.nf" |
| 82 | + process { |
| 83 | + """ |
| 84 | + input[0] = file("${projectDir}/data/bam/reads_father.bam") |
| 85 | + """ |
| 86 | + } |
| 87 | + } |
| 88 | + } |
| 89 | + |
| 90 | + when { |
| 91 | + params { |
| 92 | + outdir = "tests/results" |
| 93 | + } |
| 94 | + process { |
| 95 | + """ |
| 96 | + input[0] = SAMTOOLS_INDEX.out |
| 97 | + input[1] = file("${projectDir}/data/ref/ref.fasta") |
| 98 | + input[2] = file("${projectDir}/data/ref/ref.fasta.fai") |
| 99 | + input[3] = file("${projectDir}/data/ref/ref.dict") |
| 100 | + input[4] = file("${projectDir}/data/ref/intervals.bed") |
| 101 | + """ |
| 102 | + } |
| 103 | + } |
| 104 | + |
| 105 | + then { |
| 106 | + assert process.success |
| 107 | + assert path(process.out[0][0]).readLines().contains('#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT reads_father') |
| 108 | + assert path(process.out[0][0]).readLines().contains('20_10037292_10066351 3277 . G <NON_REF> . . END=3281 GT:DP:GQ:MIN_DP:PL 0/0:44:99:42:0,120,1800') |
| 109 | + } |
| 110 | + } |
| 111 | +} |
0 commit comments