Flow Logo

API Documentation

Uploading Data via the API

Uploading data via our Python API can be a convenient way to upload large files, or many files.

To install flowbio, run:

pip install git+https://github.com/goodwright/flowbio.git

v0.2 will be on PyPI soon.

Here is an example script to upload data, or samples:

import flowbio

client = flowbio.Client()
client.login("your_username", "your_password")

# Upload standard data
data = client.upload_data("/path/to/file.fa", progress=True)
print(data)

# Upload sample
sample = client.upload_sample(
    "My Sample Name",
    "/path/to/reads1.fastq.gz",
    "/path/to/reads2.fastq.gz", # optional
    progress=True,
    metadata={
        "category": "RNA-Seq",
        "strandedness": "unstranded",
    }
)
print(sample)

# Upload lane
lane = client.upload_lane(
    "My Lane Name",
    "/path/to/annotation.xlsx",
    "/path/to/multiplexed.fastq.gz",
    ignore_warnings=True,
    progress=True
)
print(lane)

It will upload in 1MB chunks. You can change this with the chunk_size parameter. So to upload in 5MB chunks, for example, you would run:

client.upload_data("/path/to/file.fa", progress=True, chunk_size=5_000_000)
Previous
Quickstart