Example notebook

Example notebook#

import numpy as np
from anndata import AnnData
import pandas as pd
import cookiecutter_scverse_instance
adata = AnnData(np.random.normal(size=(20, 10)))

With myst it is possible to link in the text cell of a notebook such as this one the documentation of a function or a class.

Let’s take as an example the function cookiecutter_scverse_instance.pp.basic_preproc(). You can see that by clicking on the text, the link redirects to the API documentation of the function. Check the raw markdown of this cell to understand how this is specified.

This works also for any package listed by intersphinx. Go to docs/conf.py and look for the intersphinx_mapping variable. There, you will see a list of packages (that this package is dependent on) for which this functionality is supported.

For instance, we can link to the class anndata.AnnData, to the attribute anndata.AnnData.obs or the method anndata.AnnData.write().

Again, check the raw markdown of this cell to see how each of these links are specified.

You can read more about this in the intersphinx page and the myst page.

cookiecutter_scverse_instance.pp.basic_preproc(adata)
Implement a preprocessing function here.
0
pd.DataFrame().assign(A=["a", "b", "c"], B=[1, 2, 3])
A B
0 a 1
1 b 2
2 c 3