Deprecated!
Limited error handling. Use this instead.
The /genome-file-bulk-upload/ endpoint can be used for uploading an archive containing multiple genome files and a file manifest linking each genome file to a profile or sample id.
To bulk upload genome files, follow the following steps:
- Call the /genome-file/upload-file/ endpoint. This will return a pre-signed POST URL to s3 with authentication fields and a
file_id. It is a temporary ID to identify the uploaded file. - After completing the file upload, include the file_id in the payload when creating a bulk upload (POST /genome-file-bulk-upload/), as shown below in examples. Note: File IDs will expire after a couple of hours.
Additional guidance for /bulk-upload/
- We accept zip and compressed tar archives.
- Your archive must contain a file with
manifestin the filename.- Most users will need only two columns in their manifest:
filename: the path of each file in the archive (required)profile id: the UUID of the SelfDecode profile (required)
- If uploading sequencing lab results from DNA samples registered with the
/product/dna-sample/endpoint, your manifest will need three columns:filename: the path of each file in the archive (required)sample id: the ID of the registered DNA kitcall rate: the call rate of the sample generated during processing
- Most users will need only two columns in their manifest:
- After the upload finishes processing, a GET request with the upload id will return the status of the upload and the genome file UUIDs of the created genome files.
- Scan jobs will start automatically.
Examples
Python example code to upload file to s3 + create a bulk upload with file_id.
import requests
headers = {"Authorization": "Token XYZ"}
base_url = "https://qa-b2b.selfdecode.com/service/b2b-integrations/"
# Step 1: Upload your DNA file to s3
# get presgined POST url
response = requests.post(base_url + "genome-file/upload-file/", headers=headers, timeout=30).json()
url, fields, file_id = response["url"], response["fields"], response["file_id"]
file_path = "genome_file.txt"
# upload file to s3, assuming your file is named "genome_file.txt" and placed in the same directory as this Python module
with open(file_path, "rb") as f:
files = {"file": ("genome_file.txt", f)}
requests.post(url, data=fields, files=files, timeout=60)
# Step 2: Trigger your genome file processing, by passing the `file_id` to the first report job you create.
# bulk upload with file_id
base_payload = {
"file_id": file_id,
}
response = requests.post(base_url + "genome-file-bulk-upload/", headers=headers, json=base_payload)
