matsengrp / phip-flow

A Nextflow pipeline to align, merge, and organize large PhIP-Seq datasets
MIT License
9 stars 6 forks source link

parse_config sub-workflow #42

Closed jgallowa07 closed 1 year ago

jgallowa07 commented 2 years ago

Wewill create a primary processes to parse the configuration provided by the user to validate and prep input to generate_counts pipeline.

The psuedo workflow code will look something like this:

nextflow.enable.dsl=2
include { ALIGN_COUNTS as generate_alignment_counts } from './workflows/alignment-counts-workflow.nf'
include { cpm_fold_enrichment as compute_cpm_fold_enrichment } from './workflows/enrichment-workflow.nf'
include { to_tall as write_ds_to_tall_csv } from './workflows/io.nf'
include { to_wide as write_ds_to_wide_csv } from './workflows/io.nf'

workflow {

    // validate and set flags (emission channels) for downstream
    // analysis to run. generate or modify sample table depending on input
    parse_config()

    // generate raw dataset
    generate_alignment_counts(
        parse_config.out.sample_table,
        parse_config.out.peptide_table,
    )

    // example running cpm-fold-enrichment 
    compute_cpm_fold_enrichment(
        generate_alignment_counts.out,
        parse_config.out.foo // named channel in the emimssion block, optional depending on parse.
    )

    // some other downstream analysis
    fit_predict_neg_binom(...)

    // merge the separate analysis
    merge_analysis()

    // downstream analysis
    if( params.output_tall ) 
        write_ds_to_tall_csv(ds)

    if( params.output_wide )
        write_ds_to_wide_csv(ds)
}