Skip to content
Snippets Groups Projects
Commit ace27ad5 authored by nservant's avatar nservant
Browse files

[MODIF] issue with sample name

parent 73d4b88e
No related branches found
No related tags found
No related merge requests found
...@@ -137,7 +137,7 @@ else if ( params.fasta ) { ...@@ -137,7 +137,7 @@ else if ( params.fasta ) {
Channel.fromPath( params.fasta ) Channel.fromPath( params.fasta )
.ifEmpty { exit 1, "Genome index: Fasta file not found: ${params.fasta}" } .ifEmpty { exit 1, "Genome index: Fasta file not found: ${params.fasta}" }
.set { fasta_for_index } .into { fasta_for_index }
} }
else { else {
exit 1, "No reference genome specified!" exit 1, "No reference genome specified!"
...@@ -146,7 +146,7 @@ else { ...@@ -146,7 +146,7 @@ else {
// Chromosome size // Chromosome size
if ( params.chromosome_size ){ if ( params.chromosome_size ){
Channel.fromPath( params.chromosome_size , checkIfExists: true) Channel.fromPath( params.chromosome_size , checkIfExists: true)
.into {chrsize; chrsize_build; chrsize_raw; chrsize_balance; chrsize_zoom} .into {chrsize; chrsize_build; chrsize_raw; chrsize_balance; chrsize_zoom, chrsize_compartments}
} }
else if ( params.fasta ){ else if ( params.fasta ){
Channel.fromPath( params.fasta ) Channel.fromPath( params.fasta )
...@@ -206,6 +206,9 @@ if (params.res_dist_decay && !params.skip_dist_decay){ ...@@ -206,6 +206,9 @@ if (params.res_dist_decay && !params.skip_dist_decay){
} }
if (params.res_compartments && !params.skip_compartments){ if (params.res_compartments && !params.skip_compartments){
Channel.fromPath( params.fasta )
.ifEmpty { exit 1, "Compartments calling: Fasta file not found: ${params.fasta}" }
.set { fasta_for_compartments }
Channel.from( "${params.res_compartments}" ) Channel.from( "${params.res_compartments}" )
.splitCsv() .splitCsv()
.flatten() .flatten()
...@@ -213,6 +216,7 @@ if (params.res_compartments && !params.skip_compartments){ ...@@ -213,6 +216,7 @@ if (params.res_compartments && !params.skip_compartments){
map_res = map_res.concat(comp_bin) map_res = map_res.concat(comp_bin)
all_res = all_res + ',' + params.res_compartments all_res = all_res + ',' + params.res_compartments
}else{ }else{
fasta_for_compartments = Channel.empty()
comp_res = Channel.create() comp_res = Channel.create()
if (!params.skip_compartments){ if (!params.skip_compartments){
log.warn "[nf-core/hic] Hi-C resolution for compartment calling not specified. See --res_compartments" log.warn "[nf-core/hic] Hi-C resolution for compartment calling not specified. See --res_compartments"
...@@ -572,7 +576,7 @@ process combine_mates{ ...@@ -572,7 +576,7 @@ process combine_mates{
saveAs: {filename -> filename.endsWith(".pairstat") ? "stats/$filename" : "$filename"} saveAs: {filename -> filename.endsWith(".pairstat") ? "stats/$filename" : "$filename"}
input: input:
set val(sample), file(aligned_bam) from bwt2_merged_bam.groupTuple().dump(tag:'mates') set val(sample), file(aligned_bam) from bwt2_merged_bam.groupTuple()
output: output:
set val(oname), file("${sample}_bwt2pairs.bam") into paired_bam set val(oname), file("${sample}_bwt2pairs.bam") into paired_bam
...@@ -605,7 +609,9 @@ if (!params.dnase){ ...@@ -605,7 +609,9 @@ if (!params.dnase){
tag "$sample" tag "$sample"
label 'process_low' label 'process_low'
publishDir "${params.outdir}/hicpro/valid_pairs", mode: params.publish_dir_mode, publishDir "${params.outdir}/hicpro/valid_pairs", mode: params.publish_dir_mode,
saveAs: {filename -> filename.endsWith("stat") ? "stats/$filename" : "$filename"} saveAs: {filename -> if (filename.endsWith("RSstat")) "stats/$filename"
else if (filename.endsWith(".validPairs")) filename
else if (params.save_nonvalid_pairs) filename}
input: input:
set val(sample), file(pe_bam) from paired_bam set val(sample), file(pe_bam) from paired_bam
...@@ -644,7 +650,8 @@ else{ ...@@ -644,7 +650,8 @@ else{
tag "$sample" tag "$sample"
label 'process_low' label 'process_low'
publishDir "${params.outdir}/hicpro/valid_pairs", mode: params.publish_dir_mode, publishDir "${params.outdir}/hicpro/valid_pairs", mode: params.publish_dir_mode,
saveAs: {filename -> filename.endsWith(".stat") ? "stats/$filename" : "$filename"} saveAs: {filename -> if (filename.endsWith("RSstat")) "stats/$filename"
else filename}
input: input:
set val(sample), file(pe_bam) from paired_bam set val(sample), file(pe_bam) from paired_bam
...@@ -682,7 +689,7 @@ process remove_duplicates { ...@@ -682,7 +689,7 @@ process remove_duplicates {
output: output:
set val(sample), file("*.allValidPairs") into ch_vpairs, ch_vpairs_cool set val(sample), file("*.allValidPairs") into ch_vpairs, ch_vpairs_cool
file("stats/") into all_mergestat file("stats/*") into all_mergestat
script: script:
if ( ! params.keep_dups ){ if ( ! params.keep_dups ){
...@@ -952,13 +959,18 @@ process compartment_calling { ...@@ -952,13 +959,18 @@ process compartment_calling {
input: input:
set val(sample), val(res), file(cool), val(r) from chcomp set val(sample), val(res), file(cool), val(r) from chcomp
file(fasta) from fasta_for_compartments
file(chrsize) from chrsize_compartments.collect()
output: output:
file("*compartments*") optional true into out_compartments file("*compartments*") optional true into out_compartments
script: script:
""" """
cooltools call-compartments --contact-type cis -o ${sample}_compartments ${cool} cooltools genome binnify ${chrsize} ${res} > genome_bins.txt
cooltools genome gc genome_bins.txt ${fasta} > genome_gc.txt
cooltools call-compartments --reference-tracks genome_gc.txt --contact-type cis -o ${sample}_compartments ${cool}
awk -F"\t" 'NR>1{OFS="\t"; if($6==""){$6=0}; print $1,$2,$3,$6}' ${sample]_compartments.cis.vecs.tsv | sort -k1,1 -k2,2n > ${sample]_compartments.cis.E1.bedgraph
""" """
} }
......
...@@ -54,6 +54,7 @@ params { ...@@ -54,6 +54,7 @@ params {
max_restriction_fragment_size = 0 max_restriction_fragment_size = 0
min_insert_size = 0 min_insert_size = 0
max_insert_size = 0 max_insert_size = 0
save_nonvalid_pairs = false
// Dnase Hi-C // Dnase Hi-C
dnase = false dnase = false
......
...@@ -118,6 +118,12 @@ ...@@ -118,6 +118,12 @@
"description": "If generated by the pipeline save the annotation and indexes in the results directory.", "description": "If generated by the pipeline save the annotation and indexes in the results directory.",
"help_text": "Use this parameter to save all annotations to your results folder. These can then be used for future pipeline runs, reducing processing times.", "help_text": "Use this parameter to save all annotations to your results folder. These can then be used for future pipeline runs, reducing processing times.",
"fa_icon": "fas fa-save" "fa_icon": "fas fa-save"
},
"save_nonvalid_pairs": {
"type": "boolean",
"description": "Save the non valid pairs detected by HiC-Pro.",
"help_text": "Use this parameter to save non valid pairs detected by HiC-Pro (dangling-end, self-circle, re-ligation, filtered).",
"fa_icon": "fas fa-save"
} }
} }
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment