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

Fix jasen first bug #369

Merged
merged 4 commits into from
Nov 12, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed resfinder `--species` arg
- Fixed `nextflow.hopper.config` `symlinkDir`
- Removed serotypefinder from saureus workflow
- Fixed jasen running only on the first row/sample in csv

### Changed

Expand Down
1 change: 1 addition & 0 deletions configs/nextflow.dev.config
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ profiles {
params.species = 'streptococcus pyogenes'
params.speciesDir = 'spyogenes'
params.mlstScheme = 'spyogenes'
params.symlinkDir = "/access/jasen/spyogenes/"
params.referenceGenome = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_000006785.2.fasta"
params.referenceGenomeIdx = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_000006785.2.fasta.fai"
params.referenceGenomeGff = "${params.root}/assets/genomes/streptococcus_pyogenes/GCF_000006785.2.gff"
Expand Down
3 changes: 2 additions & 1 deletion nextflow-modules/modules/seqtk/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ process seqtk_sample {
scratch params.scratch

input:
tuple val(sampleID), path(reads), val(sample_size)
tuple val(sampleID), path(reads)
val sample_size

output:
tuple val(sampleID), path("*.fastq.gz"), emit: reads
Expand Down
12 changes: 7 additions & 5 deletions workflows/bacterial_base.nf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ workflow CALL_BACTERIAL_BASE {
referenceGenome
referenceGenomeDir
inputSamples
targetSampleSize

main:
ch_versions = Channel.empty()
Expand All @@ -42,11 +43,12 @@ workflow CALL_BACTERIAL_BASE {
.map{ row -> get_reads(row) }
.set{ ch_raw_reads }

// downsample reads
seqtk_sample( ch_raw_reads.map(row -> [row[0], row[1], params.targetSampleSize]) ).reads
.concat( ch_raw_reads ) // add raw reads channel
.first() // if seqtk was not run the first row is the raw reads
.set{ ch_sampled_reads } // create sampled reads channel
if ( params.targetSampleSize ) {
// downsample reads
seqtk_sample( ch_raw_reads, targetSampleSize ).reads.set{ ch_sampled_reads }
} else {
ch_raw_reads.set{ ch_sampled_reads }
}

// reads trim and clean and recreate reads channel if the reads were trimmed
assembly_trim_clean(ch_sampled_reads.join(ch_meta)).set { ch_clean_reads_w_meta }
Expand Down
4 changes: 3 additions & 1 deletion workflows/escherichia_coli.nf
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ workflow CALL_ESCHERICHIA_COLI {
serotypefinderDb = file(params.serotypefinderDb, checkIfExists: true)
shigapassDb = file(params.shigapassDb, checkIfExists: true)
virulencefinderDb = file(params.virulencefinderDb, checkIfExists: true)
// schemas and values
targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.of([])

main:
ch_versions = Channel.empty()

CALL_BACTERIAL_BASE( coreLociBed, referenceGenome, referenceGenomeDir, inputSamples )
CALL_BACTERIAL_BASE( coreLociBed, referenceGenome, referenceGenomeDir, inputSamples, targetSampleSize )

CALL_BACTERIAL_BASE.out.assembly.set{ch_assembly}
CALL_BACTERIAL_BASE.out.reads.set{ch_reads}
Expand Down
4 changes: 3 additions & 1 deletion workflows/klebsiella_pneumoniae.nf
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ workflow CALL_KLEBSIELLA_PNEUMONIAE {
pointfinderDb = file(params.pointfinderDb, checkIfExists: true)
serotypefinderDb = file(params.serotypefinderDb, checkIfExists: true)
virulencefinderDb = file(params.virulencefinderDb, checkIfExists: true)
// schemas and values
targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.of([])

main:
ch_versions = Channel.empty()

CALL_BACTERIAL_BASE( coreLociBed, referenceGenome, referenceGenomeDir, inputSamples )
CALL_BACTERIAL_BASE( coreLociBed, referenceGenome, referenceGenomeDir, inputSamples, targetSampleSize )

CALL_BACTERIAL_BASE.out.assembly.set{ch_assembly}
CALL_BACTERIAL_BASE.out.reads.set{ch_reads}
Expand Down
4 changes: 3 additions & 1 deletion workflows/mycobacterium_tuberculosis.nf
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ workflow CALL_MYCOBACTERIUM_TUBERCULOSIS {
tbdbBed = file(params.tbdbBed, checkIfExists: true)
tbdbBedIdx = file(params.tbdbBedIdx, checkIfExists: true)
tbGradingRulesBed = file(params.tbGradingRulesBed, checkIfExists: true)
// schemas and values
targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.of([])

main:
ch_versions = Channel.empty()

CALL_BACTERIAL_BASE( coreLociBed, referenceGenome, referenceGenomeDir, inputSamples )
CALL_BACTERIAL_BASE( coreLociBed, referenceGenome, referenceGenomeDir, inputSamples, targetSampleSize )

CALL_BACTERIAL_BASE.out.assembly.set{ch_assembly}
CALL_BACTERIAL_BASE.out.reads.set{ch_reads}
Expand Down
4 changes: 3 additions & 1 deletion workflows/staphylococcus_aureus.nf
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ workflow CALL_STAPHYLOCOCCUS_AUREUS {
resfinderDb = file(params.resfinderDb, checkIfExists: true)
pointfinderDb = file(params.pointfinderDb, checkIfExists: true)
virulencefinderDb = file(params.virulencefinderDb, checkIfExists: true)
// schemas and values
targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.of([])

main:
ch_versions = Channel.empty()

CALL_BACTERIAL_BASE( coreLociBed, referenceGenome, referenceGenomeDir, inputSamples )
CALL_BACTERIAL_BASE( coreLociBed, referenceGenome, referenceGenomeDir, inputSamples, targetSampleSize )

CALL_BACTERIAL_BASE.out.assembly.set{ch_assembly}
CALL_BACTERIAL_BASE.out.reads.set{ch_reads}
Expand Down
3 changes: 2 additions & 1 deletion workflows/streptococcus.nf
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ workflow CALL_STREPTOCOCCUS {
mlstScheme = params.mlstScheme ? params.mlstScheme : Channel.of([])
species = params.species ? params.species : Channel.of([])
speciesDir = params.speciesDir ? params.speciesDir : Channel.of([])
targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.of([])

main:
ch_versions = Channel.empty()

CALL_BACTERIAL_BASE( coreLociBed, referenceGenome, referenceGenomeDir, inputSamples )
CALL_BACTERIAL_BASE( coreLociBed, referenceGenome, referenceGenomeDir, inputSamples, targetSampleSize )

CALL_BACTERIAL_BASE.out.assembly.set{ch_assembly}
CALL_BACTERIAL_BASE.out.reads.set{ch_reads}
Expand Down
3 changes: 2 additions & 1 deletion workflows/streptococcus_pyogenes.nf
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ workflow CALL_STREPTOCOCCUS_PYOGENES {
mlstScheme = params.mlstScheme ? params.mlstScheme : Channel.of([])
species = params.species ? params.species : Channel.of([])
speciesDir = params.speciesDir ? params.speciesDir : Channel.of([])
targetSampleSize = params.targetSampleSize ? params.targetSampleSize : Channel.of([])

main:
ch_versions = Channel.empty()

CALL_BACTERIAL_BASE( coreLociBed, referenceGenome, referenceGenomeDir, inputSamples )
CALL_BACTERIAL_BASE( coreLociBed, referenceGenome, referenceGenomeDir, inputSamples, targetSampleSize )

CALL_BACTERIAL_BASE.out.assembly.set{ch_assembly}
CALL_BACTERIAL_BASE.out.reads.set{ch_reads}
Expand Down
Loading