diff --git a/mop_dna/mop_dna.nf b/mop_dna/mop_dna.nf index 497ffad..8cd1da5 100755 --- a/mop_dna/mop_dna.nf +++ b/mop_dna/mop_dna.nf @@ -43,8 +43,7 @@ if (params.help) exit 1 if (params.resume) exit 1, "Are you making the classical --resume typo? Be careful!!!! ;)" // check input files -reference = file(params.reference) -if( !reference.exists() ) exit 1, "Missing reference file: ${reference}!" +reference = channel.fromPath(params.reference, checkIfExists: true) // include functions, outdirs from other files evaluate(new File("../outdirs.nf")) @@ -63,6 +62,8 @@ include { checkRef } from "${local_modules}" progPars = getParameters(params.pars_tools) include { RUN as RUN_CLAIRS } from "${subworkflowsDir}/snp_calling/clairS" addParams(LABEL: 'big_mem_cpus', EXTRAPARS: progPars["clairS--clairS"], OUTPUT: outputClairS) +include { CHECK_FASTA } from "${subworkflowsDir}/misc/misc.nf" +include { FAIDX as SAMTOOLS_FAIDX } from "${subworkflowsDir}/misc/samtools" @@ -104,8 +105,9 @@ workflow { [it, file("${params.input_path}/alignment/${it}_s.bam.bai")] }.transpose().set{bais} - // ref_file = checkRef(reference) - clairS_flow(bams, comparisons, reference) + checked_genome = CHECK_FASTA(reference) + faidx = SAMTOOLS_FAIDX(checked_genome) + clairS_flow(bams, bais, comparisons, checked_genome, faidx) } @@ -115,12 +117,23 @@ workflow clairS_flow { take: bam + bais comparisons reference + faidx main: - data = mapIDPairs(comparisons, bam) - RUN_CLAIRS(data, reference) + bam_comp = mapIDPairs(comparisons, bam).map{ + [ "${it[0]}--${it[1]}", it[2], it[3] ] + } + + + bai_comp = mapIDPairs(comparisons, bais).map{ + [ "${it[0]}--${it[1]}", it[2], it[3] ] + } + + data = bam_comp.join(bai_comp) + RUN_CLAIRS(data, reference, faidx) // emit: diff --git a/mop_dna/params.yaml b/mop_dna/params.yaml index 40de8b6..eb7a2be 100755 --- a/mop_dna/params.yaml +++ b/mop_dna/params.yaml @@ -1,6 +1,7 @@ input_path: "${projectDir}/test_dataset/" comparison: "${projectDir}/comparison.tsv" +##reference: "${projectDir}/GRCh38.primary_assembly.genome.fa" reference: "/db/gencode/human/release_38/GRCh38.primary_assembly.genome.fa.gz" output: "${projectDir}/output_dna" pars_tools: "${projectDir}/tools_opt.tsv" diff --git a/outdirs.nf b/outdirs.nf index b595870..0ce640a 100644 --- a/outdirs.nf +++ b/outdirs.nf @@ -19,6 +19,9 @@ outputNanoPolComFlow = "${params.output}/nanopolish-compore_flow" outputTomboFlow = "${params.output}/tombo_flow" outputModPhredFlow = "${params.output}/modphred_flow" +// mop_dna +outputClairS = "${params.output}/clairS_flow" + // MOP_TAIL outputTailFindr = "${params.output}/tailfindr_flow" outputNanopolish = "${params.output}/nanopolish_flow"