Skip to content

Commit

Permalink
🎨 Simplify use case
Browse files Browse the repository at this point in the history
Signed-off-by: zethson <[email protected]>
  • Loading branch information
Zethson committed Sep 26, 2024
1 parent 713f779 commit faa11a7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 59 deletions.
52 changes: 3 additions & 49 deletions docs/mcmicro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,54 +54,6 @@
"import lamindb as ln"
]
},
{
"cell_type": "markdown",
"id": "27c76922",
"metadata": {},
"source": [
"## Run mcmicro/exemplar pipeline"
]
},
{
"cell_type": "markdown",
"id": "2d7fa65b",
"metadata": {},
"source": [
"Register the `exemplar-001` data as input of the mcmicro pipeline by running the script below:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6cd3e0a0",
"metadata": {
"tags": [
"hide-input",
"hide-output"
]
},
"outputs": [],
"source": [
"from IPython.display import display, Code\n",
"\n",
"with open('mcmicro_exemplar.py', 'r') as file:\n",
" display(Code(file.read(), language='python'))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cc5c9e59",
"metadata": {
"tags": [
"hide-output"
]
},
"outputs": [],
"source": [
"!python mcmicro_exemplar.py exemplar-001"
]
},
{
"cell_type": "markdown",
"id": "ecb68cf2-1188-4f8b-a2ab-01c60d5779b8",
Expand All @@ -123,6 +75,8 @@
},
"outputs": [],
"source": [
"from IPython.display import display, Code\n",
"\n",
"with open('mcmicro.py', 'r') as file:\n",
" display(Code(file.read(), language='python'))"
]
Expand Down Expand Up @@ -239,7 +193,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.1.-1"
"version": "3.11.7"
},
"nbproject": {
"id": "8124Vtle6ZrO",
Expand Down
8 changes: 3 additions & 5 deletions docs/mcmicro.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# mcmicro.py

"""This script runs the MCMICRO pipeline and tracks input/output data in LaminDB.
Usage: python mcmicro.py exemplar-001
Expand All @@ -25,10 +23,10 @@
run = ln.context.run

# get the input data from LaminDB
mcmicro_input = ln.Artifact.filter(description=args.input).one()
mcmicro_input = ln.Artifact.using("laminlabs/lamindata").get(uid="iTLHluoQczqH6ZypgDxA")
input_dir = mcmicro_input.cache()

# execute the nextflow pipeline to download example data
# execute the nextflow pipeline
report = f"{args.input}-mcmicro-execution_report.html"
subprocess.run(
[
Expand Down Expand Up @@ -71,4 +69,4 @@
output = ln.Artifact.from_dir(f"{input_dir}/registration")
ln.save(output)

ln.finish()
ln.context.finish()
9 changes: 4 additions & 5 deletions docs/mcmicro_exemplar.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# mcmicro_exemplar.py

"""This script downloads the MCMICRO exemplar data and registers it in LaminDB.
Usage: python mcmicro_exemplar.py exemplar-001
The here registered data is used for the Nextflow use case.
Note that the Nextflow use case simulates the concatenation of two subsequent pipelines where
this script executes the first pipeline and the Nextflow use case the second pipeline.
"""

import lamindb as ln
import subprocess
import argparse


# get args from command line
parser = argparse.ArgumentParser()
parser.add_argument("name", type=str, help="Name of the example data.")
Expand Down Expand Up @@ -64,4 +63,4 @@
exemplar_dir = ln.Artifact(args.name, description=args.name)
exemplar_dir.save()

ln.finish()
ln.context.finish()

0 comments on commit faa11a7

Please sign in to comment.