Skip to content
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
2 changes: 2 additions & 0 deletions .github/workflows/pytest-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ jobs:
tags: subworkflows/vcf_annotate_ensemblvep_snpeff
- profile: "conda"
tags: subworkflows/vcf_annotate_ensemblvep
- profile: "conda"
tags: subworkflows/fasta_clean_fcs
- profile: "conda"
tags: islandpath
env:
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/fcs/fcsadaptor/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ process FCS_FCSADAPTOR {
// WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions.
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://ftp.ncbi.nlm.nih.gov/genomes/TOOLS/FCS/releases/0.2.3/fcs-adaptor.0.2.3.sif':
'ncbi/fcs-adaptor:0.2.3' }"
'docker.io/ncbi/fcs-adaptor:0.2.3' }"

// Exit if running this module with -profile conda / -profile mamba
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
Expand Down
29 changes: 29 additions & 0 deletions subworkflows/nf-core/fasta_clean_fcs/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
include { FCS_FCSADAPTOR } from '../../../modules/nf-core/fcs/fcsadaptor/main'
include { FCS_FCSGX } from '../../../modules/nf-core/fcs/fcsgx/main'

workflow FASTA_CLEAN_FCS {

take:
ch_fasta // channel: [ val(meta), [ fasta ] ]
database // value: the db to use

main:
ch_versions = Channel.empty()

FCS_FCSADAPTOR ( ch_fasta )
ch_versions = ch_versions.mix(FCS_FCSADAPTOR.out.versions)

FCS_FCSGX ( FCS_FCSADAPTOR.out.cleaned_assembly, database )
ch_versions = ch_versions.mix(FCS_FCSGX.out.versions)

emit:
fcsadaptor_cleaned_assembly = FCS_FCSADAPTOR.out.cleaned_assembly // channel: [ val(meta), [ cleaned_assembly ] ]
fcsadaptor_report = FCS_FCSADAPTOR.out.adaptor_report // channel: [ val(meta), [ adaptor_report ] ]
fcsadaptor_log = FCS_FCSADAPTOR.out.log // channel: [ val(meta), [ log ] ]
fcsadaptor_pipeline_args = FCS_FCSADAPTOR.out.pipeline_args // channel: [ val(meta), [ pipeline_args ] ]
fcsadaptor_skipped_trims = FCS_FCSADAPTOR.out.skipped_trims // channel: [ val(meta), [ skipped_trims ] ]
fcsgx_report = FCS_FCSGX.out.fcs_gx_report // channel: [ val(meta), [ fcs_gx_report ] ]
fcsgx_taxonomy_report = FCS_FCSGX.out.taxonomy_report // channel: [ val(meta), [ taxonomy_report ] ]
versions = ch_versions // channel: [ versions.yml ]
}

61 changes: 61 additions & 0 deletions subworkflows/nf-core/fasta_clean_fcs/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json
name: "fasta_clean_fcs"
description: Foreign Contamination Screen (FCS) is a tool suite for identifying and removing contaminant sequences in genome assemblies
keywords:
- contamination screening
- cleaning
- assemblies
- fasta
modules:
- fcs/fcsadaptor
- fcs/fcsgx
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- assembly:
type: file
description: assembly fasta file
pattern: "*.{fasta,fa}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- fcsadaptor_cleaned_assembly:
type: file
description: Cleaned assembly in fasta format
pattern: "*.{cleaned_sequences.fa.gz}"
- fcsadaptor_report:
type: file
description: Report of identified adaptors
pattern: "*.{fcs_adaptor_report.txt}"
- fcsadaptor_log:
type: file
description: Log file
pattern: "*.{fcs_adaptor.log}"
- fcsadaptor_pipeline_args:
type: file
description: Run arguments
pattern: "*.{pipeline_args.yaml}"
- fcsadaptor_skipped_trims:
type: file
description: Skipped trim information
pattern: "*.{skipped_trims.jsonl}"
- fcs_gx_report:
type: file
description: Report containing the contig identifier and recommended action (EXCLUDE, TRIM, FIX, REVIEW)
pattern: "*.fcs_gx_report.txt"
- fcsgx_taxonomy_report:
type: file
description: Report containing the contig identifier and mapped contaminant species
pattern: "*.taxonomy.rpt"
authors:
- "@scorreard"
4 changes: 4 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3508,6 +3508,10 @@ subworkflows/fasta_binning_concoct:
- subworkflows/nf-core/fasta_binning_concoct/**
- tests/subworkflows/nf-core/fasta_binning_concoct/**

subworkflows/fasta_clean_fcs:
- subworkflows/nf-core/fasta_clean_fcs/**
- tests/subworkflows/nf-core/fasta_clean_fcs/**

subworkflows/fasta_index_dna:
- subworkflows/nf-core/fasta_index_dna/**
- tests/subworkflows/nf-core/fasta_index_dna/**
Expand Down
23 changes: 23 additions & 0 deletions tests/subworkflows/nf-core/fasta_clean_fcs/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env nextflow

nextflow.enable.dsl = 2

include { FASTA_CLEAN_FCS } from '../../../../subworkflows/nf-core/fasta_clean_fcs/main.nf'

workflow test_fasta_clean_fcs {

input = [
[ id:'test', single_end:false, taxid:'9606' ], // meta map
file(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true)
]

database = [
file("https://ftp.ncbi.nlm.nih.gov/genomes/TOOLS/FCS/database/test-only/test-only.gxi"),
file("https://ftp.ncbi.nlm.nih.gov/genomes/TOOLS/FCS/database/test-only/test-only.gxs"),
file("https://ftp.ncbi.nlm.nih.gov/genomes/TOOLS/FCS/database/test-only/test-only.taxa.tsv"),
file("https://ftp.ncbi.nlm.nih.gov/genomes/TOOLS/FCS/database/test-only/test-only.meta.jsonl"),
file("https://ftp.ncbi.nlm.nih.gov/genomes/TOOLS/FCS/database/test-only/test-only.blast_div.tsv.gz")
]

FASTA_CLEAN_FCS ( input, database )
}
5 changes: 5 additions & 0 deletions tests/subworkflows/nf-core/fasta_clean_fcs/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {

publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

}
26 changes: 26 additions & 0 deletions tests/subworkflows/nf-core/fasta_clean_fcs/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
- name: fasta_clean_fcs test_fasta_clean_fcs
command: nextflow run ./tests/subworkflows/nf-core/fasta_clean_fcs -entry test_fasta_clean_fcs -c ./tests/config/nextflow.config
tags:
- fcs
- fcs/fcsadaptor
- fcs/fcsgx
- subworkflows
- subworkflows/fasta_clean_fcs
files:
- path: output/fcs/out/test.cleaned_sequences.fa.9606.fcs_gx_report.txt
contains:
- '##[["FCS genome report", 2, 1]'
- path: output/fcs/out/test.cleaned_sequences.fa.9606.taxonomy.rpt
contains:
- '##[["GX taxonomy analysis report", 3, 1]'
- path: output/fcs/test.cleaned_sequences.fa.gz
md5sum: 2f331e59b352418420a35236091bf93c
- path: output/fcs/test.fcs_adaptor.log
contains:
- "INFO:cwltool:[workflow ] start"
- path: output/fcs/test.fcs_adaptor_report.txt
md5sum: 27375be4671e01d2d2674ddd1d44414a
- path: output/fcs/test.pipeline_args.yaml
md5sum: 80effed2a75550a6a861c47f4c30449d
- path: output/fcs/test.skipped_trims.jsonl
md5sum: d41d8cd98f00b204e9800998ecf8427e