Skip to content
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

fix docstrings example stereoscope #959

Merged
merged 2 commits into from
Mar 1, 2021
Merged

Conversation

giovp
Copy link
Member

@giovp giovp commented Mar 1, 2021

Hi,

noticed minor bugs in the docstrings examples of stereoscope and thought to push a fix real quick. Feel free to reject if not needed.

looks really great btw, looking forward to official release!

@codecov
Copy link

codecov bot commented Mar 1, 2021

Codecov Report

Merging #959 (68b9ee2) into master (25949ca) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #959   +/-   ##
=======================================
  Coverage   89.57%   89.57%           
=======================================
  Files          86       86           
  Lines        6121     6121           
=======================================
  Hits         5483     5483           
  Misses        638      638           
Impacted Files Coverage Δ
scvi/external/stereoscope/_model.py 93.33% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 25949ca...68b9ee2. Read the comment docs.

Copy link
Member

@adamgayoso adamgayoso 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 contribution! One quick comment

>>> scvi.data.setup_anndata(sc_adata, label_key="labels")
>>> stereo = scvi.external.RNAStereoscope(sc_adata)
>>> scvi.data.setup_anndata(sc_adata, labels_key="labels")
>>> stereo = scvi.external.stereoscope.RNAStereoscope(sc_adata)
Copy link
Member

Choose a reason for hiding this comment

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

it should be accessible from just scvi.external right?

Copy link
Member

Choose a reason for hiding this comment

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

both scRNA and spatial

Copy link
Member Author

@giovp giovp Mar 1, 2021

Choose a reason for hiding this comment

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

scvi.external
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-f706a22e0ee9> in <module>
----> 1 scvi.external

AttributeError: module 'scvi' has no attribute 'external'

my feeling (but might be wrong) is that you should import it explicitly here
https://github.com/YosefLab/scvi-tools/blob/9b9370aa502b308f84e3129a7c940a9bea06426b/scvi/__init__.py#L10

If I import external there, it works.

totally unrelated/unwanted request, and (very) minor pet peeve, but adding the '' to pip install -e .'[dev,tutorials]' would makes it easier for zsh users.

Copy link
Member

Choose a reason for hiding this comment

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

I just committed the latter change you suggested.

I suppose that pattern we can use in the examples here is from scvi.external import RNAStereoscope

I think we just aren't 100% sure we want to import into the top-level yet, as we are still figuring out what external is to some extent. This is also consistent with what scanpy does.

Copy link
Member Author

Choose a reason for hiding this comment

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

whatever you think it's best, I actually like the idea of not having explicit imports, and just implicit import scvi in the examples. Let me know what to do.

btw also really cool that cellassign is already there! Is this the port of the original implementation in tensorflow or the more recent one in torch https://github.com/camlab-bioml/astir/ ?

Copy link
Member

Choose a reason for hiding this comment

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

ok we can leave it like you have it haha.

This is a port of the original implementation, except that we minibatch during inference where they do "full-batch" EM. We'll have a notebook soon showing consistency with their implementation. We'd be happy for you to try it out!

We also talked to the Astir team about using scvi-tools... stay tuned!

@adamgayoso adamgayoso merged commit b5ccd2c into scverse:master Mar 1, 2021
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