Skip to content

Commit

Permalink
loading BED from file rather than downloading via wget
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicaw9910 committed Jul 19, 2024
1 parent be2c4f3 commit b8a2805
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
7 changes: 6 additions & 1 deletion nextflow/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 )
Expand Down
12 changes: 0 additions & 12 deletions nextflow/modules/rseqc/main.nf
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
7 changes: 3 additions & 4 deletions nextflow/subworkflows/bam_qc.nf
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
Expand Down

0 comments on commit b8a2805

Please sign in to comment.