{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Track analysis status","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":"track-analysis-status","__idx":0},"children":["Track analysis status"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After files are linked, Franklin transfers them, runs the pipeline if needed, and annotates the variants. This recipe tells when a case is ready for review, and keeps your system in sync with case status."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"two-different-statuses","__idx":1},"children":["Two different statuses"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/analysis-status/getanalysisstatus"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/analyses/status"]}]}," returns both for up to 100 cases per call:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"r = client.request(\"POST\", \"/v1/analyses/status\", json={\"analysis_ids\": [12345, 12346]})\nr.raise_for_status()\nfor a in r.json():\n    print(a[\"id\"], a[\"status\"], a[\"processing_status\"], a[\"last_annotated\"])\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"[\n  { \"id\": 12345, \"name\": \"PAT-001_WES\", \"status\": \"IN_PROGRESS\",\n    \"processing_status\": \"READY\", \"assay_id\": \"assay-uuid-123\",\n    \"created_at\": \"2024-01-15\", \"last_annotated\": \"2024-01-15 11:00:00 UTC\" }\n]\n","lang":"json"},"children":[]},{"$$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":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Tells you"},"children":["Tells you"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Set by"},"children":["Set by"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["processing_status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Whether the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["data"]}," is ready: files transferred, pipeline and annotation done"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Franklin"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Where the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["case"]}," is in your lab's workflow: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PENDING"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IN_PROGRESS"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RESOLVED"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CANCELLED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your users in Franklin"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"processing_status-values","__idx":2},"children":["processing_status values"]},{"$$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":"Value"},"children":["Value"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Meaning"},"children":["Meaning"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NEW"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UPLOADING"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UPLOAD_DONE"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Files are being received"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PROCESSING_PIPELINE"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PIPELINE_DONE"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Secondary analysis is running or finished (FASTQ input)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PROCESSING_ANNOTATION"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Variants are being annotated"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["READY"]}]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Every annotation for the case has finished. The case can be reviewed and its variants retrieved"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PENDING_FILES"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A shell case whose files haven't been linked yet"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PARTIAL_ANNOTATION"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Annotation completed only partly. Contact support if it doesn't progress"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ARCHIVED"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IN_ARCHIVING_PROCESS"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The case's files have been moved to archive storage"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ERROR"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ERROR_UPLOAD"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ERROR_PIPELINE"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ERROR_ANNOTATION"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Processing failed. Contact support with the analysis ID"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An ID that doesn't exist, or isn't in your organization, comes back with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status: \"INVALID\""]}," and an empty ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["processing_status"]},". The call itself doesn't fail."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"wait-until-a-case-is-ready","__idx":3},"children":["Wait until a case is ready"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Poll gently; processing takes minutes to hours depending on the input."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"import time\n\nTERMINAL_ERRORS = {\"ERROR\", \"ERROR_UPLOAD\", \"ERROR_PIPELINE\", \"ERROR_ANNOTATION\"}\n\ndef wait_until_ready(client, analysis_ids, interval=300):\n    pending = set(analysis_ids)\n    while pending:\n        r = client.request(\"POST\", \"/v1/analyses/status\", json={\"analysis_ids\": sorted(pending)[:100]})\n        r.raise_for_status()\n        for a in r.json():\n            if a[\"processing_status\"] == \"READY\":\n                print(f\"{a['id']} ready\")\n                pending.discard(a[\"id\"])\n            elif a[\"processing_status\"] in TERMINAL_ERRORS or a[\"status\"] == \"INVALID\":\n                print(f\"{a['id']} failed: {a['processing_status'] or a['status']}\")\n                pending.discard(a[\"id\"])\n        if pending:\n            time.sleep(interval)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Batch your IDs: one call for 100 cases is far cheaper than 100 calls, and less likely to hit the rate limit."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"look-up-by-name","__idx":4},"children":["Look up by name"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you only stored your own identifier as the case name, use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/analysis-status/getanalysisstatusbyname"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/analyses/status_by_name"]}]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"r = client.request(\"POST\", \"/v1/analyses/status_by_name\", json={\"analysis_name\": \"PAT-001_WES\"})\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"sync-workflow-status-to-your-system","__idx":5},"children":["Sync workflow status to your system"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To pick up cases your users resolved since the last sync, list them with ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/analysis-list/listanalyses"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/analyses/list"]}]},", then fetch their details:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"r = client.request(\"GET\", \"/v1/analyses/list\", params={\n    \"status\": \"RESOLVED\",\n    \"status_change_after\": \"2024-01-14\",     # yyyy-MM-dd, day granularity\n})\nids = [i for group in r.json()[\"analyses_by_assay\"].values() for i in group]\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The result is grouped by assay: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{\"assay-uuid-123\": [12345, 12346], \"no-assay-configured\": [12348]}"]},". The date filters are day-granular, so overlap your window by a day and de-duplicate on your side. When the case is resolved, continue with ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/recipes/workbench-to-signed-report"},"children":["From workbench to signed report"]},"."]}]},"headings":[{"value":"Track analysis status","id":"track-analysis-status","depth":1},{"value":"Two different statuses","id":"two-different-statuses","depth":2},{"value":"processing_status values","id":"processing_status-values","depth":3},{"value":"Wait until a case is ready","id":"wait-until-a-case-is-ready","depth":2},{"value":"Look up by name","id":"look-up-by-name","depth":2},{"value":"Sync workflow status to your system","id":"sync-workflow-status-to-your-system","depth":2}],"frontmatter":{"seo":{"title":"Track analysis status"}},"lastModified":"2026-09-30T21:14:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/recipes/track-analysis-status","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}