Skip to content

Commit

Permalink
Merge pull request #10 from CCBR/drugz
Browse files Browse the repository at this point in the history
feat: drugZ
  • Loading branch information
kelly-sovacool authored Sep 14, 2023
2 parents 808f478 + 59c5cf6 commit 52d2985
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Run mageck subcommands: count, test, and mle. (#9)
- `mageck count` only runs if a count table **isn't** given.
- `mageck mle` only runs if a design matrix **is** given.
- Optional: run drugZ. (#10)

<!--
## CRUISE v0.1.0
Expand Down
Binary file modified assets/dag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ process {
withName: 'MAGECK.*' {
container = 'quay.io/biocontainers/mageck:0.5.9.5--py39h1f90b4d_3'
}
withName: 'DRUGZ.*' {
container = 'nciccbr/cruise_drugz:0.1.0'
}
/*
withName: 'VISPR.*' {
container = 'quay.io/biocontainers/mageck-vispr:0.5.6--py_0'
}
withName: 'BAGEL.*' {
container = 'nciccbr/cruise_bagel_2.0:0.1.0'
}
withName: 'DRUGZ.*' {
container = 'nciccbr/cruise_drugz:0.1.0'
}
*/
}
4 changes: 4 additions & 0 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ params {
max_time = '12.h'

publish_dir_mode = 'symlink'

drugz.remove_genes = 'LacZ,luciferase,EGFR'
drugz.half_window_size = 5

}
dag {
enabled = true
Expand Down
13 changes: 10 additions & 3 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ include { INPUT_CHECK } from './submodules/local/input_check.nf'
include { TRIM_ALIGN } from './submodules/local/trim_align.nf'
include { MAGECK } from './submodules/local/mageck.nf'

// MODULES
include { DRUGZ } from "./modules/local/drugz.nf"

workflow CRUISE {
INPUT_CHECK(file(params.input))
INPUT_CHECK.out
Expand All @@ -40,10 +43,14 @@ workflow CRUISE {
ctrl: meta.treat_or_ctrl == 'control'
return meta.id
}
.set { treatments }

MAGECK(ch_count, treatments.treat.collect(), treatments.ctrl.collect())
.set { treat_meta }
treat = treat_meta.treat.collect()
control = treat_meta.ctrl.collect()
MAGECK(ch_count, treat, control)

if (params.drugz.run) {
DRUGZ(ch_count, treat, control)
}
}

workflow {
Expand Down
26 changes: 23 additions & 3 deletions modules/local/drugz.nf
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@

process DRUGZ {

input:
path(count)
val(treatment)
val(control)

output:
path("output.txt")
path("*output.txt"), emit: txt
path("*foldchange.txt"), emit: fc

script:
"""
uname -a >> output.txt
which drugz.py >> output.txt
drugz.py \\
-i ${count} \\
-o ${count.getBaseName(2)}.output.txt \\
-f ${count.getBaseName(2)}.foldchange.txt \\
-c ${control.join(',')} \\
-x ${treatment.join(',')} \\
-r ${params.drugz.remove_genes} \\
--half_window_size ${params.drugz.half_window_size}
"""

stub:
"""
for ext in output foldchange; do
touch ${count.getBaseName(2)}.\$ext.txt
done
"""
}
6 changes: 6 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ params {
trailingquality = 10
}

drugz {
run = true
remove_genes = null
half_window_size = 500 // same as default in drugZ https://github.com/hart-lab/drugz/blob/eb15d34e4dd172965e618d5bb662c053066da799/drugz.py#L305-L306
}

}

includeConfig 'conf/base.config'
Expand Down

0 comments on commit 52d2985

Please sign in to comment.