Skip to content

Commit

Permalink
Updated reads/assembly qc channels defs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ge94 committed Dec 4, 2024
1 parent 8fba9f9 commit 0477eeb
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 25 deletions.
3 changes: 2 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ validation {
showHiddenParams = false
help {
enabled = true
command = "nextflow run $manifest.name -profile <docker/singularity/.../institute> --input samplesheet.csv --outdir <OUTDIR>"
// TODO change based on updates in README
command = "nextflow run main.nf -profile <docker/singularity/...> --samplesheet samplesheet.csv --outdir <OUTDIR>"
fullParameter = "help_full"
showHiddenParameter = "show_hidden"
}
Expand Down
10 changes: 5 additions & 5 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "ebi-metagenomics/miassembler pipeline parameters",
"description": "Microbiome Informatics metagenomes assembly pipeline",
"type": "object",
"$defs": {
"defs": {
"input_output_options": {
"title": "Input/output options",
"type": "object",
Expand Down Expand Up @@ -349,16 +349,16 @@
},
"allOf": [
{
"$ref": "#/$defs/input_output_options"
"$ref": "#/defs/input_output_options"
},
{
"$ref": "#/$defs/reads_qc"
"$ref": "#/defs/reads_qc"
},
{
"$ref": "#/$defs/max_job_request_options"
"$ref": "#/defs/max_job_request_options"
},
{
"$ref": "#/$defs/generic_options"
"$ref": "#/defs/generic_options"
}
]
}
6 changes: 4 additions & 2 deletions subworkflows/local/long_reads_assembly_qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ workflow LONG_READS_ASSEMBLY_QC {
main:

def ch_versions = Channel.empty()
def human_reference = Channel.empty()
def host_reference = Channel.empty()
def decontaminated_assembly = assembly

if ( params.remove_human ) {
def human_reference = Channel.fromPath(
human_reference = Channel.fromPath(
"${params.reference_genomes_folder}/${params.human_fasta_prefix}.fna", checkIfExists: true)
.collect().map {
files -> [ ["id": params.human_fasta_prefix], files ]
Expand All @@ -38,7 +40,7 @@ workflow LONG_READS_ASSEMBLY_QC {

if ( reference_genome != null ) {

def host_reference = Channel.fromPath( "${params.reference_genomes_folder}/${reference_genome}*", checkIfExists: true)
host_reference = Channel.fromPath( "${params.reference_genomes_folder}/${reference_genome}*", checkIfExists: true)
.collect().map {
files -> [ ["id": reference_genome], files ]
}
Expand Down
6 changes: 4 additions & 2 deletions subworkflows/local/long_reads_qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ workflow LONG_READS_QC {

main:
def ch_versions = Channel.empty()
def human_reference = Channel.empty()
def host_reference = Channel.empty()

FASTP_LR(
input_reads,
Expand Down Expand Up @@ -45,7 +47,7 @@ workflow LONG_READS_QC {
// can we use the same flag, even if one has phix but not the other?
// Check file extensions too

def human_reference = Channel.fromPath( "${params.reference_genomes_folder}/${params.human_fasta_prefix}.fna", checkIfExists: true)
human_reference = Channel.fromPath( "${params.reference_genomes_folder}/${params.human_fasta_prefix}.fna", checkIfExists: true)
.collect().map {
files -> [ ["id": params.human_fasta_prefix], files ]
}
Expand Down Expand Up @@ -73,7 +75,7 @@ workflow LONG_READS_QC {

if ( reference_genome != null ) {

def host_reference = Channel.fromPath( "${params.reference_genomes_folder}/${reference_genome}*", checkIfExists: true)
host_reference = Channel.fromPath( "${params.reference_genomes_folder}/${reference_genome}*", checkIfExists: true)
.collect().map {
files -> [ ["id": reference_genome], files ]
}
Expand Down
22 changes: 12 additions & 10 deletions subworkflows/local/short_reads_assembly_qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ workflow SHORT_READS_ASSEMBLY_QC {
main:

def ch_versions = Channel.empty()
def ch_blast_human_phix_refs = Channel.empty()
def ch_blast_host_refs = Channel.empty()

/* Len filter using the parameter "short_reads_min_contig_length" */
SEQKIT_SEQ(
Expand All @@ -35,11 +37,11 @@ workflow SHORT_READS_ASSEMBLY_QC {

ch_versions = ch_versions.mix(SEQKIT_SEQ.out.versions)

def filtered_contigs = SEQKIT_SEQ.out.fastx
def cleaned_contigs = SEQKIT_SEQ.out.fastx

if ( params.remove_human_phix ) {

def ch_blast_human_phix_refs = Channel.fromPath( "${params.blast_reference_genomes_folder}/${params.human_phix_blast_index_name}*", checkIfExists: true)
ch_blast_human_phix_refs = Channel.fromPath( "${params.blast_reference_genomes_folder}/${params.human_phix_blast_index_name}*", checkIfExists: true)
.collect().map {
files -> [ ["id": params.human_phix_blast_index_name], files ]
}
Expand All @@ -52,42 +54,42 @@ workflow SHORT_READS_ASSEMBLY_QC {
ch_versions = ch_versions.mix(BLAST_BLASTN_HUMAN_PHIX.out.versions.first())

SEQKIT_GREP_HUMAN_PHIX(
filtered_contigs.join( BLAST_BLASTN_HUMAN_PHIX.out.txt )
cleaned_contigs.join( BLAST_BLASTN_HUMAN_PHIX.out.txt )
)

filtered_contigs = SEQKIT_GREP_HUMAN_PHIX.out.filter
cleaned_contigs = SEQKIT_GREP_HUMAN_PHIX.out.filter

ch_versions = ch_versions.mix(SEQKIT_GREP_HUMAN_PHIX.out.versions)
}

if ( reference_genome != null ) {

def ch_blast_host_refs = Channel.fromPath( "${params.blast_reference_genomes_folder}/${reference_genome}*", checkIfExists: true)
ch_blast_host_refs = Channel.fromPath( "${params.blast_reference_genomes_folder}/${reference_genome}*", checkIfExists: true)
.collect().map {
files -> [ ["id": reference_genome], files ]
}

BLAST_BLASTN_HOST(
filtered_contigs,
cleaned_contigs,
ch_blast_host_refs
)

ch_versions = ch_versions.mix(BLAST_BLASTN_HOST.out.versions.first())

SEQKIT_GREP_HOST(
filtered_contigs.join( BLAST_BLASTN_HOST.out.txt )
cleaned_contigs.join( BLAST_BLASTN_HOST.out.txt )
)

filtered_contigs = SEQKIT_GREP_HOST.out.filter
cleaned_contigs = SEQKIT_GREP_HOST.out.filter

ch_versions = ch_versions.mix(SEQKIT_GREP_HOST.out.versions)
}

PUBLISH_CLEANED_CONTIGS(
filtered_contigs
cleaned_contigs
)

emit:
filtered_contigs = filtered_contigs
filtered_contigs = cleaned_contigs
versions = ch_versions
}
6 changes: 4 additions & 2 deletions subworkflows/local/short_reads_qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ workflow SHORT_READS_QC {

main:
def ch_versions = Channel.empty()
def ch_bwamem2_human_phix_refs = Channel.empty()
def ch_bwamem2_host_refs = Channel.empty()

FASTP(
reads,
Expand All @@ -26,7 +28,7 @@ workflow SHORT_READS_QC {

if ( params.remove_human_phix ) {

def ch_bwamem2_human_phix_refs = Channel.fromPath( "${params.bwamem2_reference_genomes_folder}/${params.human_phix_blast_index_name}*", checkIfExists: true)
ch_bwamem2_human_phix_refs = Channel.fromPath( "${params.bwamem2_reference_genomes_folder}/${params.human_phix_blast_index_name}*", checkIfExists: true)
.collect().map {
files -> [ ["id": params.human_phix_blast_index_name], files ]
}
Expand All @@ -46,7 +48,7 @@ workflow SHORT_READS_QC {

if ( reference_genome != null ) {

def ch_bwamem2_host_refs = Channel.fromPath( "${params.bwamem2_reference_genomes_folder}/${reference_genome}*", checkIfExists: true)
ch_bwamem2_host_refs = Channel.fromPath( "${params.bwamem2_reference_genomes_folder}/${reference_genome}*", checkIfExists: true)
.collect().map {
files -> [ ["id": reference_genome], files ]
}
Expand Down
2 changes: 1 addition & 1 deletion workflows/miassembler.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

include { validateParameters; paramsSummaryLog; paramsSummaryMap; samplesheetToList; paramsHelp } from 'plugin/nf-schema@2.0.0'
include { validateParameters; paramsSummaryLog; paramsSummaryMap; samplesheetToList; paramsHelp } from 'plugin/nf-schema'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 0 additions & 2 deletions workflows/short_reads_assembler.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// SUBWORKFLOW: Consisting of a mix of local and nf-core/modules
//

include { DOWNLOAD_FROM_FIRE } from '../modules/local/download_from_fire.nf'

include { SHORT_READS_QC } from '../subworkflows/local/short_reads_qc'
include { SHORT_READS_ASSEMBLY_QC } from '../subworkflows/local/short_reads_assembly_qc'
include { SHORT_READS_ASSEMBLY_COVERAGE } from '../subworkflows/local/short_reads_assembly_coverage'
Expand Down

0 comments on commit 0477eeb

Please sign in to comment.