Skip to content

This repo houses scripts and guidelines on publishing a CWL app as a public app on Cavtica

License

Notifications You must be signed in to change notification settings

kids-first/kf-cavatica-public-app-publisher

Repository files navigation

Kids First repository logo

Kids First Cavatica Public App Publisher

This repo contains a script to patch CWL tool and/or workflow scripts for public app use on Cavatica. It satisfies the requirements as laid out here

cavatica_app_pub.py

Requirements

  • python3
  • ruamel yaml: pip install ruamel.yaml

Inputs

parser.add_argument('-i', '--input-cwl', action='store', dest='cwl', help='Input cwl file',required=True)
parser.add_argument('-r', '--readme', action='store', dest='readme', help='Readme file to insert into workflow/tool doc, if applicable', required=False)
parser.add_argument('-n', '--id-name', action='store', dest='id_name', help='Short app ID link name to use, i.e. kfdrc-align-wf', required=False)
parser.add_argument('-l', '--label', action='store', dest='label', help='User-friendly label to add to tool/workflow cwl, if needed', required=False)
parser.add_argument('-t', '--tags', action='store', dest='tags', help='Seven bridges tags file, as csv string, ex RNASEQ,FUSION', required=False)
parser.add_argument('-f', '--files', action='store', dest='files', help='Cavatica-style tsv manifest with file ID, file name, associated cwl input key, and, optionally, secondaryFile name and IDs', required=False)
parser.add_argument('-p', '--publisher', action='store', dest='pub', help='Publisher name', required=False, default="KFDRC")

Input tips

  1. -r, --readme: There is no need to copy in or write up a README and comprehensive doc section. The README can be fed to the script and it will automatically place it. Also, in the README, put the general workflow description first before the main header and logo - that way the public app preview will display properly
  2. -n, --id-name: Short app ID, should be kfdrc-what-it-do-tool/workflow
  3. -l, --label: User-friendly display name, like Kids First DRC Alignment Workflow
  4. -t, --tags: Keywords in csv string format that users will be able to search, like DNA,ALIGNMENT
  5. -f, --files: tsv file manifest with file IDs, file names, cwl input references, and, optionally, any secondaryFile information. The fields for secondaryFile information also accepts comma-separated lists for files that have multiple secondaryFiles. If your file has no secondaryFiles, you can leave the snames and sfids fields empty or simply write None. Use template_files/align_inputs_manifest_APP_PUB.tsv as an example. If input is an array, just put one per line, using same input key. If order matters, then order them in the correct way
  6. -p, --publisher: simple identifier of center, likely KFDRC, unless it;s another center

General tips

  1. All but the input cwl is optional, so if you want to fix something later, only pick the field you need to update
  2. The file will be output to stdout, it's probably a good idea if you want to keep he file name, to rename the old one until the PR is approved
  3. After updating the cwl, push the app to make sure it loads and copies/pre-populates files
  4. Check the app preview after uploading

cp_files_to_project.py

Simple script to copy final references from a source project to apps publishing project. It will search the destination project and, if the file name already exists, use the existing file ID of the destination, or copy the file if not, and provide the new file ID. Output is to stdout

Inputs

parser.add_argument('-f', '--files', action='store', dest='files', help='Cavatica-style tsv manifest with file ID, file name, and associated cwl input key', required=False)
parser.add_argument('-p', '--project', action='store', dest='project', help='Project to copy to', required=True, default="cavatica/apps-publisher")
parser.add_argument('-n', '--profile', action='store', dest='profile', help='Cavatica profile name', required=True, default="cavatica")

Input tips

  1. -f, --files: Use the same manifest as for the pub script
  2. -p, --project: Cavatica project name to copy to, likely cavatica/apps-publisher
  3. -n, --profile: This script runs on the assumption that you have a local .sevenbridges/credentials file.

You'll likely end up having to run just the -f portion of the cavatica_app_pub.py again for the final file locations

About

This repo houses scripts and guidelines on publishing a CWL app as a public app on Cavtica

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages