nf-core_modules/tests/modules/plink/extract/main.nf
Benjamin Wingfield 6bb4a6a7ee
Implement plink/extract module (#901)
* Implement PLINK_EXTRACT module

* fix plink version number

* Update main.nf

* Update test_data.config

* Update modules/plink/extract/main.nf

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* just use one channel

* fix test with new channel input

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
2021-11-09 14:03:13 +00:00

29 lines
961 B
Text

#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { PLINK_VCF } from '../../../../modules/plink/vcf/main.nf' addParams ( options: [args:'--make-bed --set-missing-var-ids @:#:\\$1:\\$2'])
include { PLINK_EXTRACT } from '../../../../modules/plink/extract/main.nf' addParams( options: [suffix:'.extract'] )
workflow test_plink_extract {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['genome']['syntheticvcf_short_vcf_gz'], checkIfExists: true)
]
PLINK_VCF ( input )
PLINK_VCF.out.bim
.splitText(file: 'variants.keep', keepHeader: false, by: 10)
.first()
.set { ch_variants }
PLINK_VCF.out.bed
.concat(PLINK_VCF.out.bim, PLINK_VCF.out.fam.concat(ch_variants))
.groupTuple()
.map{ meta, paths -> [meta, paths[0], paths[1], paths[2], paths[3]] }
.set { ch_extract }
PLINK_EXTRACT ( ch_extract )
}