Commit aee27463 authored by Xavier Grand's avatar Xavier Grand
Browse files

modif pipeline bamcoverage deeptools pour chipseq et paramètres

parent 956fd73f
......@@ -58,6 +58,8 @@ params.bam_to_bigwig_out = "$params.project/BigWig/"
params.peak_calling_bg_out = "$params.project/Peak_calling/"
params.bam_to_bed_out = "$params.project/Bed/"
params.bed_slop_out = "$params.project/Bed_sloped/"
params.bedGraph_out = "$params.project/BedGraph/"
params.chipseq_bam2BG_out = "$params.project/chipseq_BigGig"
/*
****************************************************************
......@@ -148,9 +150,11 @@ include { filter_bam_quality } from "./nf_modules/samtools/main.nf"
include { sort_bam } from "./nf_modules/samtools/main.nf"
include { index_bam } from "./nf_modules/samtools/main.nf"
include { bam_to_bigwig } from "./nf_modules/deeptools/main.nf"
include { chipseq_bam2BG } from "./nf_modules/deeptools/main.nf"
include { peak_calling_bg } from "./nf_modules/macs3/main.nf"
include { bam_to_bed } from "./nf_modules/bedtools/main.nf"
include { bed_slop } from "./nf_modules/bedtools/main.nf"
include { bed_to_bedGraph } from "./nf_modules/bedtools/main.nf"
/*
****************************************************************
......@@ -159,11 +163,12 @@ include { bed_slop } from "./nf_modules/bedtools/main.nf"
*/
workflow {
// fastq_files.view() // Pour voir les fichier qui sont chargés
// fastp
fastp_default(fastq_files)
/*
// fastqc_rawdata
fastqc_raw(fastq_files)
// fastqc_processed
......@@ -175,6 +180,7 @@ workflow {
fastqc_preprocessed.out.report
).collect()
)
*/
// index reference genome
index_fasta(genome_file)
......@@ -196,16 +202,22 @@ workflow {
sort_bam(filter_bam_quality.out.bam)
// samtools_index
// index_bam(sort_bam.out.bam.collect())
index_bam(sort_bam.out.bam)
// Create a bigwig file
// bam_to_bigwig(index_bam.out.bam_idx)
// Chipseq Bam 2 bigwig file with reads extends
chipseq_bam2BG(index_bam.out.bam_idx)
// From Bam to Bed
bam_to_bed(sort_bam.out.bam)
// bam_to_bed(sort_bam.out.bam)
// Extension of reads with bedtools slop
bed_slop(bam_to_bed.out.bed, genome_sizes.collect())
// bed_slop(bam_to_bed.out.bed, genome_sizes.collect())
// From bed to bedgraph
// bed_to_bedGraph(bed_slop.out, genome_sizes.collect())
// peak calling using MACS3 Prend des bed ou des bam en entrée...
// peak_calling_bg()
......
......@@ -168,4 +168,30 @@ bedtools slop -s -r 100 -l 0 \
-g ${chromsizes} \
> ${bed.simpleName}_sloped.bed
"""
}
params.bedGraph = ""
params.bedGraph_out = ""
process bed_to_bedGraph {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "${bed_id}"
if (params.bedGraph_out != "") {
publishDir "results/${params.bedGraph_out}", mode: 'copy'
}
input:
tuple val(bed_id), path(bed)
tuple val(file_id), path(chromsizes)
output:
tuple val(bed_id), path("*.bg"), emit: bedGraph
script:
"""
bedtools genomecov -bg\
-i ${bed} \
-g ${chromsizes} \
> ${bed.simpleName}.bg
"""
}
\ No newline at end of file
......@@ -104,3 +104,30 @@ plotProfile -m ${matrix} \
--plotTitle "${params.title}"
"""
}
params.chipseq_bam2BG = ""
params.chipseq_bam2BG_out = ""
process chipseq_bam2BG {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$file_id"
if (params.chipseq_bam2BG_out != "") {
publishDir "results/${params.chipseq_bam2BG_out}", mode: 'copy'
}
input:
tuple val(file_id), path(bam), path(idx)
output:
tuple val(file_id), path("*.bw"), emit: bw
script:
"""
bamCoverage -p ${task.cpus} -b ${bam} \
--binSize 10 \
--ignoreDuplicates \
--extendReads 200 \
--effectiveGenomeSize 2913022398 \
-o ${bam.simpleName}.bw \
"""
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment