Skip to content
Draft
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
1 change: 1 addition & 0 deletions configs/container.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ process {
withLabel: snp_sites { container = 'biocontainers/snp-sites:v2.4.1-1-deb_cv1' }
withLabel: toytree { container = 'nanozoo/toytree:1.1.2--1295ae6' }
withLabel: ubuntu { container = 'nanozoo/template:3.8--e13dfeb' }
withLabel: devider { container = 'nanozoo/devider:0.0.1--f255b80' }
}
1 change: 1 addition & 0 deletions configs/local.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ process {
withLabel: snp_sites { cpus = params.cores }
withLabel: seqrs { cpus = 1 }
withLabel: ubuntu { cpus = 1 }
withLabel: devider { cpus = params.cores }
}
1 change: 1 addition & 0 deletions configs/nodes.config
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ process {
withLabel: seqrs { cpus = 2; memory = '2 GB' }
withLabel: snp_sites { cpus = 4; memory = '4 GB' }
withLabel: ubuntu { cpus = 2; memory = '2 GB' }
withLabel: devider { cpus = 12; memory = '12 GB'}
}
7 changes: 7 additions & 0 deletions poreCov.nf
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ include { genome_quality_wf } from './workflows/genome_quality.nf'
include { read_classification_wf; read_screening_freyja_wf; read_screening_lsc_wf} from './workflows/read_classification'
include { read_qc_wf } from './workflows/read_qc.nf'
include { rki_report_wf } from './workflows/provide_rki.nf'
include { ww_cryptic_lineages_wf } from './workflows/ww_cryptic_lineages.nf'

/**************************
* MAIN WORKFLOW
Expand Down Expand Up @@ -419,6 +420,12 @@ workflow {
determine_mutations_wf(fasta_input_ch)
genome_quality_wf(fasta_input_ch, reference_for_qc_input_ch)

// TEST - devider haplotyping + freyja covariants co-occurring mutation profiles
// for cryptic variant detection later
if (!(params.fasta || workflow.profile.contains('test_fasta'))) { // create a flag/param for this? + make sure the channels exist?
ww_cryptic_lineages_wf(filtered_reads_ch, reference_for_qc_input_ch, artic_ncov_wf.out.trimmed_bam)
}

// 3. Specialised outputs (rki, json)
rki_report_wf(genome_quality_wf.out[0], genome_quality_wf.out[1], extended_input_ch)

Expand Down
55 changes: 55 additions & 0 deletions workflows/process/devider.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
process devider {
label 'devider'
publishDir "${params.output}/${params.lineagedir}/devider", mode: 'copy', pattern: "*_majority_vote_haplotypes.fasta" // should this be published or only intermediate for later?
// probably change output dir

input:
tuple val(name), path(reads), path(reference)//, path(bam_file), path(vcf)
output:
tuple val(name), path("${name}_majority_vote_haplotypes.fasta"), emit: haplotypes
// add other stuff if relevant

script:
// just run devider haplotyping
/*"""
devider -b ${bam_file} -v ${vcf} -r ${reference} -o ${name}_devider_output \
-t ${task.cpus} --preset nanopore-r9
"""*/ // didn't work when I tried it separately (because it doesnt recognize chromosome name or smth)

// run devider pipeline (does mapping, variant calling, haplotyping)
"""
run_devider_pipeline -i ${reads} -r ${reference} -o ${name}_devider_output
mv ${name}_devider_output/majority_vote_haplotypes.fasta ${name}_majority_vote_haplotypes.fasta
"""
/* different presets - choose one or make dynamic??
old-long-reads for ~90% identity long reads
nanopore-r9 for ~95% (default)
nanopore-r10 for ~98%
hi-fi for true high fidelity reads (> 99.9% accuracy).
*/

}


process freyja_covariants {
label 'freyja'
publishDir "${params.output}/${params.lineagedir}/devider", mode: 'copy', pattern: "*"
// probably change output dir
// maybe move to freyja.nf for clarity?

input:
tuple val(name), path(bam_file), path(bam_index), path(reference)
// needs .bai in same folder as .bam

output:
tuple val(name), path("${name}_freyja_covariants.tsv"), emit: covariants

script:
"""
freyja covariants --ref-genome ${reference} --output ${name}_freyja_covariants.tsv ${bam_file}
"""
// could include .gff with --annot --> AA notes in result + nt mutation
// --threads ${task.cpus} gets error "no such option as --threads" but it exists according to --help and the wiki ??
// potential issue: gives different result than running freyja covariants separately --> just because of different (trimmed) bam?

}
18 changes: 18 additions & 0 deletions workflows/ww_cryptic_lineages.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
include { devider; freyja_covariants } from './process/devider.nf'
// adjust if freyja_covariants gets moved to freyja.nf

workflow ww_cryptic_lineages_wf {
take:
fastq
reference
bam_and_bai

main:
devider(fastq.combine(reference))
freyja_covariants(bam_and_bai.combine(reference))

emit:
devider.out
freyja_covariants.out

}
Loading