{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Create a shell case and link its files","description":"Reference, guides and recipes for the Franklin API — create cases, link sample files, retrieve variants and reports."},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"create-a-shell-case-and-link-its-files","__idx":0},"children":["Create a shell case and link its files"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["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 ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["link"]}," them, and Franklin starts processing."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"create shell case ──► upload files to your bucket ──► link files ──► processing starts\n      (v2)                   (outside the API)             (v2)\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"1-create-the-shell-case","__idx":1},"children":["1. Create the shell case"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/shell-case/createshellcasev2"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v2/shell_case/create"]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"case = client.request(\"POST\", \"/v2/shell_case/create\", json={\n    \"case_name\": \"PAT-001_WES\",\n    \"case_type\": \"single\",\n    \"assay_id\": \"assay-uuid-123\",\n    \"virtual_panels\": [\"Epilepsy Panel\"],\n    \"assigned_to\": \"analyst@yourlab.com\",\n    \"samples_data\": [{\n        \"sample_name\": \"PAT-001_S1\",\n        \"patient_details\": {\n            \"patient_id\": \"PAT-001\",\n            \"sex\": \"male\",\n            \"dob\": \"1990-05-15\",\n            \"phenotypes\": [\"HP:0001250\"]\n        }\n    }]\n})\ncase.raise_for_status()\nanalysis_id = case.json()[\"analysis_id\"]\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{ \"analysis_id\": 12345, \"analysis_name\": \"PAT-001_WES\" }\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Store ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["analysis_id"]}," against your order; every later call uses it. Keep ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sample_name"]}," too: linking is done by sample name."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Family cases:"]}," set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"case_type\": \"family\""]},", and give each entry in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["samples_data"]}," a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["family_relation"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["proband"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mother"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["father"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sibling"]},", …) and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["affected"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Errors to handle"]}," (all ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]},", and nothing is created):"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"message"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["message"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Cause"},"children":["Cause"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Panels not found: …"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A virtual or hard panel name doesn't exist in your organization"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Assay … does not exist"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Invalid assay id: not a valid UUID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Wrong ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["assay_id"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Sample … already exists"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Case … already exists"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Names must be unique. Often a retry after a timeout: look the case up instead"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Invalid family relations: …"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Relation not in the allowed list, which the message includes"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Invalid assignedTo email: …"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["assigned_to"]}," isn't a user in your organization"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"2-upload-the-files","__idx":2},"children":["2. Upload the files"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"aws s3 cp PAT-001_S1.vcf.gz s3://<your-upload-bucket>/uploads/PAT-001_S1/PAT-001_S1.vcf.gz\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"3-link-the-files","__idx":3},"children":["3. Link the files"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/shell-case/linkshellcasev2"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v2/shell_case/link"]}]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["key"]}," is the object's path inside your upload bucket, and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}," says what the file is."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"link = client.request(\"POST\", \"/v2/shell_case/link\", json={\n    \"sample_name\": \"PAT-001_S1\",\n    \"sample_files_aws_details\": [\n        {\"key\": \"uploads/PAT-001_S1/PAT-001_S1.vcf.gz\",    \"type\": \"VCF_SHORT\"},\n        {\"key\": \"uploads/PAT-001_S1/PAT-001_S1.sv.vcf.gz\", \"type\": \"VCF_SV\"}\n    ]\n})\nlink.raise_for_status()   # {\"success\": true}\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Common ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}," values: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VCF_SHORT"]}," (small variants), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VCF_SV"]}," (structural variants/CNV), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VCF_REPEATS"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FASTQ"]}," (list every read file), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BAM"]}," + ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BAI"]},". The ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/shell-case/linkshellcasev2"},"children":["endpoint reference"]}," has the full list."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Errors to handle"]}," (all ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]},"):"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"message"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["message"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Cause"},"children":["Cause"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Sample '…' not found"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sample_name"]}," doesn't match the name used at create"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Sample files not found in configured buckets (…): …"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Wrong ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["key"]},", or the upload hasn't finished. The message lists the missing keys"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Insufficient sample files: Expected at least 2 file(s) of type FASTQ but found 1"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The assay needs more files, e.g. both FASTQ reads"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Cannot link sample files to shell case '…' since it already contains sample files (…)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Already linked. Linking isn't repeatable"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Unrecognized file types: …"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Typo in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"4-follow-processing","__idx":4},"children":["4. Follow processing"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Linking starts file transfer and annotation. Poll the case until it's ready, as in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/recipes/track-analysis-status"},"children":["Track analysis status"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"variations","__idx":5},"children":["Variations"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Update before linking:"]}," change panels, patient details, labels or the assignee with ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/shell-case/updateshellcasev2"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v2/shell_case/update"]}]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["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 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sample_files_location"]}," on the sample at create time; ask Franklin support to configure it."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Files already uploaded:"]}," skip the shell case and create the case with files in one call with ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/analysis-creation/createanalyses"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/analyses/create"]}]},"."]}]}]},"headings":[{"value":"Create a shell case and link its files","id":"create-a-shell-case-and-link-its-files","depth":1},{"value":"1. Create the shell case","id":"1-create-the-shell-case","depth":2},{"value":"2. Upload the files","id":"2-upload-the-files","depth":2},{"value":"3. Link the files","id":"3-link-the-files","depth":2},{"value":"4. Follow processing","id":"4-follow-processing","depth":2},{"value":"Variations","id":"variations","depth":2}],"frontmatter":{"seo":{"title":"Create a shell case and link its files"}},"lastModified":"2026-09-30T21:14:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/recipes/shell-case-and-link-files","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}