Skip to content

Added 4 Sphinx gallery python tutorials#43

Draft
Amber-Xu914 wants to merge 3 commits into
fabilab:mainfrom
Amber-Xu914:sphinx/python-tutorials-new
Draft

Added 4 Sphinx gallery python tutorials#43
Amber-Xu914 wants to merge 3 commits into
fabilab:mainfrom
Amber-Xu914:sphinx/python-tutorials-new

Conversation

@Amber-Xu914

Copy link
Copy Markdown
Contributor

Hi Fabio,

As discussed in the previous lab meeting, I’ve added 4 new tabs to the Sphinx gallery following the existing infrastructure. The source .py files are located in docs/gallery/python.

The gallery includes four Python tutorials now:
• Quickstart
• Beginner guide
• Explore average expression
• Explore cell type
• Explore marker genes

I followed Sphinx documentation conventions for file naming with numbered prefixes to ensure proper display order.

To generate the Sphinx gallery, simply run the make html command.

Please let me know if you have any feedback or require further adjustments.

@Amber-Xu914
Amber-Xu914 marked this pull request as draft June 23, 2025 13:49
@iosonofabio

Copy link
Copy Markdown
Contributor

Thank you. Are you sure the PNG static files should be versioned?

@Amber-Xu914

Copy link
Copy Markdown
Contributor Author

@iosonofabio Hi Fabio, yes these PNG files in _static folder are manually added for gallery thumbnails and should be versioned :3

@iosonofabio

iosonofabio commented Jun 23, 2025 via email

Copy link
Copy Markdown
Contributor

@iosonofabio iosonofabio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pr. I left a few dozen comments about specific points.

I'm not sure the logos for each tutorial make much sense. Maybe using a dynamic plot from the tutorial itself is more informative?

Comment thread .gitignore
# Files generated during package build and CMD check, unnecessary for the package
atlasapprox.Rcheck/
.Rhistory
.RData No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's going on here?

==========

This example shows a quick and easy example of how to use atlasapprox to get and plot the expression of some gees in a specific organ of a specific organism.
This example shows a quick and easy example of how to use atlasapprox to get and plot the expression of some gees in a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo gees

sns.heatmap(expression, ax=ax)
fig.tight_layout()

# sphinx_gallery_thumbnail_path = '_static/quickstart.png' No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this?

# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# It's recommended to use a virtual environment to manage dependencies. Run the following command:
#
# ``python -m venv venv``

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually people typically put it into .venv - with a dot


# List available organisms
available_organisms = api.organisms()
print(available_organisms)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just printing the API call directly?

# %%
# Visualizing the data
# --------------------
# Visualization reveals patterns hidden by raw numbers. Organs vary in sampled cell totals, so raw counts can be misleading—those with more samples may appear to have higher cell type numbers, even if the type is rare.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please cut the first clause, it sounds condescending

# %%
# The bar chart indicates macrophages are highly abundant in the lung, comprising
# nearly 35% of sampled cells. This suggests the lung is a primary site for
# macrophage activity, while other organs like liver and bladder show moderate

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moderate?

# nearly 35% of sampled cells. This suggests the lung is a primary site for
# macrophage activity, while other organs like liver and bladder show moderate
# proportions, and many, such as pancreas and colon, exhibit minimal presence.
# The variation highlights the diverse roles macrophages play across the body's tissues.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this means

#
# For more detailed information, please refer to the `official documentation <https://atlasapprox.readthedocs.io/en/latest/python/index.html>`_.

# sphinx_gallery_thumbnail_path = '_static/cell_type.png' No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let's make these dynamic

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you already have a section on marker genes above? It feels like this tutorial might be redundant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants