Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ChIPster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xavier Grand
ChIPster
Commits
755aa98c
Commit
755aa98c
authored
3 years ago
by
Xavier Grand
Browse files
Options
Downloads
Patches
Plain Diff
Ajout de la possibilite de renseigner un génome deja indexe
parent
8e6edae0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/chipster.nf
+56
-47
56 additions, 47 deletions
src/chipster.nf
src/test.nf
+10
-1
10 additions, 1 deletion
src/test.nf
with
66 additions
and
48 deletions
src/chipster.nf
+
56
−
47
View file @
755aa98c
...
@@ -4,10 +4,9 @@ nextflow.enable.dsl=2
...
@@ -4,10 +4,9 @@ nextflow.enable.dsl=2
/* ChIPseq pipeline :
/* ChIPseq pipeline :
* Pipeline that analyses ChIPseq data
* Pipeline that analyses ChIPseq data
* Preprocessing, filtration, alignment, peak calling.
..
* Preprocessing, filtration, alignment, peak calling.
*/
*/
/* Params out */
/* Params out */
params
.
fastp_out
=
"$params.project/fastp/"
params
.
fastp_out
=
"$params.project/fastp/"
params
.
index_fasta_out
=
"$params.project/Indexed_genome/"
params
.
index_fasta_out
=
"$params.project/Indexed_genome/"
...
@@ -29,12 +28,6 @@ params.chipseq_bam2BW_out = "$params.project/chipseq_BigGig"
...
@@ -29,12 +28,6 @@ params.chipseq_bam2BW_out = "$params.project/chipseq_BigGig"
log
.
info
"fastq folder : ${params.fastq_folder}"
log
.
info
"fastq folder : ${params.fastq_folder}"
log
.
info
"genome file : ${params.genome}"
log
.
info
"genome file : ${params.genome}"
log
.
info
"genome sizes : ${params.chrom_sizes}"
log
.
info
"genome sizes : ${params.chrom_sizes}"
/* log.info "indexed genome file : ${params.idxgenome}" */
/*
log.info "paired-end data: ${params.paired_end}"
log.info "output folder results/${params.folder}"
*/
/*
/*
****************************************************************
****************************************************************
...
@@ -75,43 +68,38 @@ if (params.paired_end) {
...
@@ -75,43 +68,38 @@ if (params.paired_end) {
}
}
/*
if (params.idx != "") {
Channel
.fromPath( params.idx )
.ifEmpty { error "Cannot find idexed genome reference files matching: ${params.idx}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], [it] ]}
.set { index_fasta.out }
}
*/
Channel
Channel
.
fromPath
(
params
.
genome
)
.
fromPath
(
params
.
genome
)
.
ifEmpty
{
error
"Cannot find any files matching: ${params.genome}"
}
.
ifEmpty
{
error
"Cannot find any files matching: ${params.genome}"
}
.
map
{
it
->
[(
it
.
baseName
=~
/([^\.]*)/
)[
0
][
1
],
it
]}
.
map
{
it
->
[(
it
.
baseName
=~
/([^\.]*)/
)[
0
][
1
],
it
]}
.
set
{
genome_file
}
.
set
{
genome_file
}
/*
Channel // IP & CTRL names
.from( params.ctrl )
Channel
.from( params.ip )
*/
/*
if...
Channel
.fromPath( params.idxgenome )
.set { genome_idx }
*/
Channel
Channel
.
fromPath
(
params
.
chrom_sizes
)
.
fromPath
(
params
.
chrom_sizes
)
.
ifEmpty
{
error
"Cannot find any files matching: ${params.chrom_sizes}"
}
.
ifEmpty
{
error
"Cannot find any files matching: ${params.chrom_sizes}"
}
.
map
{
it
->
[(
it
.
baseName
=~
/([^\.]*)/
)[
0
][
1
],
it
]}
.
map
{
it
->
[(
it
.
baseName
=~
/([^\.]*)/
)[
0
][
1
],
it
]}
.
set
{
genome_sizes
}
.
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
Imports
...
@@ -140,9 +128,14 @@ include { peak_calling } from "./nf_modules/macs3/main.nf"
...
@@ -140,9 +128,14 @@ include { peak_calling } from "./nf_modules/macs3/main.nf"
workflow
{
workflow
{
//########################## PREPROCESSING ####################
// fastp
// fastp
fastp_chipster
(
fastq_files
,
sample_names
,
condition_names
,
sample_types
)
fastp_chipster
(
fastq_files
,
sample_names
,
condition_names
,
sample_types
)
//########################## QUALITY CHECKS ###################
/*
// fastqc_rawdata
// fastqc_rawdata
fastqc_raw(fastq_files.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it] })
fastqc_raw(fastq_files.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it] })
// fastqc_processed
// fastqc_processed
...
@@ -155,18 +148,35 @@ workflow {
...
@@ -155,18 +148,35 @@ workflow {
).collect()
).collect()
)
)
*/
//############ GENOME INDEXATION AND MAPPING ###################
// Genome indexation and Mapping in two steps, genome is indexed every run...
// index reference genome
// index reference genome
index_fasta
(
genome_file
)
// index_fasta(genome_file)
// mapping preprocessed reads
// mapping preprocessed reads
mapping_fastq_chipster
(
index_fasta
.
out
.
index
.
collect
(),
fastp_chipster
.
out
.
fastq
)
// mapping_fastq_chipster(index_fasta.out.index.collect(), fastp_chipster.out.fastq)
/*if (params.idxgenome == "") {
// Implementation of indexed genome providing:
if
(!
params
.
idx
)
{
index_fasta
(
genome_file
)
index_fasta
(
genome_file
)
mapping_fastq(index_fasta.out.index.collect(), fastp_default.out.fastq)
mapping_fastq_chipster
(
index_fasta
.
out
.
index
.
collect
(),
fastp_chipster
.
out
.
fastq
)
} else {
mapping_fastq(genome_idx.collect(), fastp_default.out.fastq)
}
}
*/
else
{
idx_genome
=
"${params.idx}*.bt2"
Channel
.
fromPath
(
idx_genome
)
.
ifEmpty
{
error
"Cannot find idexed genome reference files"
}
.
map
{
it
->
[(
it
.
baseName
=~
/([^\.]*)/
)[
0
][
1
],
it
]}.
groupTuple
().
view
()
.
set
{
genome_indexed_input
}
mapping_fastq_chipster
(
genome_indexed_input
.
collect
(),
fastp_chipster
.
out
.
fastq
)
}
//############ MAPPING FILTERING, INDEXING, SORTING ##############
// filter bam - remove reads with quality <30
// filter bam - remove reads with quality <30
filter_bam_quality_chipster
(
mapping_fastq_chipster
.
out
.
bam
)
filter_bam_quality_chipster
(
mapping_fastq_chipster
.
out
.
bam
)
...
@@ -177,18 +187,17 @@ workflow {
...
@@ -177,18 +187,17 @@ workflow {
// samtools_index
// samtools_index
index_bam_chipster
(
sort_bam_chipster
.
out
.
bam
)
index_bam_chipster
(
sort_bam_chipster
.
out
.
bam
)
// Create a bigwig file
//########################### BIGWIGS ###########################
// bam_to_bigwig(index_bam.out.bam_idx)
// Chipseq Bam 2 bigwig file with reads extends
// Chipseq Bam 2 bigwig file with reads extends
chipseq_bam2BW_chipster
(
index_bam_chipster
.
out
.
bam_idx
)
chipseq_bam2BW_chipster
(
index_bam_chipster
.
out
.
bam_idx
)
//######################## PEAK CALLING #########################
// IP and Input samples identification and Channel creation
index_bam_chipster
.
out
.
bam_idx
.
groupTuple
(
by:
3
).
set
{
combined_bams
}
index_bam_chipster
.
out
.
bam_idx
.
groupTuple
(
by:
3
).
set
{
combined_bams
}
combined_bams
.
map
{
it
->
if
(
it
[
4
][
0
]
==
'IP'
)
{
[
it
[
3
],
it
[
1
][
0
],
it
[
1
][
1
]]
}
else
{[
it
[
3
],
it
[
1
][
1
],
it
[
1
][
0
]]}
}.
set
{
peak_calling_channel_in
}
combined_bams
.
map
{
it
->
if
(
it
[
4
][
0
]
==
'IP'
)
{
[
it
[
3
],
it
[
1
][
0
],
it
[
1
][
1
]]
}
else
{[
it
[
3
],
it
[
1
][
1
],
it
[
1
][
0
]]}
}.
set
{
peak_calling_channel_in
}
// peak calling using MACS3 Prend des bed ou des bam en entrée...
// peak calling using MACS3 Prend des bed ou des bam en entrée...
peak_calling
(
peak_calling_channel_in
)
peak_calling
(
peak_calling_channel_in
)
}
}
\ No newline at end of file
/* input:
tuple val(file_id), path(bam_ip), path(bam_control) */
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/test.nf
+
10
−
1
View file @
755aa98c
nextflow
.
enable
.
dsl
=
2
nextflow
.
enable
.
dsl
=
2
idx_genome
=
"${params.idx}*.bt2"
Channel
.
fromPath
(
idx_genome
)
.
ifEmpty
{
error
"Cannot find idexed genome reference files"
}
.
map
{
it
->
[(
it
.
baseName
=~
/([^\.]*)/
)[
0
][
1
],
it
]}.
groupTuple
()
.
set
{
genome_indexed_input
}
genome_indexed_input
.
view
()
/* Channel
/* Channel
.from([[1, "fastq1.fq"], [2, "fastq2.fq"], [3, "fastq3.fq"], [4, "fastq4.fq"]])
.from([[1, "fastq1.fq"], [2, "fastq2.fq"], [3, "fastq3.fq"], [4, "fastq4.fq"]])
...
@@ -16,4 +25,4 @@ fastq_files.join(sample_names).set{ vals }
...
@@ -16,4 +25,4 @@ fastq_files.join(sample_names).set{ vals }
vals.combine(vals).filter { it -> (it[2] != it[5]) && (it[2] == "test") }.view() */
vals.combine(vals).filter { it -> (it[2] != it[5]) && (it[2] == "test") }.view() */
println
(
params
.
genome
)
// println(params.genome)
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment