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
No related tags found
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
/* ChIPseq pipeline :
* Pipeline that analyses ChIPseq data
* Preprocessing, filtration, alignment, peak calling.
..
* Preprocessing, filtration, alignment, peak calling.
*/
/* Params out */
params
.
fastp_out
=
"$params.project/fastp/"
params
.
index_fasta_out
=
"$params.project/Indexed_genome/"
...
...
@@ -29,12 +28,6 @@ params.chipseq_bam2BW_out = "$params.project/chipseq_BigGig"
log
.
info
"fastq folder : ${params.fastq_folder}"
log
.
info
"genome file : ${params.genome}"
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) {
}
/*
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
.
fromPath
(
params
.
genome
)
.
ifEmpty
{
error
"Cannot find any files matching: ${params.genome}"
}
.
map
{
it
->
[(
it
.
baseName
=~
/([^\.]*)/
)[
0
][
1
],
it
]}
.
set
{
genome_file
}
/*
Channel // IP & CTRL names
.from( params.ctrl )
Channel
.from( params.ip )
*/
/*
if...
Channel
.fromPath( params.idxgenome )
.set { genome_idx }
*/
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
...
...
@@ -140,9 +128,14 @@ include { peak_calling } from "./nf_modules/macs3/main.nf"
workflow
{
//########################## PREPROCESSING ####################
// fastp
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] })
// fastqc_processed
...
...
@@ -155,18 +148,35 @@ 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
)
// index_fasta(genome_file)
// mapping preprocessed reads
mapping_fastq_chipster
(
index_fasta
.
out
.
index
.
collect
(),
fastp_chipster
.
out
.
fastq
)
/*if (params.idxgenome == "") {
// mapping_fastq_chipster(index_fasta.out.index.collect(), fastp_chipster.out.fastq)
// Implementation of indexed genome providing:
if
(!
params
.
idx
)
{
index_fasta
(
genome_file
)
mapping_fastq(index_fasta.out.index.collect(), fastp_default.out.fastq)
} else {
mapping_fastq(genome_idx.collect(), fastp_default.out.fastq)
mapping_fastq_chipster
(
index_fasta
.
out
.
index
.
collect
(),
fastp_chipster
.
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_quality_chipster
(
mapping_fastq_chipster
.
out
.
bam
)
...
...
@@ -177,18 +187,17 @@ workflow {
// samtools_index
index_bam_chipster
(
sort_bam_chipster
.
out
.
bam
)
// Create a bigwig file
// bam_to_bigwig(index_bam.out.bam_idx)
//########################### BIGWIGS ###########################
// Chipseq Bam 2 bigwig file with reads extends
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
}
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
(
peak_calling_channel_in
)
}
/* input:
tuple val(file_id), path(bam_ip), path(bam_control) */
\ No newline at end of file
}
\ 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
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
.from([[1, "fastq1.fq"], [2, "fastq2.fq"], [3, "fastq3.fq"], [4, "fastq4.fq"]])
...
...
@@ -16,4 +25,4 @@ fastq_files.join(sample_names).set{ vals }
vals.combine(vals).filter { it -> (it[2] != it[5]) && (it[2] == "test") }.view() */
println
(
params
.
genome
)
\ No newline at end of file
// println(params.genome)
\ 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