From b8a280535cc3fe6c82fc05427cf885a673b868b2 Mon Sep 17 00:00:00 2001 From: jessicaw9910 Date: Fri, 19 Jul 2024 16:10:51 -0400 Subject: [PATCH] loading BED from file rather than downloading via wget --- nextflow/main.nf | 7 ++++++- nextflow/modules/rseqc/main.nf | 12 ------------ nextflow/subworkflows/bam_qc.nf | 7 +++---- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/nextflow/main.nf b/nextflow/main.nf index d8e61ea..2f16a2d 100644 --- a/nextflow/main.nf +++ b/nextflow/main.nf @@ -90,6 +90,11 @@ if ( params.adapterFASTA ){ if( !adapter_fasta.exists() ) exit 1, "Genome chrom sizes file not found: ${params.adapterFASTA}" } +if ( params.fileBED ){ + file_bed = file(params.fileBED) + if( !file_bed.exists() ) exit 1, "Bed file not found: ${params.fileBED}" +} + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ WORKFLOWS @@ -130,7 +135,7 @@ workflow QC_BAM { .map { [it.simpleName, it ] } .set { bam_ch } - BAM_QC ( bam_ch ) + BAM_QC ( bam_ch, file_bed ) Channel .fromPath ( params.fastp_json, checkIfExists: true ) diff --git a/nextflow/modules/rseqc/main.nf b/nextflow/modules/rseqc/main.nf index 52b0206..1f9b33c 100644 --- a/nextflow/modules/rseqc/main.nf +++ b/nextflow/modules/rseqc/main.nf @@ -1,15 +1,3 @@ -process GET_BED { - publishDir "${params.outDir}", mode: 'copy', overwrite: true - - output: - path '*.bed*', emit: bed - - shell: - """ - wget -O "!{params.fileBED}" "!{params.linkBED}" - """ -} - process RSEQC_BAMSTAT { label 'process_medium' diff --git a/nextflow/subworkflows/bam_qc.nf b/nextflow/subworkflows/bam_qc.nf index 65ee3fe..42e6062 100644 --- a/nextflow/subworkflows/bam_qc.nf +++ b/nextflow/subworkflows/bam_qc.nf @@ -1,7 +1,6 @@ #!/usr/bin/env nextflow include { SAMTOOLS_FLAGSTAT } from '../modules/samtools/main.nf' -include { GET_BED } from '../modules/rseqc/main.nf' include { RSEQC_BAMSTAT } from '../modules/rseqc/main.nf' include { RSEQC_INFEREXP } from '../modules/rseqc/main.nf' include { RSEQC_READDUPLICATION } from '../modules/rseqc/main.nf' @@ -11,14 +10,14 @@ include { RUN_MULTIQC } from '../modules/multiqc/main.nf' workflow BAM_QC { take: bam // file: /path/to/sample.bam + bed // file: /path/to/bed main: - GET_BED() SAMTOOLS_FLAGSTAT ( bam ) RSEQC_BAMSTAT ( bam ) - RSEQC_INFEREXP ( bam, GET_BED.out.bed ) + RSEQC_INFEREXP ( bam, bed ) RSEQC_READDUPLICATION ( bam ) - RSEQC_READDISTRIBUTION ( bam, GET_BED.out.bed ) + RSEQC_READDISTRIBUTION ( bam, bed ) emit: flagstat = SAMTOOLS_FLAGSTAT.out.flagstat