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

This patch fixes the pipeline when using a reference genome #10

Merged
merged 4 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
34 changes: 14 additions & 20 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,20 @@ process {
'-outfmt',
'"6 qseqid ppos"',
].join(' ').trim()

publishDir = [
[
path: "${params.outdir}",
mode: params.publish_dir_mode,
failOnError: true,
saveAs: {
filename -> {
def output_file = new File(filename);
return "${study_reads_folder()}/assembly/${meta.assembler}/${meta.assembler_version}/decontamination/${output_file.name}";
mberacochea marked this conversation as resolved.
Show resolved Hide resolved
}
}
]
]
}

withName: 'SEQKIT_GREP' {
Expand Down Expand Up @@ -319,24 +333,4 @@ process {
// NOTICE: Maximum number of references (--max-ref-number) is set to 0, search in SILVA 16S rRNA database is disabled //
ext.args = "--max-ref-num 0"
}

withName: 'PUBLISH_DECONTAMINATED' {
cpus = { check_max( 1 , 'cpus' ) }
memory = { check_max( 250.MB * task.attempt, 'memory' ) }
time = { check_max( 30.m , 'time' ) }

publishDir = [
[
path: "${params.outdir}",
mode: params.publish_dir_mode,
failOnError: true,
saveAs: {
filename -> {
def output_file = new File(filename);
return "${study_reads_folder()}/assembly/${meta.assembler}/${meta.assembler_version}/decontamination/${output_file.name}";
}
}
]
]
}
}
13 changes: 0 additions & 13 deletions modules/local/publish_decontaminated.nf

This file was deleted.

2 changes: 1 addition & 1 deletion modules/nf-core/blast/blastn/main.nf

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

10 changes: 3 additions & 7 deletions subworkflows/local/assembly_qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ include { BLAST_BLASTN as BLAST_BLASTN_HUMAN_PHIX } from '../../modules/nf-core/
include { BLAST_BLASTN as BLAST_BLASTN_HOST } from '../../modules/nf-core/blast/blastn/main'
include { SEQKIT_GREP } from '../../modules/nf-core/seqkit/grep/main'
include { SEQKIT_SEQ } from '../../modules/nf-core/seqkit/seq/main'
include { PUBLISH_DECONTAMINATED } from '../../modules/local/publish_decontaminated'

workflow ASSEMBLY_QC {

Expand Down Expand Up @@ -54,18 +53,15 @@ workflow ASSEMBLY_QC {

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

contaminated_contigs = Channel.of( BLAST_BLASTN_HUMAN_PHIX.out.txt, BLAST_BLASTN_HOST.out.txt )
.collectFile(name: "contaminated_contigs_host.txt", newLine: true)
contaminated_contigs = BLAST_BLASTN_HUMAN_PHIX.out.txt.mix( BLAST_BLASTN_HOST.out.txt )
} else {
contaminated_contigs = BLAST_BLASTN_HUMAN_PHIX.out.txt
}

// TODO: this process only function is to publish the decontaminated contigs txt file
PUBLISH_DECONTAMINATED( contaminated_contigs )

// TODO: this is not fit for samplesheets kind of inputs
SEQKIT_GREP(
SEQKIT_SEQ.out.fastx,
contaminated_contigs.map { meta, hits_txt -> { hits_txt }}
contaminated_contigs.map { meta, hits_txt -> { hits_txt }}.collectFile(name: "contaminated_contigs.txt", newLine: true)
mberacochea marked this conversation as resolved.
Show resolved Hide resolved
)

ch_versions = ch_versions.mix(SEQKIT_GREP.out.versions)
Expand Down
Loading