From 6c6c0262a99928dc1a1152a9e9393609f43a2a80 Mon Sep 17 00:00:00 2001 From: Lukas Heumos Date: Tue, 22 Aug 2023 07:35:02 -0700 Subject: [PATCH] :sparkles: Add nextflow execution ID tracking (#11) * :sparkles: Add nextflow execution ID tracking Signed-off-by: zethson * :bug: Don't resume Signed-off-by: zethson * :bug: Use nextflow log Signed-off-by: zethson * :sparkles: Simplify Signed-off-by: zethson --------- Signed-off-by: zethson --- docs/guide/bulk_rna_seq.ipynb | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/docs/guide/bulk_rna_seq.ipynb b/docs/guide/bulk_rna_seq.ipynb index 1cb95cc..b7ce857 100644 --- a/docs/guide/bulk_rna_seq.ipynb +++ b/docs/guide/bulk_rna_seq.ipynb @@ -229,7 +229,7 @@ }, "outputs": [], "source": [ - "!nextflow run nf-core/rnaseq -r 3.11.2 -profile test,docker --outdir rna-seq-results -name {ln.dev.run_context.run.id} -resume" + "!nextflow run nf-core/rnaseq -r 3.11.2 -profile test,docker --outdir rna-seq-results -name {ln.dev.run_context.run.id}" ] }, { @@ -317,6 +317,34 @@ "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": [ + "import subprocess\n", + "\n", + "command = f\"nextflow log | grep -F '{ln.dev.run_context.run.id}' | awk '{{print $8}}'\"\n", + "session_id = subprocess.getoutput(command)\n", + "\n", + "run = ln.Run.filter(transform__name=\"nf-core rnaseq\").order_by(\"-run_at\").first()\n", + "run.reference = session_id\n", + "run.reference_type = \"nextflow_id\"\n", + "run.save()" + ] + }, { "cell_type": "markdown", "id": "9f607150", @@ -400,7 +428,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.16" + "version": "3.10.12" }, "nbproject": { "id": "8124Vtle6ZrO",