-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
last subworkflow for now; will likely move chimera removal into anoth…
…er one at a later point
- Loading branch information
Showing
10 changed files
with
167 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,66 @@ | ||
// TODO nf-core: If in doubt look at other nf-core/subworkflows to see how we are doing things! :) | ||
// https://github.com/nf-core/modules/tree/master/subworkflows | ||
// You can also ask for help via your pull request or on the #subworkflows channel on the nf-core Slack workspace: | ||
// https://nf-co.re/join | ||
// TODO nf-core: A subworkflow SHOULD import at least two modules | ||
|
||
include { SAMTOOLS_SORT } from '../../../modules/nf-core/samtools/sort/main' | ||
include { SAMTOOLS_INDEX } from '../../../modules/nf-core/samtools/index/main' | ||
include { BIOM } from '../../modules/local/biom' | ||
include { QIIME2_FEATURETABLE } from '../../modules/local/qiime2featuretable' | ||
include { QIIME2_TAXTABLE } from '../../modules/local/qiime2taxtable' | ||
include { QIIME2_SEQUENCE } from '../../modules/local/qiime2seqs' | ||
include { QIIME2_ALIGNMENT } from '../../modules/local/qiime2aln' | ||
include { QIIME2_TREE } from '../../modules/local/qiime2tree' | ||
include { SESSION_INFO } from '../../modules/local/rsessioninfo' | ||
|
||
workflow GENERATE_OUTPUT { | ||
|
||
// TODO: I'd like to have this simply be TSV files (no RDS) | ||
// so we can generate from other subworkflows if needed | ||
take: | ||
// TODO nf-core: edit input (take) channels | ||
ch_bam // channel: [ val(meta), [ bam ] ] | ||
seq_table_rds | ||
seq_table_qiime | ||
tax_table_rds | ||
tax_table_tsv | ||
asvs | ||
alignment | ||
unrooted_tree | ||
rooted_tree | ||
|
||
main: | ||
|
||
ch_versions = Channel.empty() | ||
|
||
// TODO nf-core: substitute modules here for the modules of your subworkflow | ||
if (params.to_BIOM) { | ||
BIOM( | ||
seq_table_rds, | ||
tax_table_rds | ||
) | ||
} | ||
|
||
SAMTOOLS_SORT ( ch_bam ) | ||
ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions.first()) | ||
if (params.to_QIIME2) { | ||
QIIME2_FEATURETABLE( | ||
seq_table_qiime | ||
) | ||
|
||
SAMTOOLS_INDEX ( SAMTOOLS_SORT.out.bam ) | ||
ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first()) | ||
QIIME2_TAXTABLE( | ||
tax_table_tsv | ||
) | ||
|
||
emit: | ||
// TODO nf-core: edit emitted channels | ||
bam = SAMTOOLS_SORT.out.bam // channel: [ val(meta), [ bam ] ] | ||
bai = SAMTOOLS_INDEX.out.bai // channel: [ val(meta), [ bai ] ] | ||
csi = SAMTOOLS_INDEX.out.csi // channel: [ val(meta), [ csi ] ] | ||
QIIME2_SEQUENCE( | ||
asvs | ||
) | ||
|
||
if (!params.skip_alignment) { | ||
QIIME2_ALIGNMENT( | ||
alignment | ||
) | ||
} | ||
|
||
if (!params.skip_tree) { | ||
QIIME2_TREE( | ||
unrooted_tree, | ||
rooted_tree | ||
) | ||
} | ||
} | ||
|
||
// TODO: May become redundant with versions | ||
SESSION_INFO() | ||
|
||
emit: | ||
versions = ch_versions // channel: [ versions.yml ] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,49 @@ | ||
// TODO nf-core: If in doubt look at other nf-core/subworkflows to see how we are doing things! :) | ||
// https://github.com/nf-core/modules/tree/master/subworkflows | ||
// You can also ask for help via your pull request or on the #subworkflows channel on the nf-core Slack workspace: | ||
// https://nf-co.re/join | ||
// TODO nf-core: A subworkflow SHOULD import at least two modules | ||
|
||
include { SAMTOOLS_SORT } from '../../../modules/nf-core/samtools/sort/main' | ||
include { SAMTOOLS_INDEX } from '../../../modules/nf-core/samtools/index/main' | ||
include { DECIPHER } from '../../modules/local/decipher' | ||
include { PHANGORN } from '../../modules/local/phangorn' | ||
include { FASTTREE } from '../../modules/local/fasttree' | ||
include { ROOT_TREE } from '../../modules/local/roottree' | ||
|
||
workflow PHYLOGENY { | ||
|
||
take: | ||
// TODO nf-core: edit input (take) channels | ||
ch_bam // channel: [ val(meta), [ bam ] ] | ||
asvs | ||
|
||
main: | ||
|
||
ch_alignment = Channel.empty() | ||
ch_unrooted_tree = Channel.empty() | ||
ch_rooted_tree = Channel.empty() | ||
ch_versions = Channel.empty() | ||
|
||
// TODO nf-core: substitute modules here for the modules of your subworkflow | ||
|
||
SAMTOOLS_SORT ( ch_bam ) | ||
ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions.first()) | ||
|
||
SAMTOOLS_INDEX ( SAMTOOLS_SORT.out.bam ) | ||
ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first()) | ||
if (!params.skip_alignment) { | ||
DECIPHER( | ||
asvs | ||
) | ||
ch_alignment = DECIPHER.out.alignment | ||
if (!params.skip_tree) { | ||
if (params.phylo_tool == 'phangorn') { | ||
PHANGORN( | ||
ch_alignment | ||
) | ||
ch_unrooted_tree = PHANGORN.out.treeGTR | ||
} else if (params.phylo_tool == 'fasttree') { | ||
FASTTREE( | ||
ch_alignment | ||
) | ||
ch_unrooted_tree = FASTTREE.out.treeGTR | ||
} | ||
|
||
ROOT_TREE( | ||
ch_unrooted_tree, | ||
params.phylo_tool | ||
) | ||
ch_rooted_tree = ROOT_TREE.out.rooted_tree | ||
} | ||
} | ||
|
||
emit: | ||
// TODO nf-core: edit emitted channels | ||
bam = SAMTOOLS_SORT.out.bam // channel: [ val(meta), [ bam ] ] | ||
bai = SAMTOOLS_INDEX.out.bai // channel: [ val(meta), [ bai ] ] | ||
csi = SAMTOOLS_INDEX.out.csi // channel: [ val(meta), [ csi ] ] | ||
|
||
versions = ch_versions // channel: [ versions.yml ] | ||
ch_alignment | ||
ch_unrooted_tree | ||
ch_rooted_tree | ||
versions = ch_versions // channel: [ versions.yml ] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,30 @@ | ||
// TODO nf-core: If in doubt look at other nf-core/subworkflows to see how we are doing things! :) | ||
// https://github.com/nf-core/modules/tree/master/subworkflows | ||
// You can also ask for help via your pull request or on the #subworkflows channel on the nf-core Slack workspace: | ||
// https://nf-co.re/join | ||
// TODO nf-core: A subworkflow SHOULD import at least two modules | ||
include { READ_TRACKING } from '../../modules/local/readtracking' | ||
include { PLOT_MERGED_HEATMAP } from '../../modules/local/plotmerged' | ||
include { PLOT_ASV_DIST } from '../../modules/local/plotasvlen' | ||
|
||
include { SAMTOOLS_SORT } from '../../../modules/nf-core/samtools/sort/main' | ||
include { SAMTOOLS_INDEX } from '../../../modules/nf-core/samtools/index/main' | ||
|
||
workflow QUALITYCONTROL { | ||
workflow QUALITY_CONTROL { | ||
|
||
take: | ||
// TODO nf-core: edit input (take) channels | ||
ch_bam // channel: [ val(meta), [ bam ] ] | ||
ch_readtracking | ||
merged_seqs | ||
filtered_seqtable | ||
|
||
main: | ||
|
||
ch_versions = Channel.empty() | ||
|
||
// TODO nf-core: substitute modules here for the modules of your subworkflow | ||
READ_TRACKING( | ||
ch_readtracking.collect() | ||
) | ||
|
||
SAMTOOLS_SORT ( ch_bam ) | ||
ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions.first()) | ||
PLOT_MERGED_HEATMAP( | ||
merged_seqs | ||
) | ||
|
||
SAMTOOLS_INDEX ( SAMTOOLS_SORT.out.bam ) | ||
ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first()) | ||
PLOT_ASV_DIST( | ||
filtered_seqtable | ||
) | ||
|
||
emit: | ||
// TODO nf-core: edit emitted channels | ||
bam = SAMTOOLS_SORT.out.bam // channel: [ val(meta), [ bam ] ] | ||
bai = SAMTOOLS_INDEX.out.bai // channel: [ val(meta), [ bai ] ] | ||
csi = SAMTOOLS_INDEX.out.csi // channel: [ val(meta), [ csi ] ] | ||
|
||
versions = ch_versions // channel: [ versions.yml ] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.