gustaveroussy / sopa

Technology-invariant pipeline for spatial omics analysis (Xenium / Visium HD / MERSCOPE / CosMx / PhenoCycler / MACSima / ...) that scales to millions of cells
https://gustaveroussy.github.io/sopa/
BSD 3-Clause "New" or "Revised" License
123 stars 14 forks source link

[Feature] General reader for non-commercial datasets #116

Open lopollar opened 3 weeks ago

lopollar commented 3 weeks ago

Is your feature request related to a problem? Please describe. I would love to try out Sopa on data not created with one of the main platform providers. However, there is no reader, or a clear explanation on how to do this at the moment (or I am missing it, which for sure is an option).

Describe the solution you'd like I would love a general reader, that takes the path to a tiff (like the some reader you have) and a path to the transcript file, in combination with some parameters describing the data (x en y coordinates, gene column, pixel size..) Describe alternatives you've considered I now have loaded the data in with SPArrOW, as it is also SpatialData based, but this only natively works in the API, not in the snakemake pipeline.

quentinblampey commented 3 weeks ago

Hello @lopollar, indeed for now the existing general readers (sopa.io.ome_tif and sopa.io.aicsimageio) are only reading images, but not transcript files

I could add some extra parameters to read a transcript file!

The only thing that may be hard to generalize concerns reading the coordinate transformation between microns and the pixels. If the coordinate systems are aligned, then we simply require a pixel size, but, else, we need to read a transformation file, which may have various different format / metadata. What is your opinion on this?

lopollar commented 3 weeks ago

Hi, I think you have a transformation implementation for MERFISH anyway, right? I would give them both option, a transformation file as input, or a pixel size. Very easy to internally convert the pixelsize to the transformation matrix. People with non-standard data probably will know about their transformation, so as long as you clearly state how you want to transformation file to look, it is easily created, no?

quentinblampey commented 3 weeks ago

Yes, I have a transformation implementation for MERFISH. For non-standard data, I could indeed enforce a specific file format, but the users would need to create this file before reading the data with sopa. It's not super convenient, but it may still be the best approach!

I have a project to finish, so I'll work on this afterward (maybe in October), but of course if you want to contribute I would be happy to review a PR meanwhile :)