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.
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.
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.
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:
- Write a comment that describes the purpose of your workflow.
- Add the
include
statement to import your workflow tomain.nf
. - Add your workflow to
main.nf
. Follow the naming convention ofNF_<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 ()
}
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
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.
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.