Skip to content

Commit

Permalink
refactor: all multi-channel inputs into a single channel
Browse files Browse the repository at this point in the history
  • Loading branch information
shihabdider committed Mar 21, 2024
1 parent fbac624 commit 17be003
Show file tree
Hide file tree
Showing 11 changed files with 527 additions and 497 deletions.
27 changes: 12 additions & 15 deletions .nf-test.log
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
Mar-07 12:49:11.211 [main] INFO com.askimed.nf.test.App - nf-test 0.8.2
Mar-07 12:49:11.231 [main] INFO com.askimed.nf.test.App - Arguments: [test, tests/main.nf.test]
Mar-07 12:49:11.232 [main] INFO com.askimed.nf.test.commands.RunTestsCommand - Load config from file /gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/nf-test.config...
Mar-07 12:49:11.653 [main] INFO com.askimed.nf.test.commands.RunTestsCommand - Detected 1 test files.
Mar-07 12:49:11.865 [main] INFO com.askimed.nf.test.config.FileStaging - Create symlink '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/.nf-test/tests/3bffb7994b63d3c3c0d3fe65d3c062fe/meta/bin' --> '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/bin'
Mar-07 12:49:11.865 [main] INFO com.askimed.nf.test.config.FileStaging - Create symlink '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/.nf-test/tests/3bffb7994b63d3c3c0d3fe65d3c062fe/meta/lib' --> '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/lib'
Mar-07 12:49:11.866 [main] INFO com.askimed.nf.test.config.FileStaging - Create symlink '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/.nf-test/tests/3bffb7994b63d3c3c0d3fe65d3c062fe/meta/assets' --> '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/assets'
Mar-07 12:49:11.867 [main] DEBUG com.askimed.nf.test.core.AbstractTest - Stage 1 user provided files...
Mar-07 12:49:11.868 [main] INFO com.askimed.nf.test.config.FileStaging - Create symlink '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/.nf-test/tests/3bffb7994b63d3c3c0d3fe65d3c062fe/meta/tests/test_data/' --> '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/tests/test_data'
Mar-07 12:49:11.875 [main] INFO com.askimed.nf.test.core.TestExecutionEngine - Started test plan
Mar-07 12:49:11.875 [main] INFO com.askimed.nf.test.core.TestExecutionEngine - Running testsuite 'Test pipeline' from file '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/tests/main.nf.test'.
Mar-07 12:49:11.876 [main] INFO com.askimed.nf.test.core.TestExecutionEngine - Run test '3bffb799: Should run entire nf-jabba pipeline without failure'. type: com.askimed.nf.test.lang.pipeline.PipelineTest
Mar-07 13:32:40.336 [main] INFO com.askimed.nf.test.core.TestExecutionEngine - Test '3bffb799: Should run entire nf-jabba pipeline without failure' finished. status: PASSED
Mar-07 13:32:40.340 [main] INFO com.askimed.nf.test.core.TestExecutionEngine - Testsuite 'Test pipeline' finished. snapshot file: false, skipped tests: false, failed tests: false
Mar-07 13:32:40.340 [main] INFO com.askimed.nf.test.core.TestExecutionEngine - Executed 1 tests. 0 tests failed. Done!
Mar-20 21:26:19.345 [main] INFO com.askimed.nf.test.App - nf-test 0.8.2
Mar-20 21:26:19.368 [main] INFO com.askimed.nf.test.App - Arguments: [test, tests/main.nf.test]
Mar-20 21:26:19.370 [main] INFO com.askimed.nf.test.commands.RunTestsCommand - Load config from file /gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/nf-test.config...
Mar-20 21:26:19.832 [main] INFO com.askimed.nf.test.commands.RunTestsCommand - Detected 1 test files.
Mar-20 21:26:20.080 [main] INFO com.askimed.nf.test.config.FileStaging - Create symlink '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/.nf-test/tests/3bffb7994b63d3c3c0d3fe65d3c062fe/meta/bin' --> '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/bin'
Mar-20 21:26:20.081 [main] INFO com.askimed.nf.test.config.FileStaging - Create symlink '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/.nf-test/tests/3bffb7994b63d3c3c0d3fe65d3c062fe/meta/lib' --> '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/lib'
Mar-20 21:26:20.081 [main] INFO com.askimed.nf.test.config.FileStaging - Create symlink '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/.nf-test/tests/3bffb7994b63d3c3c0d3fe65d3c062fe/meta/assets' --> '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/assets'
Mar-20 21:26:20.082 [main] DEBUG com.askimed.nf.test.core.AbstractTest - Stage 1 user provided files...
Mar-20 21:26:20.082 [main] INFO com.askimed.nf.test.config.FileStaging - Create symlink '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/.nf-test/tests/3bffb7994b63d3c3c0d3fe65d3c062fe/meta/tests/test_data/' --> '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/tests/test_data'
Mar-20 21:26:20.087 [main] INFO com.askimed.nf.test.core.TestExecutionEngine - Started test plan
Mar-20 21:26:20.087 [main] INFO com.askimed.nf.test.core.TestExecutionEngine - Running testsuite 'Test pipeline' from file '/gpfs/commons/groups/imielinski_lab/home/sdider/Projects/nf-jabba/tests/main.nf.test'.
Mar-20 21:26:20.087 [main] INFO com.askimed.nf.test.core.TestExecutionEngine - Run test '3bffb799: Should run entire nf-jabba pipeline without failure'. type: com.askimed.nf.test.lang.pipeline.PipelineTest
32 changes: 28 additions & 4 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@
"format": "file-path",
"exists": true
},
"ggraph": {
"errorMessage": "jabba.rds file and must have extension '.rds'",
"ploidy": {
"errorMessage": "purityploidy file must have extension '.rds' or be a number",
"anyOf": [
{
"type": "string",
Expand All @@ -218,10 +218,11 @@
{
"type": "string",
"maxLength": 0
},
{
"type": "number"
}
],
"format": "file-path",
"exists": true
},
"vcf": {
"errorMessage": "VCF file for reads 1 cannot contain spaces and must have extension '.vcf' or '.vcf.gz'",
Expand Down Expand Up @@ -307,6 +308,29 @@
"format": "file-path",
"exists": true
},
"ggraph": {
"errorMessage": "jabba.rds file and must have extension '.rds'",
"anyOf": [
{
"type": "string",
"pattern": "^\\S+\\.rds$"
},
{
"type": "string",
"pattern": "^NA$"
},
{
"type": "string",
"pattern": "^/dev/null$"
},
{
"type": "string",
"maxLength": 0
}
],
"format": "file-path",
"exists": true
},
"variantcaller": {
"type": "string"
}
Expand Down
7 changes: 2 additions & 5 deletions modules/local/allelic_cn/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ process NON_INTEGER_BALANCE {
'mskilab/allelic_cn:latest' }"

input:
tuple val(meta), path(jabba_rds)
tuple val(meta), path(decomposed_cov)
tuple val(meta), path(het_pileups_wgs)
tuple val(meta), path(jabba_rds), path(decomposed_cov), path(het_pileups_wgs)
val(field)
val(hets_thresh)
path(mask)
Expand Down Expand Up @@ -95,8 +93,7 @@ process LP_PHASED_BALANCE {
'mskilab/allelic_cn:latest' }"

input:
tuple val(meta), path(hets_gg) // output from non_integer_balance
tuple val(meta), path(hets) // sites.txt from hetpileups
tuple val(meta), path(hets_gg), path(hets) // output from non_integer_balance, sites.txt from hetpileups
val(lambda)
val(cnloh)
val(major)
Expand Down
3 changes: 1 addition & 2 deletions modules/local/ascat/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ process ASCAT_SEG {
'mskilab/ascat_seg:latest' }"

input:
tuple val(meta), path(hets) // channel: [mandatory] [ meta, hets ]
tuple val(meta), path(cbs_cov) // channel: [mandatory] [ meta, cbs_cov ]
tuple val(meta), path(hets), path(cbs_cov) // channel: [mandatory] [ meta, hets ]
val(field) // channel: [mandatory] "foreground" for dryclean/ "ratio"
val(hets_thresh) // channel: cutoff for hetpileups; default=0.2
val(penalty) // channel: penalty for ASCAT; default=70
Expand Down
18 changes: 6 additions & 12 deletions modules/local/jabba/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ process JABBA {
'mskilab/jabba:latest' }"

input:
tuple val(meta), path(cov_rds)
tuple val(meta), path(junction)
tuple val(meta), val(ploidy)
tuple val(meta), val(het_pileups_wgs)
tuple val(meta), val(cbs_seg_rds)
tuple val(meta), val(cbs_nseg_rds)
tuple val(meta), val(j_supp)
tuple val(meta), path(junction), path(cov_rds), val(j_supp), val(het_pileups_wgs), val(ploidy), val(cbs_seg_rds), val(cbs_nseg_rds)
val(blacklist_junctions) // this is declared as val to allow for "NULL" default value, but is treated like a path
val(geno)
val(indel)
Expand Down Expand Up @@ -98,9 +92,13 @@ process JABBA {
set +x
export cmd="Rscript \$jba $junction $cov_rds \\
$j_supp \\
$het_pileups_wgs \\
--ploidy $ploidy \\
$cbs_seg_rds \\
$cbs_nseg_rds \\
--blacklist.junctions $blacklist_junctions \\
$geno_switch \\
$j_supp \\
--indel $indel \\
--tfield $tfield \\
--iterate $iter \\
Expand All @@ -111,12 +109,8 @@ process JABBA {
$strict_switch \\
$allin_switch \\
--field $field \\
$cbs_seg_rds \\
--maxna $maxna \\
--blacklist.coverage $blacklist_coverage \\
$cbs_nseg_rds \\
$het_pileups_wgs \\
--ploidy $ploidy \\
--purity $purity \\
--ppmethod $pp_method \\
--cnsignif $cnsignif \\
Expand Down
16 changes: 5 additions & 11 deletions subworkflows/local/allelic_cn/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ include { LP_PHASED_BALANCE } from '../../../modules/local/allelic_cn/main.nf'

workflow COV_GGRAPH_NON_INTEGER_BALANCE {
take:
jabba_rds_non_integer_balance // [meta, ggraph]
decomposed_cov_non_integer_balance // [meta, cov]
het_pileups_wgs_non_integer_balance // [meta, hets]
inputs_non_integer_balance // [ meta, ggraph, cov, hets ]
field_non_integer_balance
hets_thresh_non_integer_balance
mask_non_integer_balance
Expand All @@ -19,7 +17,7 @@ workflow COV_GGRAPH_NON_INTEGER_BALANCE {
epgap_non_integer_balance
tilim_non_integer_balance
gurobi_non_integer_balance
fasta_non_integer_balance // path to decoy fasta
fasta_non_integer_balance // path to decoy fasta
pad_non_integer_balance

main:
Expand All @@ -28,9 +26,7 @@ workflow COV_GGRAPH_NON_INTEGER_BALANCE {
non_integer_balance_hets_gg = Channel.empty()

NON_INTEGER_BALANCE(
jabba_rds_non_integer_balance,
decomposed_cov_non_integer_balance,
het_pileups_wgs_non_integer_balance,
inputs_non_integer_balance,
field_non_integer_balance,
hets_thresh_non_integer_balance,
mask_non_integer_balance,
Expand Down Expand Up @@ -61,8 +57,7 @@ workflow COV_GGRAPH_NON_INTEGER_BALANCE {

workflow COV_GGRAPH_LP_PHASED_BALANCE {
take:
hets_gg_lp_phased_balance // [meta, ggraph]
het_pileups_wgs_lp_phased_balance // [meta, hets]
inputs_lp_phased_balance // [ meta, ggraph, hets ]
lambda_lp_phased_balance
cnloh_lp_phased_balance
major_lp_phased_balance
Expand All @@ -87,8 +82,7 @@ workflow COV_GGRAPH_LP_PHASED_BALANCE {
lp_phased_balance_unphased_allelic_gg = Channel.empty()

LP_PHASED_BALANCE(
hets_gg_lp_phased_balance, // [meta, ggraph]
het_pileups_wgs_lp_phased_balance, // [meta, hets]
inputs_lp_phased_balance,
lambda_lp_phased_balance,
cnloh_lp_phased_balance,
major_lp_phased_balance,
Expand Down
17 changes: 8 additions & 9 deletions subworkflows/local/cov_ascat/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ include { EXTRACT_PURITYPLOIDY } from '../../../modules/local/ascat/main'
workflow COV_ASCAT {

take:
hetpileups // channel: [mandatory] [ meta, hets ]
cbs_cov // channel: [mandatory] [ meta, cbs_cov ]
field // channel: [mandatory] "foreground" for dryclean/ "ratio"
hets_threshold // channel: cutoff for hetpileups; default=0.2
penalty // channel: penalty for ASCAT; default=70
gc_correct // channel: perform GC correction? Default=TRUE
rebin_width // channel: width for rebinning, default=5e4
from_maf // channel: whether to start from MAF, default=FALSE
inputs // [ meta, hets, cbs_cov ]
field
hets_threshold
penalty
gc_correct
rebin_width
from_maf


main:
Expand All @@ -26,7 +25,7 @@ workflow COV_ASCAT {
purity = Channel.empty()
ploidy = Channel.empty()

ASCAT_SEG(hetpileups, cbs_cov, field, hets_threshold, penalty, gc_correct, rebin_width, from_maf)
ASCAT_SEG(inputs, field, hets_threshold, penalty, gc_correct, rebin_width, from_maf)

ascat_pp = Channel.empty().mix(ASCAT_SEG.out.purityploidy)
EXTRACT_PURITYPLOIDY(ascat_pp)
Expand Down
Loading

0 comments on commit 17be003

Please sign in to comment.