Skip to content

Commit

Permalink
Merge pull request #33 from theislab/notebook_fix
Browse files Browse the repository at this point in the history
notebooks
  • Loading branch information
tothmarcella committed May 24, 2023
2 parents 0b73f17 + 0099716 commit 647ffdd
Show file tree
Hide file tree
Showing 5 changed files with 170 additions and 195 deletions.
71 changes: 33 additions & 38 deletions docs/notebooks/creating_data_objects_from_anndata.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -20,40 +20,30 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'squidpy'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[2], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39mwarnings\u001b[39;00m\n\u001b[1;32m 2\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39manndata\u001b[39;00m \u001b[39mas\u001b[39;00m \u001b[39mad\u001b[39;00m\n\u001b[0;32m----> 3\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39msquidpy\u001b[39;00m \u001b[39mas\u001b[39;00m \u001b[39msq\u001b[39;00m\n\u001b[1;32m 4\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mgpu_spatial_graph_pipeline\u001b[39;00m \u001b[39mimport\u001b[39;00m transforms\n\u001b[1;32m 5\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mgpu_spatial_graph_pipeline\u001b[39;00m\u001b[39m.\u001b[39;00m\u001b[39manndata2data\u001b[39;00m \u001b[39mimport\u001b[39;00m AnnData2DataByCategory\n",
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'squidpy'"
]
}
],
"outputs": [],
"source": [
"import warnings\n",
"import anndata as ad\n",
"import squidpy as sq\n",
"from gpu_spatial_graph_pipeline import transforms\n",
"from gpu_spatial_graph_pipeline.anndata2data import AnnData2DataByCategory\n",
"from .utils.datasets import DatasetHartmann\n",
"from utils.datasets import DatasetHartmann\n",
"\n",
"warnings.filterwarnings('ignore')\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## All NCEM Datasets"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"tags": []
Expand All @@ -64,7 +54,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand All @@ -86,6 +76,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -96,7 +87,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -106,7 +97,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand All @@ -117,7 +108,7 @@
" obsm: 'spatial', 'node_types'"
]
},
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -127,6 +118,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -135,7 +127,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -146,6 +138,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -154,7 +147,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -166,7 +159,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -175,7 +168,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 13,
"metadata": {},
"outputs": [
{
Expand All @@ -195,7 +188,7 @@
"Name: point, Length: 63747, dtype: object"
]
},
"execution_count": 12,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -206,7 +199,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -219,6 +212,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -227,7 +221,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 15,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -293,7 +287,7 @@
" Data(features=[618, 88], labels=[618, 36])]"
]
},
"execution_count": 14,
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -305,7 +299,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 16,
"metadata": {},
"outputs": [
{
Expand All @@ -321,7 +315,7 @@
" torch.Size([1338, 88]))"
]
},
"execution_count": 18,
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -331,6 +325,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -339,7 +334,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 17,
"metadata": {},
"outputs": [
{
Expand All @@ -353,7 +348,7 @@
" obsp: 'connectivities', 'distances'"
]
},
"execution_count": 23,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -365,7 +360,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -389,7 +384,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 19,
"metadata": {},
"outputs": [
{
Expand All @@ -400,7 +395,7 @@
" Data(edge_index=[2, 6270], features=[1045, 10], labels=[1045, 36])]"
]
},
"execution_count": 27,
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -412,7 +407,7 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 20,
"metadata": {},
"outputs": [
{
Expand All @@ -428,7 +423,7 @@
" torch.Size([1023, 36]))"
]
},
"execution_count": 30,
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -461,7 +456,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.16"
"version": "3.10.8"
},
"vscode": {
"interpreter": {
Expand Down
Loading

0 comments on commit 647ffdd

Please sign in to comment.