Skip to content

Commit

Permalink
update params
Browse files Browse the repository at this point in the history
  • Loading branch information
WhalleyT committed Nov 6, 2024
1 parent 24ec195 commit c8f8536
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 56 deletions.
15 changes: 1 addition & 14 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,7 @@ workflow {

// create channels for kraken2 database and bowtie2 index
krakenDB = Channel.fromPath( "${params.kraken.kraken_db}/*.k2d" )
bowtie_dir = Channel.fromPath( "${params.bowtie.bowtie2_index}/*.bt2" )

if(params.permissive == true){
params.permissive = "yes"
} else {
params.permissive = "no"
}

if(params.unmix_myco == true){
params.unmix_myco = "yes"
} else {
params.unmix_myco = "no"
}

bowtie_dir = Channel.fromPath( "${params.bowtie.bowtie_index}/*.bt2" )

// main workflow
main:
Expand Down
42 changes: 1 addition & 41 deletions modules/preprocessingModules.nf
Original file line number Diff line number Diff line change
Expand Up @@ -403,46 +403,6 @@ process afanc {
}


process mykrobe {
/**
* @QCcheckpoint none
*/

tag { sample_name }
label 'preprocessing'
label 'normal_cpu'
label 'medium_memory'

publishDir "${params.output_dir}/$sample_name/speciation_reports_for_reads_postFastP", mode: 'copy', pattern: '*_mykrobe_report.json'
publishDir "${params.output_dir}/$sample_name/speciation_reports_for_reads_postFastP", mode: 'copy', pattern: '*_mykrobe_report.csv'

input:
tuple val(sample_name), path(fq1), path(fq2), val(run_mykrobe), path(software_json)

when:
run_mykrobe =~ /${sample_name}/

output:
tuple val(sample_name), path("${sample_name}_mykrobe_report.json"), stdout, emit: mykrobe_report
tuple val(sample_name), path(fq1), path(fq2), stdout, emit: mykrobe_fqs

script:
mykrobe_report = "${sample_name}_mykrobe_report"

"""
mykrobe predict --sample ${sample_name} --species tb --threads ${task.cpus} --format json_and_csv --output ${mykrobe_report} -1 $fq1 $fq2
printf ${sample_name}
"""

stub:
mykrobe_report = "${sample_name}_mykrobe_report.json"

"""
touch ${mykrobe_report}
printf ${sample_name}
"""
}

process bowtie2 {
/**
* @QCcheckpoint none
Expand Down Expand Up @@ -472,7 +432,7 @@ process bowtie2 {
humanfree_fq2 = "${sample_name}_cleaned_2.fq"

"""
bowtie2 --very-sensitive -p ${task.cpus} -x ./${params.bowtie_index_name} -1 $fq1 -2 $fq2 | samtools view -f 4 -Shb - > ${bam}
bowtie2 --very-sensitive -p ${task.cpus} -x ./${params.bowtie.bowtie_index_name} -1 $fq1 -2 $fq2 | samtools view -f 4 -Shb - > ${bam}
samtools fastq -1 ${humanfree_fq1} -2 ${humanfree_fq2} -s singleton.fq ${bam}
rm -rf ${bam}
Expand Down
1 change: 0 additions & 1 deletion workflows/preprocessing.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ include {fastp} from '../modules/preprocessingModules.nf'
include {fastQC} from '../modules/preprocessingModules.nf'
include {kraken2} from '../modules/preprocessingModules.nf'
include {afanc} from '../modules/preprocessingModules.nf'
include {mykrobe} from '../modules/preprocessingModules.nf'
include {bowtie2} from '../modules/preprocessingModules.nf'
include {checkBamValidity} from '../modules/preprocessingModules.nf'
include {bam2fastq} from '../modules/preprocessingModules.nf'
Expand Down

0 comments on commit c8f8536

Please sign in to comment.