Skip to content

Commit

Permalink
add sections
Browse files Browse the repository at this point in the history
  • Loading branch information
Koncopd committed Sep 18, 2024
1 parent ff082da commit 17c4337
Showing 1 changed file with 51 additions and 3 deletions.
54 changes: 51 additions & 3 deletions docs/cellxgene.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,14 @@
"## Train ML models"
]
},
{
"cell_type": "markdown",
"id": "0cf26bfb",
"metadata": {},
"source": [
"### Create a dataloader from a `tiledbsoma` store"
]
},
{
"cell_type": "markdown",
"id": "9206d817",
Expand Down Expand Up @@ -1057,12 +1065,52 @@
},
{
"cell_type": "markdown",
"id": "73b06fe6",
"id": "8884cb2c",
"metadata": {},
"source": [
"### Create a dataloader from a `Collection` of `AnnData` objects"
]
},
{
"cell_type": "markdown",
"id": "79cacdba",
"metadata": {},
"source": [
"You can also directly train ML models on very large collections of `AnnData` objects."
]
},
{
"cell_type": "markdown",
"id": "04c41eae",
"metadata": {},
"source": [
"You can also directly train ML models on very large collections of AnnData objects.\n",
"{meth}`~lamindb.Collection.mapped` caches `AnnData` objects to disk and creates a map-style dataset that performs a virtual join of the features of the underlying `AnnData` objects."
]
},
{
"cell_type": "markdown",
"id": "bcf4e905",
"metadata": {},
"source": [
"```\n",
"from torch.utils.data import DataLoader\n",
"\n",
"collection = ln.Collection.filter(name=\"cellxgene-census\", version=census_version).one()\n",
"\n",
"dataset = collection.mapped(obs_keys=[features.cell_type], join=\"outer\")\n",
"dataloader = DataLoader(dataset, batch_size=128, shuffle=True)\n",
"\n",
"See {doc}`docs:scrna5`."
"for batch in dataloader:\n",
" pass\n",
"```"
]
},
{
"cell_type": "markdown",
"id": "73b06fe6",
"metadata": {},
"source": [
"For further details see {doc}`docs:scrna5`."
]
},
{
Expand Down

0 comments on commit 17c4337

Please sign in to comment.