Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 3.29 KB

CONTRIBUTING.md

File metadata and controls

46 lines (30 loc) · 3.29 KB

Contributing New Workflows

In order to contribute to nf-synapse, you will first need to either create a feature branch on the main repository (if you are a Sage Bio employee) or fork the repository and create a feature branch on your fork. Once you have a branch or fork, you can create a new workflow by following the steps below.

Create New Modules

Before you begin creating any new modules, be sure to look at those that already exist in the modules/ directory. You may find that you can reuse an existing module rather than creating a new one.

Based on the purpose of your workflow, you may need to create one or more modules. In this repository, a module is a Nextflow process that performs a single task. For example, a module may be responsible for downloading a file from Synapse like in the SYNAPSE_GET module. Create any modules necessary for your workflow and store them as individual .nf files with names that are lowercase representations of the name of the process you are creating.

Create New Workflow

Once you have created all of the modules necessary for your workflow, you can create the workflow itself. Create a new workflow by adding a .nf file in the workflows/ directory. This file should contain a single Nextflow workflow that combines the modules you created in the previous step with any needed extra logic in between processes. Be sure to give your workflow and its file a unique name that describes the goal it is trying to achieve.

Add New Workflow to main.nf

After your workflow is complete, you will need to add it to the main.nf file. This file provides the entrypoint for running any workflow in this repository. Follow the example set by the NF_SYNSTAGE workflow:

  1. Write a comment that describes the purpose of your workflow.
  2. Add the include statement to import your workflow to main.nf.
  3. Add your workflow to main.nf. Follow the naming convention of NF_<WORKFLOW_NAME> as shown in the example.

Example:

// Synstage - Stage files from Synapse to Nextflow Tower S3 Bucket
include { SYNSTAGE } from './workflows/synstage.nf'

workflow NF_SYNSTAGE {
    SYNSTAGE ()
}

Test Your Workflow Locally

Once your workflow is added to main.nf with a unique name, it is now accessible to be run with the entry parameter. If it is possible to do so, test the workflow on your local machine using the Nextflow CLI. It will be much easier to debug any problems you encounter locally before running on Nextflow Tower. Example:

nextflow run main.nf -profile docker -entry NF_<WORKFLOW_NAME> --my_param my_param_value

Test Your Workflow in Nextflow Tower

Using the Tower CLI, or the Tower Web UI run your workflow and ensure that it completes successfully and with the intended results. Be sure to provide the name of your branch as the revision(and the URL to your fork, if applicable) to the Tower run.

Update The README

Before submitting your pull request, update the README.md file to include a description of your workflow. Follow the example set by the NF_SYNSTAGE section and include all relavent sections.