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

why 'center_coordinates' in read_gem(), but not in read_gef()? #366

Closed
z-spider opened this issue Dec 18, 2024 · 1 comment
Closed

why 'center_coordinates' in read_gem(), but not in read_gef()? #366

z-spider opened this issue Dec 18, 2024 · 1 comment

Comments

@z-spider
Copy link

What is the effect of this parameter?Should we use it?

Stereopy/stereo/io/reader.py

Lines 1161 to 1170 in c230d6f

def read_gef(
file_path: str,
bin_type: str = "bins",
bin_size: int = 100,
is_sparse: bool = True,
gene_list: Optional[list] = None,
region: Optional[list] = None,
gene_name_index: Optional[bool] = False,
num_threads: int = -1
):

def read_gem(
file_path: str,
sep: str = '\t',
bin_type: str = "bins",
bin_size: int = 100,
is_sparse: bool = True,
center_coordinates: bool = False,
gene_name_index: bool = False
):

Thanks for any reply!

@tanliwei-coder
Copy link
Collaborator

tanliwei-coder commented Dec 27, 2024

center_coordinates is only available for bins bin_type, each bin actually is a square, setting it to True means the central coordinate of each bin is set as its coordinate, otherwise, the upper left corner coordintates are used, due to some unknown historical reasons, previously, if input file is a GEM, the coordinates of bins were forced to be the center of bins, but if a GEF, bins coordinates are always the upper left corner coordintates, in order to unify the GEM and GEF, we added the parameter center_coordinates to read_gem and set it to False by default so that the bins coordinates can be the upper left corner of bins and if a user wants it to be the bin center, center_coordinates can be set to True.

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