Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hs metrics #313

Open
wants to merge 34 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0b10663
Update methylseq.nf
RogerHw May 7, 2023
2a324ce
Update methylseq.nf
RogerHw May 11, 2023
c4d67d5
Update methylseq.nf
RogerHw May 11, 2023
b978e52
Create collecthsmetrics
RogerHw May 15, 2023
ee479d7
Delete collecthsmetrics
RogerHw May 15, 2023
5033f8d
Update methylseq.nf
RogerHw May 17, 2023
c26e5c0
Update methylseq.nf
RogerHw May 20, 2023
f628c55
Update modules.json
RogerHw May 26, 2023
5cd09c4
Update nextflow.config
RogerHw May 26, 2023
c71c7ff
Update methylseq.nf
RogerHw Jun 1, 2023
6a0d1a4
Update methylseq.nf
RogerHw Jun 1, 2023
0b92210
hs metrics module
RogerHw Jun 1, 2023
d220a24
Create main.nf
RogerHw Jun 1, 2023
57ce5f1
Delete modules/nf-core /picard /collecthsmetrics directory
RogerHw Jun 1, 2023
8c34e86
Create meta.yml
RogerHw Jun 1, 2023
adb0e2c
Delete modules/nf-core/picard/collecths metrics directory
RogerHw Jun 1, 2023
6c18bf5
Create main.nf
RogerHw Jun 1, 2023
d139ddc
Create main.nf
RogerHw Jun 1, 2023
d53b7dd
Create meta.yml
RogerHw Jun 1, 2023
c5d8869
Update methylseq.nf
RogerHw Jun 1, 2023
1c15794
Update methylseq.nf
RogerHw Jun 1, 2023
56126c1
Update methylseq.nf
RogerHw Jun 5, 2023
3441447
Update nextflow_schema.json
RogerHw Jun 5, 2023
914d33a
Update nextflow.config
RogerHw Jun 5, 2023
4c1477b
Update nextflow_schema.json
RogerHw Jun 7, 2023
6b9d062
Update methylseq.nf
RogerHw Jun 7, 2023
ca65020
Update methylseq.nf
RogerHw Jun 7, 2023
c6b9503
Update methylseq.nf
RogerHw Jun 7, 2023
ecd6078
Update methylseq.nf
RogerHw Jun 7, 2023
987cdec
Update methylseq.nf
RogerHw Jun 7, 2023
4bec010
Update methylseq.nf
RogerHw Jun 9, 2023
3cc9e87
Update methylseq.nf
RogerHw Jun 12, 2023
0a71f8b
Update methylseq.nf
RogerHw Jun 13, 2023
f8ae01d
Channels were updated.
RogerHw Jun 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"installed_by": ["modules"]
},
"picard/collecthsmetrics": {
"branch": "master",
"git_sha": "0ce3ab0ac301f160225b22254fa238478b4389f2",
"installed_by": ["modules"]
},
"picard/createsequencedictionary": {
"branch": "master",
"git_sha": "911696ea0b62df80e900ef244d7867d177971f73",
"installed_by": ["modules"]
},
"picard/markduplicates": {
"branch": "master",
"git_sha": "eca65aa4a5e2e192ac44d6962c8f9260f314ffb8",
Expand Down
6 changes: 4 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ params {
multiqc_logo = null
max_multiqc_email_size = '25.MB'
multiqc_methods_description = null



// HS metrics
params.target_intervals = null

// Intermediate files
save_reference = false
save_align_intermeds = false
Expand Down
70 changes: 59 additions & 11 deletions workflows/methylseq.nf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
params.target_interval = null
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VALIDATE INPUTS
Expand All @@ -18,14 +19,15 @@ def checkPathParamList = [
params.bwa_meth_index,
params.bismark_index,
params.known_splices,
params.target_interval
]
for (param in checkPathParamList) { if (param) { file(param, checkIfExists: true) } }

// Check mandatory parameters
if (params.input) { ch_input = file(params.input) } else { exit 1, 'Input samplesheet not specified!' }



// Check if target interval BED file is provided
def targetIntervalProvided = params.target_interval ? true : false

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -68,13 +70,16 @@ else if ( params.aligner == 'bwameth' ){
//
// MODULE: Installed directly from nf-core/modules
//
include { CAT_FASTQ } from '../modules/nf-core/cat/fastq/main'
include { FASTQC } from '../modules/nf-core/fastqc/main'
include { MULTIQC } from '../modules/nf-core/multiqc/main'
include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/custom/dumpsoftwareversions/main'
include { TRIMGALORE } from '../modules/nf-core/trimgalore/main'
include { QUALIMAP_BAMQC } from '../modules/nf-core/qualimap/bamqc/main'
include { PRESEQ_LCEXTRAP } from '../modules/nf-core/preseq/lcextrap/main'
include { CAT_FASTQ } from '../modules/nf-core/cat/fastq/main'
include { FASTQC } from '../modules/nf-core/fastqc/main'
include { MULTIQC } from '../modules/nf-core/multiqc/main'
include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/custom/dumpsoftwareversions/main'
include { TRIMGALORE } from '../modules/nf-core/trimgalore/main'
include { QUALIMAP_BAMQC } from '../modules/nf-core/qualimap/bamqc/main'
include { QUALIMAP_BAMQC as QUALIMAP_BAMQC2 } from '../modules/nf-core/qualimap/bamqc/main'
include { PRESEQ_LCEXTRAP } from '../modules/nf-core/preseq/lcextrap/main'
include { PICARD_MARKDUPLICATES } from '../modules/nf-core/picard/markduplicates/main'
include { PICARD_COLLECTHSMETRICS } from '../modules/nf-core/picard_collecthsmetrics/main'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -137,6 +142,8 @@ workflow METHYLSEQ {
ch_cat_fastq
)
versions = versions.mix(FASTQC.out.versions.first())



/*
* MODULE: Run TrimGalore!
Expand All @@ -154,6 +161,10 @@ workflow METHYLSEQ {
/*
* SUBWORKFLOW: Align reads, deduplicate and extract methylation with Bismark
*/

/*
* SUBWORKFLOW: Align reads, deduplicate and extract methylation with Bismark
*/

// Aligner: bismark or bismark_hisat
if( params.aligner =~ /bismark/ ){
Expand All @@ -172,6 +183,7 @@ workflow METHYLSEQ {
ch_dedup = BISMARK.out.dedup
ch_aligner_mqc = BISMARK.out.mqc
}

// Aligner: bwameth
else if ( params.aligner == 'bwameth' ){

Expand All @@ -187,7 +199,7 @@ workflow METHYLSEQ {
ch_dedup = BWAMETH.out.dedup
ch_aligner_mqc = BWAMETH.out.mqc
}

/*
* MODULE: Qualimap BamQC
*/
Expand All @@ -196,6 +208,22 @@ workflow METHYLSEQ {
[]
)
versions = versions.mix(QUALIMAP_BAMQC.out.versions.first())

// MODULE: PICARD_MARKDUPLICATES

PICARD_MARKDUPLICATES (
PREPARE_GENOME.out.fasta,
PREPARE_GENOME.out.fasta_index
ch_bam
)
versions = versions.mix(PICARD_MARKDUPLICATES.out.versions.first())
ch_dedupm = PICARD_MARKDUPLICATES.out.bam

QUALIMAP_BAMQC2 (
ch_dedupm,
[]
)
versions = versions.mix(QUALIMAP_BAMQC2.out.versions.first())

/*
* MODULE: Run Preseq
Expand All @@ -204,6 +232,25 @@ workflow METHYLSEQ {
ch_bam
)
versions = versions.mix(PRESEQ_LCEXTRAP.out.versions.first())

/*
* MODULE: HS METRICS.
*/
if (targetIntervalProvided){
sateeshperi marked this conversation as resolved.
Show resolved Hide resolved
PICARD_COLLECTHSMETRICS (
ch_bam,
file(params.target_interval)
)
} else {
process warning {
input:
script:
'''
echo "Target interval BED file not provided. HS metrics module will be skipped."
'''
}
ch_bam // Pass the BAM channel directly to the next step without running the HS metrics module
}
sateeshperi marked this conversation as resolved.
Show resolved Hide resolved

CUSTOM_DUMPSOFTWAREVERSIONS (
versions.unique().collectFile(name: 'collated_versions.yml')
Expand All @@ -223,7 +270,8 @@ workflow METHYLSEQ {
ch_multiqc_files = ch_multiqc_files.mix(ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml'))
ch_multiqc_files = ch_multiqc_files.mix(ch_methods_description.collectFile(name: 'methods_description_mqc.yaml'))
ch_multiqc_files = ch_multiqc_files.mix(CUSTOM_DUMPSOFTWAREVERSIONS.out.mqc_yml.collect())
ch_multiqc_files = ch_multiqc_files.mix(QUALIMAP_BAMQC.out.results.collect{ it[1] }.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(QUALIMAP_BAMQC.out.results.collect{ it[0] }.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(QUALIMAP_BAMQC2.out.results.collect{ it[0] }.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(PRESEQ_LCEXTRAP.out.log.collect{ it[1] }.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(ch_aligner_mqc.ifEmpty([]))
if (!params.skip_trimming) {
Expand Down