Skip to content

Commit

Permalink
✨ Add nextflow execution ID tracking
Browse files Browse the repository at this point in the history
Signed-off-by: zethson <[email protected]>
  • Loading branch information
Zethson committed Aug 22, 2023
1 parent 4750eca commit ff3c488
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion docs/guide/bulk_rna_seq.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,38 @@
"To make the count matrix queryable by biological entities (genes, experimental metadata, etc.), we can now proceed with: {doc}`docs:bulkrna`"
]
},
{
"cell_type": "markdown",
"id": "429bf863",
"metadata": {},
"source": [
"## Register the Nextflow execution id\n",
"\n",
"If we want to be able to query LaminDB for Nextflow execution ID, this here is a way to get it:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4c14e053",
"metadata": {},
"outputs": [],
"source": [
"# load the nextflow execution id from the execution_report.html and store it in the LaminDB run record\n",
"# Regular expression pattern to match the Workflow session ID. We will simplify this in the future.\n",
"import re\n",
"\n",
"pattern = r'Workflow session<\\/dt>\\s*<dd class=\"col-sm-9\"><code>(.*?)<\\/code>'\n",
"with open(\"execution_report.html\", \"r\") as file:\n",
" html_content = file.read()\n",
"match = re.search(pattern, html_content)\n",
"\n",
"run = ln.Run.filter(transform__name=\"nf-core rnaseq\").order_by(\"-run_at\").first()\n",
"run.reference = match.group(1)\n",
"run.reference_type = \"nextflow_id\"\n",
"run.save()"
]
},
{
"cell_type": "markdown",
"id": "9f607150",
Expand Down Expand Up @@ -400,7 +432,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.10.12"
},
"nbproject": {
"id": "8124Vtle6ZrO",
Expand Down

0 comments on commit ff3c488

Please sign in to comment.