From d100d9175322d8bb46ceec09b8d656cc3837b6bd Mon Sep 17 00:00:00 2001 From: Beibei Chen <beibei.chen@utsouthwestern.edu> Date: Fri, 21 Apr 2017 16:35:06 -0500 Subject: [PATCH] fix path and bam indexing --- workflow/main.nf | 40 ++++++++++++++++---------------- workflow/scripts/runChipseeker.R | 3 ++- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/workflow/main.nf b/workflow/main.nf index bbbb08b..63c2c2b 100644 --- a/workflow/main.nf +++ b/workflow/main.nf @@ -1,7 +1,7 @@ #!/usr/bin/env nextflow params.design="$baseDir/../test_data/samplesheet.csv" params.bams = "$baseDir/../test_data/*.bam" - params.bais = "$baseDir/../test_data/*.bai" +// params.bais = "$baseDir/../test_data/*.bai" params.peaks = "$baseDir/../test_data/*.broadPeak" params.genomepath="/project/shared/bicf_workflow_ref/GRCh37" toppeakcount = 200 @@ -17,25 +17,25 @@ diffbind_bams = Channel.fromPath(params.bams) diffbind_peaks = Channel.fromPath(params.peaks) meme_peaks = Channel.fromPath(params.peaks) - deeptools_bamindex = Channel.fromPath(params.bais) - diffbind_bamindex = Channel.fromPath(params.bais) +// deeptools_bamindex = Channel.fromPath(params.bais) +// diffbind_bamindex = Channel.fromPath(params.bais) -//process bamindex { -// publishDir "$baseDir/output/", mode: 'copy' -// input: -// file index_bam_files from index_bams -// output: -// file "*bai" into deeptools_bamindex -// file "*bai" into diffbind_bamindex -// -// script: -// """ -// module load python/2.7.x-anaconda -// module load R/3.3.2-gccmkl -// module load samtools/intel/1.3 -// samtools index $index_bam_files -// """ -//} +process bamindex { + publishDir "$baseDir/output/", mode: 'copy' + input: + file index_bam_files from index_bams + output: + file "*bai" into deeptools_bamindex + file "*bai" into diffbind_bamindex + + script: + """ + module load python/2.7.x-anaconda + module load R/3.3.2-gccmkl + module load samtools/intel/1.3 + samtools index $index_bam_files + """ +} process run_deeptools { publishDir "$baseDir/output", mode: 'copy' @@ -102,7 +102,7 @@ process run_chipseeker_originalpeak { """ module load python/2.7.x-anaconda module load R/3.3.2-gccmkl - Rscript $baseDir/scripts/runChipseeker.R $design_file ${species} + Rscript $baseDir/scripts/runChipseeker.R $design_file ${params.genomepath} """ } diff --git a/workflow/scripts/runChipseeker.R b/workflow/scripts/runChipseeker.R index b968efc..e238a4a 100644 --- a/workflow/scripts/runChipseeker.R +++ b/workflow/scripts/runChipseeker.R @@ -8,7 +8,8 @@ args = commandArgs(trailingOnly=TRUE) library(ChIPseeker) #Parse the genome path and get genome version -genome = unlist(strsplit(args[2],"[/]"))[-1] +path_elements = unlist(strsplit(args[2],"[/]")) +genome = path_elements[length(path_elements)] if(genome=="GRCh37") { -- GitLab