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

Prepare genome subworkflow #84

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 12 additions & 4 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ process {
]
}

withName: "WINDOWMASKER_MKCOUNTS" {
ext.args = "-infmt fasta -sformat obinary"
}

withName: "WINDOWMASKER_USTAT" {
ext.args = "-infmt fasta -dust T -outfmt fasta"
}

withName: "MINIMAP2_HIC" {
ext.args = "-ax sr"
}
Expand All @@ -40,6 +48,10 @@ process {
ext.args = "-ax map-ont"
}

withName: "SAMTOOLS_VIEW" {
ext.args = "--output-fmt bam --write-index"
}

withName: "SAMTOOLS_INDEX" {
ext.args = "-c"
}
Expand All @@ -48,10 +60,6 @@ process {
ext.args = "--lineage --busco"
}

withName: "SAMTOOLS_VIEW" {
ext.args = "--output-fmt bam --write-index"
}

withName: "BUSCO" {
scratch = true
// Overridden in the test profile, see at the end of this file
Expand Down
10 changes: 10 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@
"branch": "master",
"git_sha": "3ffae3598260a99e8db3207dead9f73f87f90d1f",
"installed_by": ["modules"]
},
"windowmasker/mkcounts": {
"branch": "master",
"git_sha": "30c3ed32e8bd5ddaf349ba2f4f99d38182fdc08c",
"installed_by": ["modules"]
},
"windowmasker/ustat": {
"branch": "master",
"git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc",
"installed_by": ["modules"]
}
}
},
Expand Down
55 changes: 55 additions & 0 deletions modules/nf-core/windowmasker/mkcounts/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions modules/nf-core/windowmasker/mkcounts/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 69 additions & 0 deletions modules/nf-core/windowmasker/ustat/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions modules/nf-core/windowmasker/ustat/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ params {
input = null
yaml = null
align = false
mask = false

// Reference options
fasta = null
Expand Down
8 changes: 7 additions & 1 deletion nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@
},
"align": {
"type": "boolean",
"description": "Boolean to turn on optional alignment before running the rest of the pipeline."
"description": "Turn on optional alignment before running the rest of the pipeline.",
"fa_icon": "fas fa-toggle-off"
},
"mask": {
"type": "boolean",
"description": "Turn on optional genome masking if needed.",
"fa_icon": "fas fa-toggle-off"
},
"yaml": {
"type": "string",
Expand Down
49 changes: 49 additions & 0 deletions subworkflows/local/prepare_genome.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//
// Prepare genome for downstream processing
//

include { GUNZIP } from '../../modules/nf-core/gunzip/main'
include { WINDOWMASKER_MKCOUNTS } from '../../modules/nf-core/windowmasker/mkcounts/main'
include { WINDOWMASKER_USTAT } from '../../modules/nf-core/windowmasker/ustat/main'


workflow PREPARE_GENOME {
take:
fasta // channel: [ meta, path(genome) ]


main:
ch_versions = Channel.empty()


//
// MODULE: Decompress FASTA file if needed
//
if ( params.fasta.endsWith('.gz') ) {
ch_genome = GUNZIP ( fasta ).gunzip
ch_versions = ch_versions.mix ( GUNZIP.out.versions )
} else {
ch_genome = fasta
}


//
// MODULES: Mask the genome if needed
//
if ( params.mask ) {
WINDOWMASKER_MKCOUNTS ( ch_genome )
ch_versions = ch_versions.mix ( WINDOWMASKER_MKCOUNTS.out.versions )

WINDOWMASKER_USTAT ( WINDOWMASKER_MKCOUNTS.out.counts, ch_genome )
ch_versions = ch_versions.mix ( WINDOWMASKER_USTAT.out.versions )

ch_fasta = WINDOWMASKER_USTAT.out.intervals
} else {
ch_fasta = ch_genome
}


emit:
genome = ch_fasta // channel: [ meta, path(genome) ]
versions = ch_versions // channel: [ versions.yml ]
}
Loading