This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zarr | |
import pandas as pd, numpy as np | |
from anndata.experimental import read_elem, write_elem | |
from anndata._core.sparse_dataset import SparseDataset | |
def _df_index(df: zarr.Group) -> np.ndarray: | |
index_key = df.attrs["_index"] | |
return read_elem(df[index_key]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Docs: https://docs.h5py.org/en/stable/vds.html | |
import h5py | |
import numpy as np | |
def virtual_concatenate(datasets: list[h5py.Dataset]) -> h5py.VirtualLayout: | |
"""Concatenate datasets along the first axis.""" | |
vds = h5py.VirtualLayout(shape=sum(d.shape[0] for d in datasets), dtype=datasets[0].dtype) | |
offset = 0 | |
for d in datasets: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import geopandas as gpd | |
import numpy as np | |
from scipy import sparse | |
import anndata as ad | |
def aggregate_polygons_on_points( | |
polygons: gpd.GeoDataFrame, | |
points: gpd.GeoDataFrame, | |
point_id_column: str, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ibis | |
import awkward as ak | |
!wget https://bioconductorhubs.blob.core.windows.net/annotationhub/AHEnsDbs/v108/EnsDb.Hsapiens.v108.sqlite | |
connection = ibis.sqlite.connect("EnsDb.Hsapiens.v108.sqlite") | |
gene = connection.table("gene") | |
tx = connection.table("tx") | |
tx2exon = connection.table("tx2exon") |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import copy | |
import dask.dataframe as dd | |
import dask.array as da | |
import dask | |
from dask.base import tokenize | |
from dask.dataframe.io.io import from_map | |
import pandas as pd, numpy as np, zarr |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.