diff --git a/modules.json b/modules.json index 0be94e8..2889c09 100644 --- a/modules.json +++ b/modules.json @@ -5,25 +5,40 @@ "https://github.com/nf-core/modules.git": { "modules": { "nf-core": { + "blast/blastp": { + "branch": "master", + "git_sha": "6330227ba2a71d39f35b0ef60e381f456489c6ee", + "installed_by": [ + "modules" + ] + }, "falco": { "branch": "master", "git_sha": "41dfa3f7c0ffabb96a6a813fe321c6d1cc5b6e46", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "fastp": { "branch": "master", "git_sha": "d9ec4ef289ad39b8a662a7a12be50409b11df84b", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "fastqc": { "branch": "master", "git_sha": "41dfa3f7c0ffabb96a6a813fe321c6d1cc5b6e46", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "multiqc": { "branch": "master", "git_sha": "af27af1be706e6a2bb8fe454175b0cdf77f47b49", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] } } }, @@ -32,20 +47,26 @@ "utils_nextflow_pipeline": { "branch": "master", "git_sha": "05954dab2ff481bcb999f24455da29a5828af08d", - "installed_by": ["subworkflows"] + "installed_by": [ + "subworkflows" + ] }, "utils_nfcore_pipeline": { "branch": "master", "git_sha": "271e7fc14eb1320364416d996fb077421f3faed2", - "installed_by": ["subworkflows"] + "installed_by": [ + "subworkflows" + ] }, "utils_nfschema_plugin": { "branch": "master", "git_sha": "4b406a74dc0449c0401ed87d5bfff4252fd277fd", - "installed_by": ["subworkflows"] + "installed_by": [ + "subworkflows" + ] } } } } } -} +} \ No newline at end of file diff --git a/subworkflows/local/preprocessing/main.nf b/subworkflows/local/preprocessing/main.nf new file mode 100644 index 0000000..0c0e6dc --- /dev/null +++ b/subworkflows/local/preprocessing/main.nf @@ -0,0 +1,58 @@ +// 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 { FASTQC } from '../../../modules/nf-core/fastqc/main' +include { FALCO } from '../../../modules/nf-core/falco/main' +include { FASTP } from '../../../modules/nf-core/fastp/main' + +workflow PREPROCESSING { + + take: + // TODO nf-core: edit input (take) channels + ch_samplesheet // channel: [ val(meta), [ bam ] ] + + main: + // TODO nf-core: substitute modules here for the modules of your subworkflow + ch_versions = channel.empty() + + // + // MODULE: Run FASTP + // + ch_fastp = ch_samplesheet.map { meta, reads -> tuple(meta, reads, []) } + + FASTP ( + ch_fastp, + [], + [], + [] + ) + ch_versions = ch_versions.mix( FASTP.out.versions ) + + // + // MODULE: Run FALCO + // + FALCO ( + FASTP.out.reads + ) + ch_versions = ch_versions.mix( FALCO.out.versions ) + + // + // MODULE: Run FastQC + // + + FASTQC ( + ch_samplesheet + ) + ch_versions = ch_versions.mix( FASTQC.out.versions ) + + emit: + // TODO nf-core: edit emitted channels + fastqc = FASTQC.out.zip + versions = ch_versions + //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 ] ] +} \ No newline at end of file diff --git a/subworkflows/local/preprocessing/meta.yml b/subworkflows/local/preprocessing/meta.yml new file mode 100644 index 0000000..6d1c412 --- /dev/null +++ b/subworkflows/local/preprocessing/meta.yml @@ -0,0 +1,51 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "preprecessing" +## TODO nf-core: Add a description of the subworkflow and list keywords +description: Sort SAM/BAM/CRAM file +keywords: + - sort + - bam + - sam + - cram +## TODO nf-core: Add a list of the modules and/or subworkflows used in the subworkflow +components: + - samtools/sort + - samtools/index +## TODO nf-core: List all of the channels used as input with a description and their structure +input: + - ch_bam: + type: file + description: | + The input channel containing the BAM/CRAM/SAM files + Structure: [ val(meta), path(bam) ] + pattern: "*.{bam/cram/sam}" +## TODO nf-core: List all of the channels used as output with a descriptions and their structure +output: + - bam: + type: file + description: | + Channel containing BAM files + Structure: [ val(meta), path(bam) ] + pattern: "*.bam" + - bai: + type: file + description: | + Channel containing indexed BAM (BAI) files + Structure: [ val(meta), path(bai) ] + pattern: "*.bai" + - csi: + type: file + description: | + Channel containing CSI files + Structure: [ val(meta), path(csi) ] + pattern: "*.csi" + - versions: + type: file + description: | + File containing software versions + Structure: [ path(versions.yml) ] + pattern: "versions.yml" +authors: + - "@FernandoDuarteF" +maintainers: + - "@FernandoDuarteF" diff --git a/subworkflows/local/preprocessing/tests/main.nf.test b/subworkflows/local/preprocessing/tests/main.nf.test new file mode 100644 index 0000000..14b0c21 --- /dev/null +++ b/subworkflows/local/preprocessing/tests/main.nf.test @@ -0,0 +1,46 @@ +// TODO nf-core: Once you have added the required tests, please run the following command to build this file: +// nf-core subworkflows test preprecessing +nextflow_workflow { + + name "Test Subworkflow PREPRECESSING" + script "../main.nf" + workflow "PREPRECESSING" + + tag "subworkflows" + tag "subworkflows_" + tag "subworkflows/preprecessing" + // TODO nf-core: Add tags for all modules used within this subworkflow. Example: + tag "samtools" + tag "samtools/sort" + tag "samtools/index" + + + // TODO nf-core: Change the test name preferably indicating the test-data and file-format used + test("sarscov2 - bam - single_end") { + + when { + workflow { + """ + // TODO nf-core: define inputs of the workflow here. Example: + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + ] + input[1] = [ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + ] + """ + } + } + then { + assert workflow.success + assertAll( + { assert snapshot( + workflow.out + //TODO nf-core: Add all required assertions to verify the test output. + ).match() } + ) + } + } +} diff --git a/workflows/fsb.nf b/workflows/fsb.nf index 8aa9237..bb9fd1e 100644 --- a/workflows/fsb.nf +++ b/workflows/fsb.nf @@ -3,7 +3,8 @@ IMPORT MODULES / SUBWORKFLOWS / FUNCTIONS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -include { FASTQC } from '../modules/nf-core/fastqc/main' + +include { PREPROCESSING } from '../subworkflows/local/preprocessing' include { MULTIQC } from '../modules/nf-core/multiqc/main' include { paramsSummaryMap } from 'plugin/nf-schema' include { paramsSummaryMultiqc } from '../subworkflows/nf-core/utils_nfcore_pipeline' @@ -24,14 +25,14 @@ workflow FSB { ch_versions = channel.empty() ch_multiqc_files = channel.empty() - // - // MODULE: Run FastQC - // - FASTQC ( + + PREPROCESSING ( ch_samplesheet ) - ch_multiqc_files = ch_multiqc_files.mix(FASTQC.out.zip.collect{it[1]}) - ch_versions = ch_versions.mix(FASTQC.out.versions.first()) + ch_versions = ch_versions.mix( PREPROCESSING.out.versions ) + + // ch_multiqc_files = ch_multiqc_files.mix(FASTQC.out.zip.collect{it[1]}) + // ch_versions = ch_versions.mix(FASTQC.out.versions.first()) // // Collate and save software versions