Snakemake S3 Storage Plugin

0.3.6 · active · verified Thu Apr 16

The `snakemake-storage-plugin-s3` library provides a Snakemake storage plugin for interacting with S3-compatible object storage systems, including AWS S3, MinIO, and others. It allows Snakemake workflows to read and write files directly from/to S3 buckets using `s3://` URIs. The project is actively maintained with frequent bug fix releases, typically every few months, ensuring compatibility and robustness.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use the S3 storage plugin in a `Snakefile`. Snakemake automatically recognizes `s3://` prefixes for input and output files when the plugin is installed. Ensure your S3 credentials are configured in your environment or via standard `boto3` configuration methods (e.g., `~/.aws/credentials`). For S3-compatible services like MinIO, `AWS_ENDPOINT_URL` is typically required.

# file: Snakefile

# Set S3 credentials via environment variables for a runnable example
# export AWS_ACCESS_KEY_ID="YOUR_ACCESS_KEY"
# export AWS_SECRET_ACCESS_KEY="YOUR_SECRET_KEY"
# export AWS_ENDPOINT_URL="http://localhost:9000" # Optional, for MinIO or other S3-compatible storages

rule all:
    input: "s3://my-test-bucket/output.txt"

rule generate_s3_file:
    output: "s3://my-test-bucket/output.txt"
    shell:
        "echo 'Hello Snakemake S3!' > {output}"

# To run this example:
# 1. Ensure snakemake and snakemake-storage-plugin-s3 are installed.
# 2. Set your S3 credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, etc.)
#    or AWS_ENDPOINT_URL for compatible S3 services.
# 3. Create 'my-test-bucket' in your S3 service.
# 4. Navigate to the directory containing this Snakefile and run: snakemake

view raw JSON →