Skip to content

Commit

Permalink
bugfix on screen reads
Browse files Browse the repository at this point in the history
  • Loading branch information
replikation committed Feb 16, 2024
1 parent 9269045 commit 0ff536f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion configs/local.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ process {
withLabel: guppy_gpu { cpus = params.max_cores }
withLabel: kraken2 { cpus = params.cores }
withLabel: krona { cpus = 1 }
withLabel: lcs_sc2 { cpus = params.max_cores } //max_cores
withLabel: lcs_sc2 { cpus = params.max_cores; memory = params.memory } //max_cores
withLabel: minimap2 { cpus = params.cores }
withLabel: nanoplot { cpus = params.cores }
withLabel: nextclade { cpus = params.cores }
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ profiles {
memory = params.memory
}

process.errorStrategy = 'ignore'
//process.errorStrategy = 'ignore'
}

slurm {
Expand Down
4 changes: 2 additions & 2 deletions poreCov.nf
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,11 @@ else { params.pangolindocker = params.defaultpangolin ; params.nextcladedocker =
if ( params.screen_reads && params.lcs_ucsc_update ){
if ( internetcheck.toString() == "true" ) {
latest_version = 'https://hgdownload.soe.ucsc.edu/goldenPath/wuhCor1/UShER_SARS-CoV-2/public-latest.version.txt'.toURL().text.split('\\(')[1].split('\\)')[0]
println "\033[0;32mFound latest UCSC version, using: " + latest_version + " \033[0m"
log.info "\033[0;32mFound latest UCSC version, using: " + latest_version + " \033[0m"
params.lcs_ucsc = latest_version
}
if ( internetcheck.toString() == "false" ) {
println "\033[0;33mCould not find the latest UCSC version, trying: " + params.lcs_ucsc_version + "\033[0m"
log.info "\033[0;33mCould not find the latest UCSC version, trying: " + params.lcs_ucsc_version + "\033[0m"
params.lcs_ucsc = params.lcs_ucsc_version
}
} else { params.lcs_ucsc = params.lcs_ucsc_version}
Expand Down
3 changes: 2 additions & 1 deletion workflows/process/lcs_sc2.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ process lcs_ucsc_markers_table {
"""
git clone https://github.com/rki-mf1/LCS.git --branch 2023.01.30
if [[ "${variant_group_tsv}" != default ]]; then
if [[ "${params.lcs_variant_groups}" != default ]]; then
rm -rf LCS/data/variant_groups.tsv
cp ${variant_group_tsv} LCS/data/variant_groups.tsv
fi
Expand All @@ -22,6 +22,7 @@ process lcs_ucsc_markers_table {
sed -i "s/PB_VERSION=.*/PB_VERSION='${params.lcs_ucsc}'/" rules/config.py
sed -i "s/NUM_SAMPLE=.*/NUM_SAMPLE=${params.lcs_ucsc_downsampling}/" rules/config.py
mem=\$(echo ${task.memory} | cut -d' ' -f1)
echo \$mem
## run pipeline
snakemake --cores ${task.cpus} --resources mem_gb=\$mem --config dataset=somestring markers=ucsc -- ucsc_gather_tables
## output
Expand Down
15 changes: 7 additions & 8 deletions workflows/read_classification.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ workflow read_classification_wf {
fastq
main:

// Check for human contamination
// database download
if (params.krakendb) { kraken_db = file("${params.krakendb}") }
else { download_database_kraken2(); kraken_db = download_database_kraken2.out }
Expand All @@ -18,19 +19,17 @@ workflow read_classification_wf {
// visuals
krona(kraken2.out)

// Metagenomic analysis
// calculate mixed/ pooled samples using LCS, https://github.com/rvalieris/LCS
if (params.screen_reads) {
if (params.lcs_variant_groups == 'default'){
lcs_variant_groups_ch = Channel.empty()
} else {
lcs_variant_groups_ch = Channel.fromPath("${params.lcs_variant_groups}", checkIfExists: true)
}
if (params.lcs_variant_groups == 'default') { lcs_variant_groups_ch = Channel.empty() }
else { lcs_variant_groups_ch = Channel.fromPath("${params.lcs_variant_groups}", checkIfExists: true)}

lcs_ucsc_markers_table(lcs_variant_groups_ch.ifEmpty([]))
lcs_sc2(fastq.combine(lcs_ucsc_markers_table.out))
lcs_output = lcs_sc2.out
} else {
lcs_output = Channel.empty()
}
}
else { lcs_output = Channel.empty()}

emit:
kraken = kraken2.out
Expand Down

0 comments on commit 0ff536f

Please sign in to comment.