Skip to content

Bugfix for missing subdirectory 'outs/' in read10xVisium() - #78

Closed
lmweber wants to merge 10 commits into
masterfrom
read10xVisium_bugfix_outs
Closed

lmweber wants to merge 10 commits into
masterfrom
read10xVisium_bugfix_outs

Conversation

@lmweber

@lmweber lmweber commented Sep 15, 2021

Copy link
Copy Markdown
Collaborator

Hi @drighelli @HelenaLC , during some testing I have found we have quite an important bug in read10xVisium().

Currently, the default file structure expected by read10xVisium() is missing the outs/ subdirectory created by Space Ranger. So read10xVisium() can currently only be used if the user adds outs/ manually in the samples argument, e.g. as follows:

spe <- read10xVisium(
  samples = file.path(path, sample_id, "outs"), 
  sample_id = sample_id, 
  type = "sparse", 
  data = "raw", 
  images = c("hires", "lowres"), 
  load = TRUE
)

I think we should update read10xVisium() to include outs/ automatically, so that the samples argument is simply the path to the samples, e.g. samples = file.path(path, sample_id). Otherwise this will be confusing for new users, and we will need to always explain everywhere in our documentation why users need to also include outs/ along with the actual sample names.

Could you please have a look at my updates in this pull request and let me know what you think, and we can also discuss in our next meeting.

The main update is to include outs/ in fns and dir here: https://github.com/drighelli/SpatialExperiment/blob/read10xVisium_bugfix_outs/R/read10xVisium.R#L101-L113. All the other edits are to update the examples and tests to match this change. Thanks!

This came up during my testing for our recent issue #76 .

@lmweber

lmweber commented Sep 15, 2021

Copy link
Copy Markdown
Collaborator Author

See additional comments from @LTLA in issue #76

Maybe we should do two additional things:

  • add a check and warning if outs/ is already provided by the user
  • make this whole argument more flexible to also allow the user to provide the complete path including *_feature_bc_matrix if they want to, which may be useful for more advanced users, and would be more similar to DropletUtils::read10xCounts()

@lmweber

lmweber commented Sep 25, 2021

Copy link
Copy Markdown
Collaborator Author

I'll update this or close it and create a new pull request to replace it with the approach we discussed, i.e. making sure it can handle both options (with and without the outs/) and not breaking people's existing code.

@lmweber lmweber closed this Oct 27, 2021
@lmweber

lmweber commented Oct 27, 2021

Copy link
Copy Markdown
Collaborator Author

Closing this and moving into a new / updated pull request as we discussed

@lmweber lmweber mentioned this pull request Oct 27, 2021
@lmweber
lmweber deleted the read10xVisium_bugfix_outs branch November 24, 2021 20:29
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.

1 participant