Commit 0634832a authored by Xavier Grand's avatar Xavier Grand
Browse files

Version fonctionnelle Hg19 uniquement

parent 755aa98c
# A row defines some features to describe a sample to analyse.
# You can add as many row as you want below each other. Be sure that
# the name of the row is the same as the file name witout extension.
# boolean value to setup sequencing type (paired-end or single-end)
# true or false
paired_end: false
# directory containing fastq files (rawdata)
fastq_folder: "/home/adminxavier/CTCF/fastq/"
# the genome of interest (fasta file)
genome: "/home/adminxavier/CTCF/Ref/genomeindex/genome.fasta"
# A file containing chromosome sizes (usualy "chrom.sizes" file)
chrom_sizes: "/home/adminxavier/CTCF/Ref/genomeindex/sizes.genome"
# Does the genome is allready indexed with bowtie2 ?
# directory containing indexed genome files or ""
idx: "/home/adminxavier/CTCF/Ref/genomeindex/"
# output folder under results/ directory
project: "CTCF_peak_calling_input_Genome"
input:
row1:
# sample must be a string. It corresponds to the name of the sample
sample: "5Y_Ctrl_DDX5"
# fastq is the corresponding fastq file, can be compressed as gz file.
fastq: "5Y_Ctrl_DDX5.fastq.gz"
# condition
condition: "Ctrl"
# type is related to ChIP type: Input or IP
type: "IP"
#row2:
# sample: "5Y_Ctrl_input"
# fastq: "5Y_Ctrl_input.fastq.gz"
# condition: "Ctrl"
# type: "Input"
# Under construction:
# Organism (hg19, GRCH38, HBV...) default hg19 for FasterDB compatibility
# organism: ""
\ No newline at end of file
......@@ -50,7 +50,6 @@ if (params.paired_end) {
.ifEmpty { error "No fastq file defined" }
.set { fastq_files }
Channel
.from( params.input.collect { k, v -> v.sample })
.ifEmpty { error "No sample names given" }
......@@ -65,41 +64,14 @@ if (params.paired_end) {
.from( params.input.collect { k, v -> v.type })
.ifEmpty { error "No sample types defined" }
.set { sample_types }
}
Channel
.fromPath( params.genome )
.ifEmpty { error "Cannot find any files matching: ${params.genome}" }
.map{it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { genome_file }
Channel
.fromPath( params.chrom_sizes )
.ifEmpty { error "Cannot find any files matching: ${params.chrom_sizes}" }
.map{it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set{ genome_sizes }
/*
if (params.idx != "") {
Channel
.fromPath( "${params.genome}/*.index.*" )
.ifEmpty { error "Cannot find idexed genome reference files matching: ${params.idx}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], [it] ]}
.set { index_fasta.out.index }
tuple val(file_id), path("*.index*"), emit: index
}
else {
Channel
.fromPath( params.genome )
.ifEmpty { error "Cannot find any files matching: ${params.genome}" }
.map{it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { genome_file }
}
*/
/*
****************************************************************
Imports
......@@ -134,7 +106,6 @@ workflow {
fastp_chipster(fastq_files, sample_names, condition_names, sample_types)
//########################## QUALITY CHECKS ###################
/*
// fastqc_rawdata
fastqc_raw(fastq_files.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it] })
......@@ -148,21 +119,15 @@ workflow {
).collect()
)
*/
//############ GENOME INDEXATION AND MAPPING ###################
// Genome indexation and Mapping in two steps, genome is indexed every run...
// index reference genome
// index_fasta(genome_file)
// mapping preprocessed reads
// mapping_fastq_chipster(index_fasta.out.index.collect(), fastp_chipster.out.fastq)
// Implementation of indexed genome providing:
if (! params.idx) {
Channel
.fromPath( params.genome )
.ifEmpty { error "Cannot find any files matching: ${params.genome}" }
.map{it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { genome_file }
index_fasta(genome_file)
mapping_fastq_chipster(index_fasta.out.index.collect(), fastp_chipster.out.fastq)
}
......@@ -171,12 +136,12 @@ workflow {
Channel
.fromPath( idx_genome )
.ifEmpty { error "Cannot find idexed genome reference files" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it ]}.groupTuple().view()
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it ]}.groupTuple()
.set { genome_indexed_input }
mapping_fastq_chipster(genome_indexed_input.collect(), fastp_chipster.out.fastq)
}
//############ MAPPING FILTERING, INDEXING, SORTING ##############
//############### FILTERING, INDEXING, SORTING ##################
// filter bam - remove reads with quality <30
filter_bam_quality_chipster(mapping_fastq_chipster.out.bam)
......
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