Skip to content

Added 4 Sphinx gallery python tutorials #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Amber-Xu914
Copy link
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
Contributor

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

@Amber-Xu914
Copy link
Contributor Author

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

@iosonofabio
Copy link
Contributor

iosonofabio commented Jun 23, 2025 via email

Copy link
Contributor

@iosonofabio iosonofabio left a comment

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?

@@ -149,4 +149,11 @@ dmypy.json
# Files generated during package build and CMD check, unnecessary for the package
atlasapprox.Rcheck/
.Rhistory
.RData
Copy link
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?

@@ -2,7 +2,8 @@
Quickstart
==========

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
Contributor

Choose a reason for hiding this comment

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

Typo gees

@@ -19,3 +20,5 @@
fig, ax = plt.subplots(figsize=(7, 4))
sns.heatmap(expression, ax=ax)
fig.tight_layout()

# sphinx_gallery_thumbnail_path = '_static/quickstart.png'
Copy link
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
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
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
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
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
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'
Copy link
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
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