{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"From workbench to signed report","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":"from-workbench-to-signed-report","__idx":0},"children":["From workbench to signed report"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When your analysts have reviewed a case in Franklin, the variants they selected are in its ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["workbench"]},". This recipe pulls those variants back into your system, produces the report, and downloads the signed PDF."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"1-get-the-workbench","__idx":1},"children":["1. Get the workbench"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/analysis-query/getanalysisworkbenchwithbiomarkers"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1_3/analysis/workbench"]}]}," returns the selected SNVs, SVs and compound pairs, the case's panels and comments, and germline biomarkers (UPD, SMN, GBA, HBA)."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"r = client.request(\"GET\", \"/v1_3/analysis/workbench\", params={\"analysis_id\": \"12345\"})\nr.raise_for_status()\nwb = r.json()\n\nfor v in wb[\"snp_variants\"]:\n    tx = v[\"annotations\"][\"transcripts\"][0]\n    print(tx[\"gene\"], tx[\"transcript\"], tx[\"hgvc_c\"], tx[\"hgvc_p\"],\n          v[\"sample_data\"][\"zygosity\"], v[\"classification\"][\"acmg_classification\"])\n","lang":"python"},"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":"Response part"},"children":["Response part"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Contains"},"children":["Contains"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["snp_variants[]"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["variant"]}," (coordinates), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sample_data"]}," (depth, VAF, zygosity, inheritance), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["annotations"]}," (transcripts, frequencies, predictions, ClinVar), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["classification"]}," (ACMG call, rules, tags), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["variant_franklin_link"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sv_variants[]"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The same structure for structural variants and CNVs"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["compound_snp_variants[]"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["compound_snp_sv_variants[]"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Compound-heterozygous pairs"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["case_details"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Panels and case comments"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["biomarkers"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["UPD, SMN, GBA and HBA results"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Oncology cases"]}," use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/analysis-query/getsomaticanalysisworkbenchwithstats"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1_3/somatic_analysis/workbench"]}]}," instead. It adds TMB, MSI, HRD, MMR and MET exon 14 skipping."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"2-produce-the-report","__idx":2},"children":["2. Produce the report"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Pick one of two paths."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["A: Your analysts build and sign the report in Franklin."]}," Nothing to call; go to step 3 once it's signed."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["B: Automated reporting from the workbench."]}," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/reports/generatereportfromworkbench"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/analysis/workbench/generate_report"]}]}," adds every workbench variant to the report, fills in missing interpretations, and publishes the report, for many cases at once:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"r = client.request(\"POST\", \"/v1/analysis/workbench/generate_report\",\n                   json={\"analysis_ids\": [\"12345\", \"12346\"]})\nr.raise_for_status()\nfor analysis_id, result in r.json()[\"reports\"].items():\n    if result.get(\"error\"):\n        print(analysis_id, \"failed:\", result[\"error\"])\n    else:\n        print(analysis_id, \"report\", result[\"report_id\"])\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The call returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200"]}," even when some cases fail. Check each entry's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To publish a report that already has its variants, without regenerating it, call ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/reports/publishreport"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/analysis/report/publish"]}]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{\"analysis_id\": \"12345\"}"]},". Publishing makes it the official signed report, and a report with no variants can't be published."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"3-download-the-signed-report","__idx":3},"children":["3. Download the signed report"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/reports/getanalysissignedreportfile"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/analysis/signed_report_file"]}]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["format"]}," set to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pdf"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["doc"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["docx"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"r = client.request(\"GET\", \"/v1/analysis/signed_report_file\",\n                   params={\"analysis_id\": \"12345\", \"format\": \"pdf\"})\nr.raise_for_status()\nbody = r.json()\nif body.get(\"download_link\"):\n    pdf = requests.get(body[\"download_link\"]).content     # pre-signed URL, no auth header\n    open(\"12345.pdf\", \"wb\").write(pdf)\nelse:\n    print(\"not available:\", body.get(\"error\"))\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The link is pre-signed and short-lived, so download it right away and don't store the URL."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"find-newly-signed-reports","__idx":4},"children":["Find newly signed reports"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Instead of polling each case, list the reports signed since your last run with ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/reports/listreports"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/reports/list"]}]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"r = client.request(\"GET\", \"/v1/reports/list\", params={\n    \"signed_after\": \"2024-01-15T00:00:00Z\",   # ISO-8601 with timezone, or a Unix timestamp\n    \"report_status\": [\"FINAL\", \"AMENDED\"],\n    \"ordering\": \"signed_date\",\n    \"page_number\": 1,\n})\npage = r.json()          # {\"num_pages\": 5, \"page_number\": 1, \"reports\": [...]}\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each entry has ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["analysis_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["report_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["report_status"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["signed_at"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["signed_by"]},". Only the latest report per case is listed. Page through with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page_number"]}," up to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["num_pages"]},". A date without a timezone, such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2024-01-15"]},", is rejected with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"other-report-outputs","__idx":5},"children":["Other report outputs"]},{"$$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":"Need"},"children":["Need"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Endpoint"},"children":["Endpoint"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The report as structured JSON"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/reports/getanalysisreport"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v3_4/analysis/report"]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The current report as a PDF, DOC, DOCX or HTML file"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/reports/getanalysisreportfile"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/analysis/report_file"]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Report data for rendering in your own template engine"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/reports/getreportbody"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/report"]}]}]}]}]}]}]}]},"headings":[{"value":"From workbench to signed report","id":"from-workbench-to-signed-report","depth":1},{"value":"1. Get the workbench","id":"1-get-the-workbench","depth":2},{"value":"2. Produce the report","id":"2-produce-the-report","depth":2},{"value":"3. Download the signed report","id":"3-download-the-signed-report","depth":2},{"value":"Find newly signed reports","id":"find-newly-signed-reports","depth":2},{"value":"Other report outputs","id":"other-report-outputs","depth":2}],"frontmatter":{"seo":{"title":"From workbench to signed report"}},"lastModified":"2026-09-30T21:14:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/recipes/workbench-to-signed-report","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}