A shell case is a case created before its sequencing files exist. Your LIMS registers the case with patient details, panels and assay as soon as the order arrives. When the files are ready you link them, and Franklin starts processing.
create shell case ──► upload files to your bucket ──► link files ──► processing starts
(v2) (outside the API) (v2)case = client.request("POST", "/v2/shell_case/create", json={
"case_name": "PAT-001_WES",
"case_type": "single",
"assay_id": "assay-uuid-123",
"virtual_panels": ["Epilepsy Panel"],
"assigned_to": "analyst@yourlab.com",
"samples_data": [{
"sample_name": "PAT-001_S1",
"patient_details": {
"patient_id": "PAT-001",
"sex": "male",
"dob": "1990-05-15",
"phenotypes": ["HP:0001250"]
}
}]
})
case.raise_for_status()
analysis_id = case.json()["analysis_id"]{ "analysis_id": 12345, "analysis_name": "PAT-001_WES" }Store analysis_id against your order; every later call uses it. Keep sample_name too: linking is done by sample name.
Family cases: set "case_type": "family", and give each entry in samples_data a family_relation (proband, mother, father, sibling, …) and affected.
Errors to handle (all 400, and nothing is created):
message | Cause |
|---|---|
Panels not found: … | A virtual or hard panel name doesn't exist in your organization |
Assay … does not exist / Invalid assay id: not a valid UUID | Wrong assay_id |
Sample … already exists / Case … already exists | Names must be unique. Often a retry after a timeout: look the case up instead |
Invalid family relations: … | Relation not in the allowed list, which the message includes |
Invalid assignedTo email: … | assigned_to isn't a user in your organization |
Upload the sample's files to your organization's upload bucket, the S3 location Franklin configured for you during onboarding. This happens outside the Franklin API, with your usual S3 tooling:
aws s3 cp PAT-001_S1.vcf.gz s3://<your-upload-bucket>/uploads/PAT-001_S1/PAT-001_S1.vcf.gzPOST /v2/shell_case/link: key is the object's path inside your upload bucket, and type says what the file is.
link = client.request("POST", "/v2/shell_case/link", json={
"sample_name": "PAT-001_S1",
"sample_files_aws_details": [
{"key": "uploads/PAT-001_S1/PAT-001_S1.vcf.gz", "type": "VCF_SHORT"},
{"key": "uploads/PAT-001_S1/PAT-001_S1.sv.vcf.gz", "type": "VCF_SV"}
]
})
link.raise_for_status() # {"success": true}Common type values: VCF_SHORT (small variants), VCF_SV (structural variants/CNV), VCF_REPEATS, FASTQ (list every read file), BAM + BAI. The endpoint reference has the full list.
Errors to handle (all 400):
message | Cause |
|---|---|
Sample '…' not found | sample_name doesn't match the name used at create |
Sample files not found in configured buckets (…): … | Wrong key, or the upload hasn't finished. The message lists the missing keys |
Insufficient sample files: Expected at least 2 file(s) of type FASTQ but found 1 | The assay needs more files, e.g. both FASTQ reads |
Cannot link sample files to shell case '…' since it already contains sample files (…) | Already linked. Linking isn't repeatable |
Unrecognized file types: … | Typo in type |
Linking starts file transfer and annotation. Poll the case until it's ready, as in Track analysis status.
- Update before linking: change panels, patient details, labels or the assignee with
POST /v2/shell_case/update. - Automatic linking: if your organization is set up for implicit linking, files dropped in a folder named after the sample link themselves, and step 3 isn't needed. Set
sample_files_locationon the sample at create time; ask Franklin support to configure it. - Files already uploaded: skip the shell case and create the case with files in one call with
POST /v1/analyses/create.