drighelli / SpatialExperiment

55 stars 20 forks source link

Inconsistency in read10xVisium() column order #89

Closed jashapiro closed 3 years ago

jashapiro commented 3 years ago

In the read10xVisium() source code, the .read_xyz() function to read the tissue_positions_list.csv file reads the position data columns in order as pxl_col, pxl_row: https://github.com/drighelli/SpatialExperiment/blob/6565376a6e99e5f4b05b2b15fb230ea170d7817f/R/read10xVisium.R#L168-L171

This is in conflict with the vignette instructions where the instructions are to read in the order pxl_row, pxl_col: https://github.com/drighelli/SpatialExperiment/blob/6536b041dcc6810e68edfec3452e6ec124b7d69b/R/SpatialExperiment.R#L136-L139

Based on 10x documentation (and the array_row, array_col order), it seems the latter is likely to be correct.

drighelli commented 3 years ago

Thanks Joshua (@jashapiro) for noticing and reporting this issue, I accounted it in https://github.com/drighelli/SpatialExperiment/pull/91

lmweber commented 3 years ago

Yes, I think simply flipping this here is correct.

This issue is caused by the conflict between the standard definitions of x and y axes in R vs. the Visium images, i.e. pxl_col_in_fullres corresponds to x axis in R, and pxl_row_in_fullres corresponds to reverse of y axis in R.