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

Fixed visium() to support file counts without dataset_id #91

Merged
merged 4 commits into from
Nov 3, 2023

Conversation

LucaMarconato
Copy link
Member

@LucaMarconato LucaMarconato commented Oct 30, 2023

I cleaned up a bit visium(), which now supports raw data that doesn't contain the library_id in the filename of the count file.

I tested it on:

@giovp can you please give a quick look?

Copy link
Member

@giovp giovp left a comment

Choose a reason for hiding this comment

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

just tried it and it works, looks good!

EDIT: testing it with same dataset as before #51 and it's working! so good to go for me

src/spatialdata_io/readers/visium.py Outdated Show resolved Hide resolved
Comment on lines +124 to +129
# Yhe second element of the returned tuple is the full library as contained in the metadata of
# VisiumKeys.COUNTS_FILE. For instance for the spatialdata-sandbox/visium dataset it is:
# spaceranger100_count_30458_ST8059048_mm10-3_0_0_premrna
# We discard this value and use the one inferred from the filename of VisiumKeys.COUNTS_FILE, or the one provided by
# the user in dataset_id
adata, _ = _read_counts(path, counts_file=counts_file, library_id=library_id, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

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

is this needed? maybe we can prvent the function to return the dataset_id if it has been already set before anyway>?

Copy link
Member Author

@LucaMarconato LucaMarconato Nov 2, 2023

Choose a reason for hiding this comment

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

Yes we could modify _read_counts() to drop it. I think we don't need the dataset_id from the metadata.

@giovp
Copy link
Member

giovp commented Nov 2, 2023

wait actually there is an error

@LucaMarconato
Copy link
Member Author

Ah! Working now?

@LucaMarconato LucaMarconato linked an issue Nov 2, 2023 that may be closed by this pull request
@codecov-commenter
Copy link

Codecov Report

Merging #91 (de93257) into main (c4a32e5) will decrease coverage by 0.29%.
Report is 3 commits behind head on main.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #91      +/-   ##
==========================================
- Coverage   41.54%   41.25%   -0.29%     
==========================================
  Files          16       16              
  Lines         869      875       +6     
==========================================
  Hits          361      361              
- Misses        508      514       +6     
Files Coverage Δ
src/spatialdata_io/readers/_utils/_utils.py 27.08% <0.00%> (+0.55%) ⬆️
src/spatialdata_io/readers/visium.py 23.46% <0.00%> (-1.81%) ⬇️

@giovp
Copy link
Member

giovp commented Nov 3, 2023

Ah! Working now?

yes, LGTM!

@LucaMarconato LucaMarconato merged commit 256a8e2 into main Nov 3, 2023
6 checks passed
@LucaMarconato LucaMarconato deleted the fix/visium_no_dataset_id branch November 3, 2023 15:02
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.

Issues with reading 10X VISIUM Cytassist data SpaceRanger Output
3 participants