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

Add custom metadata to .xml file #37

Open
lucas-diedrich opened this issue Jan 24, 2025 · 0 comments
Open

Add custom metadata to .xml file #37

lucas-diedrich opened this issue Jan 24, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@lucas-diedrich
Copy link
Collaborator

lucas-diedrich commented Jan 24, 2025

Some users requested that the XML file be able to store custom metadata, especially mappings between cell types and wells (wells are stored in the CapID feature).

Quickfix

Note that pyLMD currently provides metadata support via its geopandas integration. For example one can store cell shapes together with custom metadata in a geopandas dataframe.

import geopandas as gpd 
from shapely import Polygon
import lmd.lib as pylmd

gdf = gpd.GeoDataFrame(
     data={"well": ["A1"], "my_annotation": ["T cell"]}, 
     geometry=[Polygon([[0, 0], [1, 0], [0, 1], [0, 0]])
)

gdf.write("/path/to/file-with-metadata.geojson")

A collection can then be created via the collection.load_geopandas function. This drops all unknown metadata.

collection = pylmd.Collection()
collection.load_geopandas(gdf)
collection.save("/path/to/xml-without-metadata.xml")

This creates the issue that there might exist two files with different content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant