Skip to content
Snippets Groups Projects
Commit 3a16480f authored by Bryan Brancotte's avatar Bryan Brancotte
Browse files

add cli and test data

parent 07b3e770
No related branches found
No related tags found
1 merge request!1Build package
import click
from src.nextflow_file import Nextflow_File
@click.command()
@click.argument('main_workflow_path')
@click.option('--author', 'author', required=False, help='Author name, extracted otherwise')
@click.option('--name', 'name', required=False, help='Workflow name, extracted otherwise')
@click.option('--output-dir', default='./results', help='Where the results will be written')
@click.option(
'--no-duplicate',
'duplicate',
required=False,
default=True,
is_flag=True,
help=''
'When processes and subworkflows are duplicated in the workflows by the \'include as\' option, '
'this option will duplicate the procedures in the graph output.',
)
@click.option(
'--graph-in-dot-only',
'render_graphs',
required=False,
default=True,
is_flag=True,
help='Generate the graph output only in dot format, not png (faster).',
)
def cli_command(main_workflow_path, **kwargs):
return cli(main_workflow_path, **kwargs)
def cli(main_workflow_path, render_graphs: bool, **kwargs):
"""
The path to main file, subworkflows and modules must be in direct subdir of this file,
in folders with eponymous names.
"""
w = Nextflow_File(address=main_workflow_path, **kwargs)
w.initialise()
w.generate_all_graphs(render_graphs=render_graphs)
if __name__ == '__main__':
cli_command()
//include { p1 as p1_1; p1 as p1_2} from './modules/p1'
//include { wf1 as wf1_1; wf1 as wf1_2 } from './subworkflows/wf1'
include { wf1 as wf1_1 } from './subworkflows/wf1'
//include { wf1 as wf1_2 } from './subworkflows/wf1'
workflow {
a = channel.empty()
//c = wf1_1(a)
//c = wf1_2(b)
b = wf1_1(a)
//c = p1_1(p1_2(wf1_2(wf1_1(a))))
//wf1_1(a)
// | wf1_2
// | p1_2
// | p1_1
//(a, b) = p1_1(a)
//(ch1, ch2) = (params.ped ? [a, Channel.empty()]: [Channel.empty(), b])
//(ch1, ch2) = a.into(2)
}
\ No newline at end of file
process p1 {
input:
file(input)
output:
file(output_1)
file(output_2)
"""
something
"""
}
include { p1 } from '../modules/p1'
workflow wf1 {
take:
input_wf1
main:
output_wf1 = p1(input_wf1)
emit:
//val = output_wf1
output_wf1
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment