refactor: Replace in-workflow HAPLINK processes with imported modules

This commit is contained in:
Thomas A. Christensen II 2023-09-23 16:24:57 -05:00
parent 47500bc986
commit 52ca8f1528
Signed by: millironx
GPG key ID: 09335146883990B9
2 changed files with 10 additions and 53 deletions

55
main.nf
View file

@ -1,6 +1,8 @@
#!/usr/bin/env nextflow #!/usr/bin/env nextflow
include { EFETCH } from './modules/efetch' include { EFETCH } from './modules/efetch'
include { HAPLINK_HAPLOTYPES as HAPLINK_ML_HAPLOTYPES } from './modules/haplink/haplotypes'
include { HAPLINK_HAPLOTYPES as HAPLINK_RAW_HAPLOTYPES } from './modules/haplink/haplotypes'
include { HAPLINK_VARIANTS } from './modules/haplink/variants' include { HAPLINK_VARIANTS } from './modules/haplink/variants'
include { MINIMAP2 } from './modules/minimap2' include { MINIMAP2 } from './modules/minimap2'
include { NANOFILT } form './modules/nanofilt' include { NANOFILT } form './modules/nanofilt'
@ -73,59 +75,6 @@ workflow {
) )
} }
process HAPLINK_RAW_HAPLOTYPES {
cpus 2
memory '12.GB'
input:
tuple val(prefix), path(bam), path(bai), path(vcf)
path reference
output:
tuple val(prefix), path("*.yaml")
publishDir "results/raw-haplotypes", mode: 'copy'
script:
"""
export JULIA_NUM_THREADS=${task.cpus}
haplink haplotypes \\
"${reference}" \\
"${vcf}" \\
"${bam}" \\
--frequency 0.01 \\
> "${prefix}.yaml"
"""
}
process HAPLINK_ML_HAPLOTYPES {
cpus 8
memory '12.GB'
input:
tuple val(prefix), path(bam), path(bai), path(vcf)
path reference
output:
tuple val(prefix), path("*.yaml")
publishDir "results/ml-haplotypes", mode: 'copy'
script:
"""
export JULIA_NUM_THREADS=${task.cpus}
haplink haplotypes \\
"${reference}" \\
"${vcf}" \\
"${bam}" \\
--simulated-reads \\
--overlap-min 20 \\
--overlap-max 8000 \\
--frequency 0.01 \\
> "${prefix}.yaml"
"""
}
process HAPLINK_SEQUENCES { process HAPLINK_SEQUENCES {
cpus 1 cpus 1
memory '6.GB' memory '6.GB'

View file

@ -1,6 +1,14 @@
process { process {
errorStrategy = 'finish' errorStrategy = 'finish'
time = '7d' time = '7d'
withName: 'HAPLINK_ML_HAPLOTYPES' {
ext.ml_args = """
--simulated-reads \\
--overlap-min 20 \\
--overlap-max 8000 \\
"""
}
} }
singularity.enabled = true singularity.enabled = true