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

input data of dataset.Dataset() #28

Open
Bo-UT opened this issue Sep 7, 2023 · 1 comment
Open

input data of dataset.Dataset() #28

Bo-UT opened this issue Sep 7, 2023 · 1 comment

Comments

@Bo-UT
Copy link

Bo-UT commented Sep 7, 2023

Hi,

I am new to spatial transcriptomic analysis. I have AnnData from 10x Xenium. Could you please let me know how to generate the input data for dataset.Dataset()?
Thanks.

Bo

@larsborm
Copy link
Contributor

Hi,

Thanks for your interest in FISHscale. You should format your data like this .parquet file: https://figshare.com/articles/dataset/EEL_mouse_sagittal_440_gene_RNA_spatial_data/20324820?file=37548382

Probably easiest is to convert your AnnData file to a Pandas Dataframe. This dataframe should contain the XY or XYZ locations of all molecules and their gene label. So, make a dataframe with the columns: 'g' for gene labels, 'x' for X coordinates and 'y' for Y coordinates. Then save this dataframe as .parquet using" df.to_parquet(filename.parquet), wheredf is your dataframe.

Then you can give FISHscale the path to this file and the column names like so:

from FISHscale.utils import dataset
d = dataset.Dataset('filename.parquet',
                     x_label = 'x',
                     y_label = 'y',                
                     gene_label = 'g',
                     pixel_size = '1 micrometer', #Change this to the unit of the Xenium data. 

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

No branches or pull requests

2 participants