[go: nahoru, domu]

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

static plotting for spatial data #437

Merged
merged 253 commits into from
Apr 14, 2022
Merged
Changes from 1 commit
Commits
Show all changes
253 commits
Select commit Hold shift + click to select a range
9845461
Merge pull request #418 from theislab/fix/update-contributing
michalk8 Sep 16, 2021
9cca775
Fix patching ForwardRef when generating docs
michalk8 Sep 17, 2021
019a1e1
Require numba>=0.52.0 (#420)
michalk8 Sep 21, 2021
b30c3c2
[auto][ci skip] Generate news fragment (#420)
michalk8 Sep 21, 2021
f5ee6dd
Fix CI cron job, remove cond in newsgen (#424)
michalk8 Oct 24, 2021
2cae246
[auto][ci skip] Update dev release notes (#424)
michalk8 Oct 24, 2021
21b59d7
Fix None in ligrec source/target (#434)
michalk8 Nov 24, 2021
a7419bc
[auto][ci skip] Generate news fragment (#434)
michalk8 Nov 24, 2021
be45fab
[auto][ci skip] Update dev release notes (#434)
michalk8 Nov 24, 2021
f825d62
allow Key.uns.library_id to return list
giovp Dec 5, 2021
172f905
fix logic for Kye.uns.library_id
giovp Dec 5, 2021
0d5fbaa
add Key.uns.image_id
giovp Dec 5, 2021
e864116
fix logic Key.uns.image_id
giovp Dec 5, 2021
083edc0
Merge branch 'dev' into plspatial
giovp Dec 5, 2021
6f0bd35
fix logic and add scalefactors_id method
giovp Dec 6, 2021
4cdacc0
return mapping if library_id is None
giovp Dec 6, 2021
974dd37
rename scalefactors to scalefactor
giovp Dec 6, 2021
d90acaa
fix logic for return type
giovp Dec 6, 2021
f6b8361
fix haystack
giovp Dec 10, 2021
f506219
init spatial pl
giovp Dec 10, 2021
20bcbb3
add docstring for _get_unique-map
giovp Dec 10, 2021
9425d38
Fix an import for python 3.10 (#438)
dcjones Dec 30, 2021
2d8dfed
[auto][ci skip] Update dev release notes (#438)
michalk8 Dec 30, 2021
39a07ff
change mypy
giovp Jan 2, 2022
f7d48a3
clean spatial_attrs and add sanitize_anndata
giovp Jan 3, 2022
fed1852
add utils to check val in adata.obs
giovp Jan 3, 2022
4780421
init def spatial
giovp Jan 3, 2022
9dad946
add axis
giovp Jan 3, 2022
1d5127f
add axis
giovp Jan 3, 2022
d5677a3
get values and color vector
giovp Jan 3, 2022
3994ab0
Merge branch 'dev' into plspatial
giovp Jan 3, 2022
80a9787
fix tests
giovp Jan 4, 2022
c6a806d
fix more tests
giovp Jan 4, 2022
d3e03cb
set titles and axis
giovp Jan 4, 2022
f6b15e3
add scatter and circles and polygons
giovp Jan 4, 2022
6f11939
add label
giovp Jan 4, 2022
2e9aad7
add size and handle case with no image
giovp Jan 5, 2022
a1c43db
fix _get_coords
giovp Jan 5, 2022
814e1ca
add img and crops
giovp Jan 5, 2022
98b9bd6
minor fix
giovp Jan 5, 2022
8f67497
fixes for multiple library plotting
giovp Jan 6, 2022
485d1a9
add colormap, title and axis labels
giovp Jan 6, 2022
d3bca63
fix cmap for shaped_collection
giovp Jan 6, 2022
e0efc67
add scalebar
giovp Jan 6, 2022
0c45893
fix scalebar kwargs
giovp Jan 6, 2022
84e4cdb
fix outline
giovp Jan 6, 2022
b4ec6bc
fixes
giovp Jan 7, 2022
9eddb72
fixes for scalebar
giovp Jan 7, 2022
553c1d9
fix logic for non-visium data
giovp Jan 7, 2022
2cc03ca
more comments
giovp Jan 7, 2022
38518a8
more comments
giovp Jan 7, 2022
f092d59
add edges
giovp Jan 7, 2022
9034c4f
change import
giovp Jan 7, 2022
a21b06b
add edges_kwargs
giovp Jan 7, 2022
2254e02
change type of crop_coord
giovp Jan 7, 2022
a2fa113
some docs for review
giovp Jan 7, 2022
5534d7d
add mode enum for shapes, handle partial and use spatial_conn from pa…
giovp Jan 12, 2022
c39a1a6
handle polygons with array and fix types
giovp Jan 12, 2022
e087de7
more comments
giovp Jan 12, 2022
382b0a6
more comments and fix palette handling
giovp Jan 20, 2022
7849e97
fix palette handling
giovp Jan 20, 2022
c0d88c5
remove print
giovp Jan 20, 2022
c7e443e
handle cmap args better
giovp Jan 21, 2022
0ac9eb7
more comments
giovp Jan 21, 2022
88f9ded
fix _get_palette for tests
giovp Jan 21, 2022
b2d343f
handle crops better
giovp Jan 21, 2022
7405d15
more comments
giovp Jan 21, 2022
0cc524e
more comments
giovp Jan 21, 2022
cda4298
more comments
giovp Jan 21, 2022
7990d8d
fix axis label
giovp Jan 22, 2022
ffa14ee
fix axis label
giovp Jan 22, 2022
28d5788
add scalebar to requirements and minor fixes
giovp Jan 22, 2022
665d99c
add scalebar to requirements and minor fixes and handle better na in …
giovp Jan 22, 2022
e9d5566
remove non from na_color type
giovp Jan 22, 2022
96e5bd7
make helper function for spatial non image
giovp Jan 24, 2022
8865662
minor fix
giovp Jan 24, 2022
5b7e1db
fix types
giovp Jan 27, 2022
2546a1c
more fix types
giovp Jan 27, 2022
0e9e127
more comments and chekc dimensions
giovp Jan 27, 2022
3380444
fix check dimensions
giovp Jan 27, 2022
9578a8f
remove 3d projection and fixes
giovp Jan 28, 2022
851baa9
make ref count
giovp Jan 28, 2022
c4dba90
minor fix on _get_list
giovp Jan 28, 2022
8b418bc
another fix on _get_list
giovp Jan 28, 2022
3bfa4b5
minor fixes
giovp Jan 28, 2022
e45509d
minor fixes in pkc_constants
giovp Jan 28, 2022
eb4410a
minor fix container
giovp Jan 28, 2022
d989b5e
fix types
giovp Jan 28, 2022
86febf4
fix more types and change img_alpha
giovp Jan 28, 2022
b437f32
fix pkg constants
giovp Jan 28, 2022
edb1dd4
edges -> edge
giovp Jan 28, 2022
8716ca2
edge -> edges
giovp Jan 28, 2022
70a250b
enable panel order by library or color
giovp Jan 28, 2022
738ec73
fix iter
giovp Jan 28, 2022
a09bed0
make decorate axes and add img channel
giovp Jan 28, 2022
41e1c0e
add _spatial_utils module
giovp Jan 29, 2022
c668b9a
add imports of types
giovp Jan 29, 2022
99fc9f9
minor fix on pkg_constants
giovp Jan 29, 2022
2e4b866
add additional def
giovp Jan 30, 2022
1988b07
[ci skip] Update CONTRIBUTING.rst to mention dev
michalk8 Feb 3, 2022
dd3188c
Merge branch 'dev' into plspatial
giovp Feb 4, 2022
dab25cf
Merge branch 'plspatial' of https://github.com/theislab/squidpy into …
giovp Feb 4, 2022
86b2769
add type
giovp Feb 4, 2022
70ef5be
add segmentation
giovp Feb 7, 2022
1e7bf2f
add api and minor fixes
giovp Feb 7, 2022
2bf7182
update
giovp Feb 8, 2022
baae5cf
import crops in coord
giovp Feb 8, 2022
33f0221
Update _utils.py (#454)
dnjst Feb 9, 2022
154a331
Fixes napari slider and contrast limits (#453)
michalk8 Feb 12, 2022
075a09b
[ci skip] Use Literal in ligrec
michalk8 Feb 12, 2022
7d33b0e
major refactor
giovp Feb 15, 2022
0a831c5
cleanup
giovp Feb 15, 2022
2a1d448
Merge branch 'dev' into plspatial
giovp Feb 15, 2022
e262ff9
remove axs
giovp Feb 15, 2022
5695fa7
Update squidpy/pl/_spatial.py
giovp Feb 16, 2022
19b59d6
Update squidpy/pl/_spatial_utils.py
giovp Feb 16, 2022
0458737
isaac comments
giovp Feb 16, 2022
5aa0c8e
Merge branch 'master' into plspatial
giovp Mar 11, 2022
5d0ba2d
add logging error to palette
giovp Mar 11, 2022
046a794
more comments
giovp Mar 11, 2022
d727904
more comments and init NamedTuple
giovp Mar 11, 2022
f220bd6
more NamedTuple
giovp Mar 11, 2022
04ddc79
more comments
giovp Mar 11, 2022
067c304
fix typing
giovp Mar 11, 2022
570e65e
more comments
giovp Mar 11, 2022
6ceb8fe
more comments
giovp Mar 11, 2022
d7f2fd4
fix for annoying warning
giovp Mar 12, 2022
fe8d28c
init docs
giovp Mar 12, 2022
d3487ac
continue docs
giovp Mar 12, 2022
8f3d210
try delete params
giovp Mar 12, 2022
39ca951
continue docs
giovp Mar 13, 2022
ede14c9
fix docs
giovp Mar 13, 2022
294dfb8
modi gitignore
giovp Mar 13, 2022
07d2690
fix typing
giovp Mar 13, 2022
9277fa7
add _color_utils
giovp Mar 14, 2022
faefebb
fix value_to_lot=None
giovp Mar 14, 2022
1afcad3
change modenum to inherit str
giovp Mar 14, 2022
a91ee5a
improve docs
giovp Mar 14, 2022
f59d506
more improvements
giovp Mar 14, 2022
88b9ec2
fix spellcheck
giovp Mar 14, 2022
6b45448
fix library_id handling
giovp Mar 25, 2022
6a105ec
add img_res_key condition for scalefactor logic
giovp Mar 25, 2022
971c4a8
Merge branch 'master' into plspatial
giovp Mar 25, 2022
2a59ec8
change arguments and unify spatial scatter
giovp Mar 30, 2022
ef743b0
init cached datasets and static spatial tests
giovp Mar 30, 2022
106009c
fix fixtures
giovp Mar 30, 2022
34cc288
fix cached tests
giovp Mar 30, 2022
0809fbd
fix cached tests
giovp Mar 30, 2022
5c900ca
add first images
giovp Mar 30, 2022
7567660
add first images
giovp Mar 30, 2022
cf4588c
add fixture session
giovp Mar 30, 2022
6a27de3
add CI cache for datasets download
giovp Mar 31, 2022
6cec5b3
add CI cache for datasets download
giovp Mar 31, 2022
ccd4e84
add image
giovp Mar 31, 2022
cb51c82
fix CI
giovp Mar 31, 2022
4ad0771
fix CI on macos
giovp Mar 31, 2022
c7a8e77
fix docs
giovp Mar 31, 2022
5fab926
Merge branch 'master' into plspatial
giovp Apr 8, 2022
0283ddd
raise valueError when multiple library_id found but no library_key
giovp Mar 31, 2022
7104a17
better error message for wrong list
giovp Mar 31, 2022
5043847
more tests
giovp Apr 2, 2022
ba7b19e
fix seg boundaries
giovp Apr 8, 2022
459acc8
fix logic for segmentation masks and boundaries
giovp Apr 8, 2022
57468dc
install squidpy for download data step
giovp Apr 8, 2022
dd4af93
add library_id tests and more segment plots
giovp Apr 9, 2022
9673248
Merge branch 'master' into plspatial
giovp Apr 9, 2022
0e4e23d
add more tests
giovp Apr 10, 2022
9220c61
fix __init__.py
giovp Apr 10, 2022
6af8d7a
remove print statemtns
giovp Apr 10, 2022
e6c5596
fix title
giovp Apr 11, 2022
34b5f73
fix docs
giovp Apr 11, 2022
e8dd4b4
re add Union
giovp Apr 11, 2022
0eb0980
add spellcheck
giovp Apr 11, 2022
3bac60c
add another test
giovp Apr 11, 2022
fc46e1f
change dpi
giovp Apr 11, 2022
0fefd23
change figure
giovp Apr 11, 2022
62ca04b
Fix square scatter
michalk8 Apr 12, 2022
0155ee5
fixes CI
giovp Apr 12, 2022
fc9acae
fixes CI
giovp Apr 12, 2022
26a8945
fix notimplemented error and docs
giovp Apr 12, 2022
06cf116
type test
giovp Apr 12, 2022
3d5a429
more comments
giovp Apr 12, 2022
b01a60d
remove columns redundandcy
giovp Apr 12, 2022
c834e00
fix img_res_key
giovp Apr 12, 2022
e5c651c
fix tests
giovp Apr 12, 2022
d9e4755
more comments
giovp Apr 12, 2022
cb3ba62
more comments
giovp Apr 12, 2022
853fbcc
more comments
giovp Apr 12, 2022
e6bf145
more comments types
giovp Apr 12, 2022
9d82b9d
fix tests
giovp Apr 12, 2022
e6dee05
more comments
giovp Apr 12, 2022
cb9cfc7
more comments
giovp Apr 12, 2022
7cd514a
more comments
giovp Apr 12, 2022
3a699b1
fix tests
giovp Apr 12, 2022
8390d1d
fix lint
giovp Apr 12, 2022
c0052ac
more comments
giovp Apr 12, 2022
b3d3e53
fix size from mike comments
giovp Apr 12, 2022
b69b430
use grayscale
giovp Apr 12, 2022
ed77308
check for valid types in lists
giovp Apr 12, 2022
fc04040
cehck for empty color list
giovp Apr 12, 2022
4e32001
add types from scanpy
giovp Apr 12, 2022
aa6b2da
remove edges and add conn_key
giovp Apr 12, 2022
28f148a
fix spelling
giovp Apr 12, 2022
11621c3
Fix frameon=True
michalk8 Apr 12, 2022
2a83f44
Fix cmap being reset
michalk8 Apr 12, 2022
31c6e66
Fix warning in groups
michalk8 Apr 12, 2022
68b9d04
Fix NA color when groups!=None
michalk8 Apr 12, 2022
1755a5b
Fix pet peeve - condition
michalk8 Apr 12, 2022
7e59e4f
Be strict with palettes
michalk8 Apr 12, 2022
f79134f
remove empty space between plots
giovp Apr 13, 2022
723133c
revert back space in grid
giovp Apr 13, 2022
200f311
more fixes and handle outline when na_color is present
giovp Apr 13, 2022
df375be
Merge branch 'master' into plspatial
giovp Apr 13, 2022
1cdd6df
fix docs
giovp Apr 13, 2022
a189c03
fix tests and cleanup
giovp Apr 13, 2022
3348d33
add more tests
giovp Apr 13, 2022
1a21627
add wrapper for func signature
giovp Apr 13, 2022
5798fe7
modify wrapper
giovp Apr 13, 2022
5173a5f
more comments
giovp Apr 13, 2022
4eff458
fix spelling
giovp Apr 13, 2022
367492d
Fix not calling decorator function
michalk8 Apr 13, 2022
5bc916e
Clean docs a bit
michalk8 Apr 13, 2022
d51afcc
Fix cropping bug, _get_list bug, pet peeves
michalk8 Apr 13, 2022
a4bd078
test and add test
giovp Apr 14, 2022
e6459e3
Merge branch 'master' into plspatial
giovp Apr 14, 2022
1eec5ca
Merge branch 'master' into plspatial
giovp Apr 14, 2022
f28b4b1
add params
giovp Apr 14, 2022
f94ee76
Merge branch 'master' into plspatial
giovp Apr 14, 2022
40ebdf4
Merge branch 'master' into plspatial
giovp Apr 14, 2022
92260d4
[ci skip] Fix linting
michalk8 Apr 14, 2022
64c9924
[ci skip] Remove dead interpolation code, docs
michalk8 Apr 14, 2022
f0e7340
Merge branch 'master' into plspatial
giovp Apr 14, 2022
c03597e
[ci skip] Don't use future annotations
michalk8 Apr 14, 2022
e6df313
Merge branch 'plspatial' of ssh://github.com/theislab/squidpy into pl…
michalk8 Apr 14, 2022
4c4a43e
[ci skip] Update defaults
michalk8 Apr 14, 2022
e4a6842
Fix pet peeve in docs
michalk8 Apr 14, 2022
9b50894
Minor doc improvements
michalk8 Apr 14, 2022
4fc07b8
Add seealso's
michalk8 Apr 14, 2022
1493e9e
Add option to return axes
michalk8 Apr 14, 2022
371d67e
Add test timeout
michalk8 Apr 14, 2022
ddf838a
Readd autoscale_view
michalk8 Apr 14, 2022
f88194a
Fix undefined variable, pet peeves
michalk8 Apr 14, 2022
8fb5476
Fix pet peeve v2
michalk8 Apr 14, 2022
0f0827c
Remove macOS 3.7 job
michalk8 Apr 14, 2022
60fdd8e
Add initial dask support
michalk8 Apr 14, 2022
a453fce
Regenerate figures
michalk8 Apr 14, 2022
8a63673
Fix grayscale for dask
michalk8 Apr 14, 2022
bd1e32c
Skip 2 tests on mac
michalk8 Apr 14, 2022
156e80a
Fix truthiness when img/seg are arrays
michalk8 Apr 14, 2022
141df25
Fix truthiness check
michalk8 Apr 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add utils to check val in adata.obs
  • Loading branch information
giovp committed Jan 3, 2022
commit fed18523c9304715c4819c8ed1488a8477ea31fe
10 changes: 10 additions & 0 deletions squidpy/pl/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,3 +620,13 @@ def _dendrogram(data: NDArrayA, method: str, **kwargs: Any) -> tuple[list[int],
def _sanitize_anndata(adata: AnnData) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

How important is this function? I.e.:

  • it's used only once
  • do you heavily rely on this conversion?

Unless you have plans for the future to use it elsewhere, think it's unnecessary (not to mention I don't like calling private methods).

Copy link
Member Author

Choose a reason for hiding this comment

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

might be using it again

"""Transform string annotations to categoricals."""
adata._sanitize()


def _assert_value_in_obs(adata: AnnData, key: str, val: Sequence[Any] | Any) -> None:
if key not in adata.obs:
raise KeyError(f"Cluster key `{key}` not found in `adata.obs`.")
giovp marked this conversation as resolved.
Show resolved Hide resolved
if not isinstance(val, Sequence):
val = [val]
val = list(set(val) - set(adata.obs[key].unique()))
giovp marked this conversation as resolved.
Show resolved Hide resolved
if len(val) != 0:
raise ValueError(f"Values `{val}` not found in `adata.obs[{key}]`.")