Skip to content

Commit

Permalink
worked through the code until muon (exclusive)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis committed Feb 17, 2025
1 parent 4d2d4b4 commit 89aa944
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions jupyter-book/introduction/analysis_tools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1601,16 +1601,24 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now that we understood the fundamental data structure of unimodal single-cell analysis, the question remains how we can actually analyze the stored data. In the scverse ecosystem several tools for the analysis of specific omics data exist. For example, scanpy{cite}`Wolf2018` provides tooling for general RNA-Seq focused analysis, squidpy{cite}`Palla2022` focuses on spatial transcriptomics and scirpy{cite}`Sturm2020` provides tooling for the analysis of T-cell receptor (TCR) and B-cell receptor (BCR) data. Even though many scverse extensions for various data modalities exist, they usually use some of scanpy's preprocessing and visualization capabilities to some extent."
"Now that we understand the fundamental data structure of unimodal single-cell analysis, the question remains: How can we actually analyze the stored data?\n",
"In the scverse ecosystem, several tools exist for analyzing specific omics data.\n",
"For example, scanpy {cite}`Wolf2018` provides tooling for general RNA-Seq-focused analysis, squidpy {cite}`Palla2022` focuses on spatial transcriptomics, and scirpy {cite}`Sturm2020` provides tooling for the analysis of T-cell receptor (TCR) and B-cell receptor (BCR) data.\n",
"Even though many scverse extensions for various data modalities exist, they usually use some of scanpy's preprocessing and visualization capabilities to some extent."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"More specifically, scanpy is a Python package which builds on top of AnnData to facilitate the analysis of single-cell gene expression data. Several methods for preprocessing, embedding, visualization, clustering, differential gene expression testing, pseudotime and trajectory inference, and simulation of gene regulatory networks are accessible through scanpy. The efficient implementation based on the Python data science and machine learning libraries allows scanpy to scale to millions of cells. \n",
"Generally, best-practice single-cell data analysis is an interactive process. Many of the decisions and analysis steps depend on the results of previous steps and potentially input of experimental partners. Pipelines such as scflow{cite}`at:Khozoie2021`, which fully automate some downstream analysis steps, started to appear only recently. These pipelines have to make assumptions and simplifications which may not result in the most robust analysis.\n",
"scanpy is therefore designed to be used for interactive analyses with for example Jupyter Notebooks{cite}`jupyter`."
"More specifically, scanpy is a Python package that builds on top of AnnData to facilitate the analysis of single-cell gene expression data.\n",
"Several methods for preprocessing, embedding, visualization, clustering, differential gene expression testing, pseudotime and trajectory inference, and simulation of gene regulatory networks are accessible through scanpy.\n",
"The efficient implementation based on the Python data science and machine learning libraries allows scanpy to scale to millions of cells.\n",
"Generally, best-practice single-cell data analysis is an interactive process.\n",
"Many of the decisions and analysis steps depend on the results of previous steps and the potential input of experimental partners.\n",
"Pipelines such as scflow {cite}`at:Khozoie2021`, which entirely automate some downstream analysis steps, started to appear only recently.\n",
"These pipelines have to make assumptions and simplifications, which may not result in the most robust analysis.\n",
"Scanpy is therefore designed for interactive analyses with, for example, Jupyter Notebooks {cite}`jupyter`."
]
},
{
Expand Down Expand Up @@ -1653,10 +1661,15 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The scanpy framework is designed in a way that functions belonging to the same step are grouped in corresponding modules. For example, all preprocessing functions are available in the `scanpy.preprocessing` module, all transformation of a data matrix which are not preprocessing are available in `scanpy.tools` and all visualizations are available in `scanpy.plot`. These modules are commonly accessed after having imported scanpy like `import scanpy as sc` with the corresponding abbreviations `sc.pp` for preprocessing, `sc.tl` for tools and `sc.pl` for plots. All modules which read or write data are directly accessed. Further, a module for various datasets is available as `sc.datasets`.\n",
"All functions with their corresponding parameters and potentially example plots are documented in the scanpy API documentation{cite}`scanpy_api`.\n",
"The scanpy framework is designed in a way that functions belonging to the same step are grouped into corresponding modules.\n",
"For example, all preprocessing functions are available in the `scanpy.preprocessing` module, all transformations of a data matrix that are not preprocessing are available in `scanpy.tools`, and all visualizations are available in `scanpy.plot`.\n",
"These modules are commonly accessed after having imported scanpy like `import scanpy as sc` with the corresponding abbreviations `sc.pp` for preprocessing, `sc.tl` for tools, and `sc.pl` for plots.\n",
"All modules which read or write data are directly accessed.\n",
"Further, a module for various datasets is available as `sc.datasets`.\n",
"All functions with corresponding parameters and potential example plots are documented in the scanpy API documentation {cite}`scanpy_api`.\n",
"\n",
"Note that this tutorial only covers a very small subset of scanpy's features and options. Readers are strongly encouraged to examine [scanpy's documentation](https://scanpy.readthedocs.io/) for more details."
"Note that this tutorial only covers a tiny subset of scanpy's features and options.\n",
"Readers are strongly encouraged to examine [scanpy's documentation](https://scanpy.readthedocs.io/) for more details.\n"
]
},
{
Expand Down Expand Up @@ -2114,7 +2127,7 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -2131,10 +2144,10 @@
"source": [
"n, d, k = 1000, 100, 10\n",
"\n",
"z = np.random.default_generator().normal(\n",
"z = np.random.default_rng().normal(\n",
" loc=np.arange(k), scale=np.arange(k) * 2, size=(n, k)\n",
")\n",
"w = np.random.default_generator().normal(size=(d, k))\n",
"w = np.random.default_rng().normal(size=(d, k))\n",
"y = np.dot(z, w.T)\n",
"y.shape"
]
Expand Down Expand Up @@ -2171,7 +2184,7 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -2187,7 +2200,7 @@
],
"source": [
"d2 = 50\n",
"w2 = np.random.default_generator().normal(size=(d2, k))\n",
"w2 = np.random.default_rng().normal(size=(d2, k))\n",
"y2 = np.dot(z, w2.T)\n",
"\n",
"adata2 = ad.AnnData(y2)\n",
Expand Down

0 comments on commit 89aa944

Please sign in to comment.