Skip to content

Hic dev #8

Merged
merged 4 commits into from
Oct 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 10 additions & 9 deletions TOuCAN.nf
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ if(params.mode == "multiplot"){

if (params.mode != "plot"){

if ( "${path_T2C_restriction_maps}" != ""){
if ( "${path_T2C_restriction_maps}" != "none"){
if (! file ("${path_T2C_restriction_maps}/restriction_targets.bed").exists()){
println("Warning: restriction_target.bed does not exists on given path (path_T2C_restriction_maps in configuration file) -> starting to create restriction maps.")
create_res_map = true
Expand Down Expand Up @@ -371,7 +371,11 @@ process create_restriction_maps_for_T2C {
publishDir "${outpath}/${params.pn}_restriction_maps/", mode: 'copy'

output:
file ("*.bed") into restriction_maps
file ("restriction_sites_${params.enzyme_a_name}.bed") into restriction_maps_1
file ("restriction_fragments_${params.enzyme_a_name}.bed") into restriction_maps_2
file ("restriction_sites.bed") into restriction_maps_3
file ("restriction_fragments.bed") into restriction_maps_4
file ("restriction_targets.bed") into restriction_maps_5

when:
params.mode == 'T2C' || params.mode == 'multiplot'
Expand Down Expand Up @@ -407,10 +411,10 @@ process create_restriction_maps_for_T2C {
grep ${params.enzyme_a_sequence} restriction_fragments.bed > restriction_targets.bed
"""
}
restriction_maps = restriction_maps_1.concat(restriction_maps_2, restriction_maps_3, restriction_maps_4, restriction_maps_5)

res_map.concat(restriction_maps).into {final_res_map_for_check; final_res_map; final_res_map_for_intersection; res_map_for_ifm}


process check_restriction_maps {

tag{params.enzyme_a_name}
Expand Down Expand Up @@ -640,7 +644,6 @@ process samtools_sort {

bam_f.concat(bamfiles).into {finalbam; bamfiles_for_flagstats; workaround}


// T2C Step 6
process samtools_flagstat {

Expand Down Expand Up @@ -692,7 +695,7 @@ process index_bamfiles {
"""
}

bam_bai_files_final = bam_bai_files.combine(workaround, by: 0)
bam_bai_files.combine(workaround, by: 0).set {bam_bai_files_final}

/*
* T2C Step 8
Expand Down Expand Up @@ -1450,11 +1453,9 @@ process plot_TAD_graph {

}

multiplot_bed_1.concat(multiplot_bed_2).into {multiplot_bed_merged; testa}
multiplot_bed_1.concat(multiplot_bed_2).set {multiplot_bed_merged}
multiplot_TAD.join(multiplot_bed_merged).set {multi}

multiplot_TAD.join(multiplot_bed_merged).into {multi; testb}
testa.println()
testb.println()

process multiplot {

Expand Down
6 changes: 3 additions & 3 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ env {
path_R = "/mnt/software/x86_64/packages/r/3.4.4-stretch-local/bin" //Path to R

path_bin = "/mnt/workspace1/rene.wiegandt/NextFlow/script/TOuCAN" // Path to parent folder containing bin folder with T2C analysis scripts.
path_working = "/mnt/workspace1/rene.wiegandt/NextFlow/script/TOuCAN" // Working directory.
path_working = "/mnt/workspace1/rene.wiegandt/NextFlow/script/TOuCAN" // Working directory.

path_genome = "/mnt/workspace1/rene.wiegandt/NextFlow/script/THCPipe/index_bwa/GRCm38.p5.genome_whitelist.fa" // Path to full genome in fasta format + basis name of index [e.g. GRCm38.p5.genome_whitelist.fa]
path_gtf = "/mnt/agnerds/Rene.Wiegandt/fromMario/gencode.vM15.annotation.gtf"

path_T2C_restriction_maps = "${path_working}/01_restriction_maps" //If empty restriction maps are generated [typically: path_working + /01_restriction_maps/]. If empty files are generated
path_T2C_restriction_maps = "none"//"${path_working}/01_restriction_maps" //If "none" restriction maps are generated [typically: path_working + /01_restriction_maps/]. If empty files are generated

}

Expand Down Expand Up @@ -42,7 +42,7 @@ params {
//Parameter for HiC matrix
//--------------------------------------------
hicBuildMatrix_threads = 16
bwa_HiC_options = "-t 4" // bwa mem
bwa_HiC_options = "-t 16" // bwa mem
threads_bowtie2 = 12
inputBufferSize = 400000

Expand Down