diff --git a/bioflow_insight_cli/main.py b/bioflow_insight_cli/main.py index 31fdc4fdbe886341c1196358e416d5190f56b624..e62a8c50c4fc3225d6b644b0e02ba16f65e3c7b1 100644 --- a/bioflow_insight_cli/main.py +++ b/bioflow_insight_cli/main.py @@ -7,23 +7,6 @@ from src.workflow import Workflow @click.command() @click.version_option(bioflow_insight_src.__version__) @click.argument('main_workflow_path') -@click.option('--name', 'name', required=False, help='Workflow name, extracted otherwise (in the case of a Git repo).') -@click.option('--date-published', 'datePublished', required=False, help='Publication date ("yyyy-mm-dd"), extracted otherwise (in the case of a Git repo).') -@click.option('--description', 'description', required=False, help='Description of workflow, extracted otherwise (in the case of a Git repo).') -@click.option('--license', 'license', required=False, help='License of workflow, extracted otherwise (in the case of a Git repo).') -@click.option('--creative-work-status', 'creativeWorkStatus', required=False, help='Creative work status of workflow, extracted otherwise (in the case of a Git repo).') -@click.option('--version', 'version', required=False, help='Version of workflow, extracted otherwise (in the case of a Git repo).') -@click.option('--keywords', 'keywords', required=False, help='Keywords of workflow (fomat "keyword1, keyword2, ..."), extracted otherwise (in the case of a Git repo).') -@click.option('--producer', 'producer', required=False, help='Producer of workflow, extracted otherwise (in the case of a Git repo).') -@click.option('--publisher', 'publisher', required=False, help='Publisher of workflow, extracted otherwise (in the case of a Git repo).') -@click.option( - '--authors', - 'authors', - required=False, - help='' - 'Authors of workflow (format "[{\'@id\': "Author1", \'email\': "author1@email.com"}, ...]"), ' - 'extracted otherwise (in the case of a Git repo).', -) @click.option('--output-dir', default='./results', help='Where the results will be written.') @click.option( @@ -45,6 +28,30 @@ from src.workflow import Workflow help='Generate the graphs output in png format using graphviz (slower),' 'the mermaid and dot formats are always generated.', ) + + +@click.option('--name', 'name', required=False, help='Workflow name, extracted otherwise (in the case of a Git repo).') +@click.option( + '--authors', + 'authors', + required=False, + help='' + 'Authors of workflow (format "author1, author2, ..."),' + 'extracted otherwise (in the case of a Git repo).', +) + +@click.option('--keywords', 'keywords', required=False, help='Keywords of workflow (fomat "keyword1, keyword2, ..."), extracted otherwise (in the case of a Git repo).') +@click.option('--description', 'description', required=False, help='Description of workflow, extracted otherwise (in the case of a Git repo).') +@click.option('--date-published', 'datePublished', required=False, help='Publication date ("yyyy-mm-dd"), extracted otherwise (in the case of a Git repo).') + +@click.option('--license', 'license', required=False, help='License of workflow, extracted otherwise (in the case of a Git repo).') +@click.option('--creative-work-status', 'creativeWorkStatus', required=False, help='Creative work status of workflow, extracted otherwise (in the case of a Git repo).') +@click.option('--version', 'version', required=False, help='Version of workflow, extracted otherwise (in the case of a Git repo).') +@click.option('--producer', 'producer', required=False, help='Producer of workflow, extracted otherwise (in the case of a Git repo).') +@click.option('--publisher', 'publisher', required=False, help='Publisher of workflow, extracted otherwise (in the case of a Git repo).') + + + @click.option( '--display-info', 'display_info', @@ -53,6 +60,7 @@ from src.workflow import Workflow is_flag=True, help='Option to show a visual summary of the analysis.', ) + def cli_command(main_workflow_path, **kwargs): return cli(main_workflow_path, **kwargs) diff --git a/src/workflow.py b/src/workflow.py index 3e0423240ba6667f808e885709a6ac363fac1256..372bb998b4032ca54317dff180716db0d46a820a 100644 --- a/src/workflow.py +++ b/src/workflow.py @@ -158,7 +158,11 @@ class Workflow: tab.append({"@id":authors[author], "email":author}) return tab else: - return self.authors + authors = authors.split(',') + tab = [] + for a in authors: + tab.append({"@id":a.strip()}) + return tab #Need to follow this format : "rna-seq, nextflow, bioinformatics, reproducibility, workflow, reproducible-research, bioinformatics-pipeline"