spatialdata icon indicating copy to clipboard operation
spatialdata copied to clipboard

Any way to map the probes sequences with the bins?

Open Rafael-Silva-Oliveira opened this issue 1 year ago • 1 comments

Hey, I'd like to map the probes sequence (GGTGACA...., etc) with the location of each bin on the 2 micron so I can match with TCR sequences found in the data. Is there a way to map the sequence of each bin together with the observations so this overlap could be plotted?

Rafael-Silva-Oliveira avatar Oct 31 '24 16:10 Rafael-Silva-Oliveira

Hi @Rafael-Silva-Oliveira, I think you can achieve this by using join_spatialelement_table() followed by a call of pd.merge() (using the instance_key column from the joined table and the index from the elements).

Or even simpler, if your elements is called "my_bins", you can also filter the table by region_key values equal to "my_bins", and then do a join with pd.merge() as above.

Probably also related to a draft PR for a new API that will make it easier to link tables and shapes: https://github.com/scverse/spatialdata/pull/627.

LucaMarconato avatar Jan 05 '25 21:01 LucaMarconato