forked from nf-core/modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QUILT nf-test and bamlist (nf-core#5515)
* Migrate quilt to nf-test and swithc bamlist to auto generation inside the module * Fix tests * Fix test * Fix tests * Add snap * Update license * Add quilt tag * Specify build hash for conda environment * Specify build hash for conda environment * Undo commit * Update nf-test snapshot * Fix config name * Update snapshot * Update meta.yml * Add r-base to environment * Update snapshot generation * Update meta.yml * Update snap * Update snap * Force sorting * Update snapshot
- Loading branch information
1 parent
979fe8b
commit cde646a
Showing
13 changed files
with
540 additions
and
276 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
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,132 @@ | ||
// Input data | ||
def path = "file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/" | ||
def bam = "[${path}NA12878.haplotagged.1.0.bam', checkIfExists: true), ${path}NA12878.ont.1.0.bam', checkIfExists: true), ${path}NA12878.illumina.1.0.bam', checkIfExists: true)]" | ||
def bai = "[${path}NA12878.haplotagged.1.0.bam.bai', checkIfExists: true), ${path}NA12878.ont.1.0.bam.bai', checkIfExists: true),${path}NA12878.illumina.1.0.bam.bai', checkIfExists: true)]" | ||
|
||
// Input reference data | ||
def reference_haplotype_file = "file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/ALL.chr20_GRCh38.genotypes.20170504.chr20.2000001.2100000.noNA12878.hap.gz', checkIfExists: true)" | ||
def reference_legend_file = "file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/ALL.chr20_GRCh38.genotypes.20170504.chr20.2000001.2100000.noNA12878.legend.gz', checkIfExists: true)" | ||
def genetic_map_file = "file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/CEU-chr20-final.b38.txt.gz', checkIfExists: true)" | ||
|
||
// Parameters | ||
def chr = "'chr20'" | ||
def regions_start = "2000001" | ||
def regions_end = "2100000" | ||
def ngen = "100" | ||
def buffer = "10000" | ||
|
||
|
||
// (optional) input truth data | ||
def posfile = "file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/ALL.chr20_GRCh38.genotypes.20170504.chr20.2000001.2100000.posfile.txt', checkIfExists: true)" | ||
def phasefile = "file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/quilt/ALL.chr20_GRCh38.genotypes.20170504.chr20.2000001.2100000.phasefile.txt', checkIfExists: true)" | ||
def posfile_phasefile = "[[ id:'test', chr:'chr20' ], [$posfile], [$phasefile]]" | ||
def fasta = "[[id:'test'], []]" | ||
|
||
// Input channel quilt | ||
def ch_input = "[ id:'test', chr:'chr20' ], $bam, $bai, [$reference_haplotype_file], [$reference_legend_file], $chr, $regions_start, $regions_end, $ngen, $buffer" | ||
def ch_input_gmap = "[$ch_input, [$genetic_map_file]]" | ||
def ch_input_nogmap = "[$ch_input, []]" | ||
|
||
nextflow_process { | ||
|
||
name "Test Process QUILT" | ||
script "../main.nf" | ||
process "QUILT_QUILT" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "quilt/quilt" | ||
tag "quilt" | ||
|
||
test("QUILT") { | ||
config ("./quilt_default.config") | ||
when { | ||
process { | ||
""" | ||
input[0] = $ch_input_gmap | ||
input[1] = $posfile_phasefile | ||
input[2] = $fasta | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("QUILT no optional files") { | ||
config ("./quilt_default.config") | ||
when { | ||
process { | ||
""" | ||
input[0] = $ch_input_nogmap | ||
input[1] = [[id: null], [], []] | ||
input[2] = $fasta | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("QUILT optional output") { | ||
config ("./quilt_optional.config") | ||
when { | ||
process { | ||
""" | ||
input[0] = $ch_input_gmap | ||
input[1] = $posfile_phasefile | ||
input[2] = $fasta | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
def dir = new File(process.out.plots[0][1]) | ||
def list = [] | ||
dir.eachFileRecurse { file -> list << file.getName() } | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot( | ||
process.out.vcf + process.out.tbi + | ||
list.sort() + | ||
process.out.rdata + process.out.versions | ||
).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("QUILT no seed") { | ||
config ("./quilt_noseed.config") | ||
when { | ||
process { | ||
""" | ||
input[0] = $ch_input_gmap | ||
input[1] = $posfile_phasefile | ||
input[2] = $fasta | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.