-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: cxg conversion script updates for uns["spatial"] #7023
Conversation
Deployment Summary
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7023 +/- ##
==========================================
+ Coverage 91.93% 92.02% +0.08%
==========================================
Files 184 186 +2
Lines 15615 15852 +237
==========================================
+ Hits 14356 14588 +232
- Misses 1259 1264 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -8,7 +8,7 @@ RUN apt-get update && \ | |||
apt-get upgrade -y && \ | |||
apt install software-properties-common -y && \ | |||
add-apt-repository ppa:deadsnakes/ppa && \ | |||
apt-get update && apt-get install -y python3.10 python3.10-dev python3.10-venv && \ | |||
apt-get update && apt-get install -y python3.10 python3.10-dev python3.10-venv libvips && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libvips
is required in order to get pyvips
to run
# Cast 'in_tissue' column values as boolean to make it categorical | ||
# https://github.com/chanzuckerberg/single-cell-explorer/issues/841 | ||
if column_name == "in_tissue": | ||
dtype, hints = get_dtype_and_schema_of_array(column_values.astype(bool)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is to treat the reported issue for in_tissue
boolean column that sometimes stored as int. After casting it as bool it will appear as categorical in explorer
is_valid = ( | ||
isinstance(embedding_name, str) | ||
and (embedding_name.startswith("X_") or embedding_name == "spatial") | ||
and len(embedding_name) > 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
valid embedding name either starts with X_ or equals to spatial
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much, Ronen!!
if embedding_name == "spatial": | ||
embedding_name = f"{embedding_container}/{embedding_name}" | ||
else: | ||
embedding_name = f"{embedding_container}/{embedding_name[2:]}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if "spatial" no need to strip the first 2 characters
Reason for Change
Changes
convert_uns_to_cxg_group()
handler for all uns["spatial"] actions as an additional step inmake_cxg()
scriptSpatialDataProcessor
class to handlecxg
conversion foruns
and spatial deep zoom asset generation and uploadTesting steps
make_cxg()
against a localh5ad
- verify generated assets are uploaded to s3 and that the generated cxg includesuns
group.-- datasets with fullres spatial image
-- datasets with hires only spatial image
-- datasets without spatial embedding
Notes for Reviewer
libvips
had to be added to backed and processing Docker in order to getpyvips
library (that generates the deep zoom tiles) to work properly