diff --git a/docs/guide/bulk_rna_seq.ipynb b/docs/guide/bulk_rna_seq.ipynb index 1cb95cc..b8699e5 100644 --- a/docs/guide/bulk_rna_seq.ipynb +++ b/docs/guide/bulk_rna_seq.ipynb @@ -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*
(.*?)<\\/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", @@ -400,7 +432,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.16" + "version": "3.10.12" }, "nbproject": { "id": "8124Vtle6ZrO",