nf-synapse @ 0.1.2
Summary
A Nextflow plugin for accessing Synapse (Sage Bionetworks) files using syn:// URIs. The plugin enables transparent reading of Synapse files directly in pipelines and publishing pipeline outputs to Synapse folders using publishDir. It supports versioned files, automatic subfolder creation, secure authentication via Nextflow secrets, and use of Synapse URIs in samplesheets.
Get Started
Installation
Add to your nextflow.config:
plugins {
id 'nf-synapse@0.1.1'
}
Nextflow will automatically download the plugin from the Nextflow plugin registry.
Configuration
Set your Synapse Personal Access Token as a Nextflow secret:
nextflow secrets set SYNAPSE_AUTH_TOKEN syn_pat_xxxxxxxxxx
You can create a Personal Access Token at: https://www.synapse.org/#!PersonalAccessTokens:
The plugin automatically looks for a secret named SYNAPSE_AUTH_TOKEN. For optional custom endpoint configuration:
synapse {
endpoint = 'https://repo-prod.prod.sagebase.org' // default
}
Examples
Direct File Access
// Access a Synapse file (latest version)
synapse_file = file('syn://syn26947830')
// Access a specific version
versioned_file = file('syn://syn26947830.1')
In a Process
process ANALYZE {
input:
path input_file
output:
path "result.txt"
script:
"""
echo "Processing: ${input_file}"
analyze.sh ${input_file} > result.txt
"""
}
workflow {
synapse_file = file('syn://syn26947830')
ANALYZE(synapse_file)
}
With Samplesheets
// samplesheet.csv:
// sample_id,synapse_uri
// sample1,syn://syn26947830
// sample2,syn://syn26947830.1
Channel.fromPath('samplesheet.csv')
.splitCsv(header: true)
.map { row -> tuple(row.sample_id, file(row.synapse_uri)) }
.set { samples_ch }
samples_ch.view { sample_id, f -> "Sample: ${sample_id}, File: ${f.name}" }
Publishing to Synapse
params.outDir = 'syn://syn25858544' // Synapse folder ID
process ANALYZE {
publishDir params.outDir, mode: 'copy'
input:
path input_file
output:
path "results.txt"
script:
"""
analyze.sh ${input_file} > results.txt
"""
}
Publishing to Subfolders
process ANALYZE {
publishDir "${params.outDir}/${sample_id}/results", mode: 'copy'
input:
tuple val(sample_id), path(input_file)
output:
path "output.txt"
script:
"""
analyze.sh ${input_file} > output.txt
"""
}
License
Apache License 2.0
| Nextflow version | >=25.04.0 |
|---|---|
| Depends On | - |
| Release Date | 25 Feb 2026 09:47:15 (UTC) |
| Release Notes | https://github.com/Sage-Bionetworks-Workflows/nf-synapse-plugin/releases/tag/0.1.2 |
| Download URL | https://registry.nextflow.io/api/v1/plugins/nf-synapse/0.1.2/download/nf-synapse-0.1.2.zip |
| Store URL | https://public.cr.seqera.io/v2/nextflow/plugin/nf-synapse/blobs/sha256:6ce078f2af100a73eb39e2e3632277d20d5fe4e4ec68d356e4aa9a7cbb30c808 |
| Size | 58.6 KB |
| Checksum | ebda0fea8c89cebba4d6cae9fbe2ac4bebbae628986489a85d5144603405eb394f373a22077ccbdd331cc5a0602cf268f8b03000ef120c033538d2cb02333b4a |
| Total downloads | 17 View trends |
| Security Scan |