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

[MODIF] deal with technical replicates

parent 149e3d82
No related branches found
No related tags found
No related merge requests found
...@@ -70,16 +70,16 @@ workflow HICPRO { ...@@ -70,16 +70,16 @@ workflow HICPRO {
//************************************** //**************************************
// MERGE AND REMOVE DUPLICATES // MERGE AND REMOVE DUPLICATES
if (params.split_fastq){ //if (params.split_fastq){
ch_valid_pairs = ch_valid_pairs.map{ it -> removeChunks(it)}.groupTuple() ch_valid_pairs = ch_valid_pairs.map{ it -> removeChunks(it)}.groupTuple()
ch_hicpro_stats = HICPRO_MAPPING.out.mapstats.map{it->removeChunks(it)}.groupTuple() ch_hicpro_stats = HICPRO_MAPPING.out.mapstats.map{it->removeChunks(it)}.groupTuple()
.concat(HICPRO_MAPPING.out.pairstats.map{it->removeChunks(it)}.groupTuple(), .concat(HICPRO_MAPPING.out.pairstats.map{it->removeChunks(it)}.groupTuple(),
ch_valid_stats.map{it->removeChunks(it)}.groupTuple()) ch_valid_stats.map{it->removeChunks(it)}.groupTuple())
}else{ //}else{
ch_hicpro_stats = HICPRO_MAPPING.out.mapstats.groupTuple() // ch_hicpro_stats = HICPRO_MAPPING.out.mapstats.groupTuple()
.concat(HICPRO_MAPPING.out.pairstats.groupTuple(), // .concat(HICPRO_MAPPING.out.pairstats.groupTuple(),
ch_valid_stats.groupTuple()) // ch_valid_stats.groupTuple())
} //}
MERGE_VALID_INTERACTION ( MERGE_VALID_INTERACTION (
ch_valid_pairs ch_valid_pairs
......
...@@ -30,6 +30,9 @@ workflow INPUT_CHECK { ...@@ -30,6 +30,9 @@ workflow INPUT_CHECK {
.splitCsv ( header:true, sep:',' ) .splitCsv ( header:true, sep:',' )
.map { create_fastq_channels(it) } .map { create_fastq_channels(it) }
.map { it -> [it[0], [it[1], it[2]]]} .map { it -> [it[0], [it[1], it[2]]]}
.groupTuple(by: [0])
.flatMap { it -> setMetaChunk(it) }
.collate(2)
.set { reads } .set { reads }
} }
...@@ -53,3 +56,15 @@ def create_fastq_channels(LinkedHashMap row) { ...@@ -53,3 +56,15 @@ def create_fastq_channels(LinkedHashMap row) {
array = [ meta, file(row.fastq_1), file(row.fastq_2) ] array = [ meta, file(row.fastq_1), file(row.fastq_2) ]
return array return array
} }
// Set the meta.chunk value in case of technical replicates
def setMetaChunk(row){
def map = []
row[1].eachWithIndex() { file,i ->
meta = row[0].clone()
meta.chunks = i
map += [meta, file]
}
return map
}
...@@ -143,16 +143,6 @@ Channel.fromPath( params.fasta ) ...@@ -143,16 +143,6 @@ Channel.fromPath( params.fasta )
// Info required for completion email and summary // Info required for completion email and summary
def multiqc_report = [] def multiqc_report = []
def setMetaChunk(row){
def map = []
row[1].eachWithIndex() { file,i ->
meta = row[0].clone()
meta.chunks = i
map += [meta, file]
}
return map
}
workflow HIC { workflow HIC {
ch_versions = Channel.empty() ch_versions = Channel.empty()
...@@ -163,19 +153,8 @@ workflow HIC { ...@@ -163,19 +153,8 @@ workflow HIC {
INPUT_CHECK ( INPUT_CHECK (
ch_input ch_input
) )
.reads
//.map {
// meta, fastq ->
// meta.id = meta.id.split('_')[0..-2].join('_')
// [ meta, fastq ] }
.groupTuple(by: [0])
.flatMap { it -> setMetaChunk(it) }
.collate(2)
.set { ch_fastq }
ch_fastq.view()
//INPUT_CHECK.out.reads.view() INPUT_CHECK.out.reads.view()
// //
// SUBWORKFLOW: Prepare genome annotation // SUBWORKFLOW: Prepare genome annotation
...@@ -190,7 +169,7 @@ workflow HIC { ...@@ -190,7 +169,7 @@ workflow HIC {
// MODULE: Run FastQC // MODULE: Run FastQC
// //
FASTQC ( FASTQC (
ch_fastq INPUT_CHECK.out.reads
) )
ch_versions = ch_versions.mix(FASTQC.out.versions) ch_versions = ch_versions.mix(FASTQC.out.versions)
...@@ -198,7 +177,7 @@ workflow HIC { ...@@ -198,7 +177,7 @@ workflow HIC {
// SUB-WORFLOW: HiC-Pro // SUB-WORFLOW: HiC-Pro
// //
HICPRO ( HICPRO (
ch_fastq, INPUT_CHECK.out.reads,
PREPARE_GENOME.out.index, PREPARE_GENOME.out.index,
PREPARE_GENOME.out.res_frag, PREPARE_GENOME.out.res_frag,
PREPARE_GENOME.out.chromosome_size, PREPARE_GENOME.out.chromosome_size,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment