Skip to content

Instantly share code, notes, and snippets.

View ivirshup's full-sized avatar
💭
🫠

Isaac Virshup ivirshup

💭
🫠
View GitHub Profile
@ivirshup
ivirshup / polygons_on_points.py
Last active February 24, 2023 12:26
spatial aggregations w polygons
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,
@ivirshup
ivirshup / transcript_models.py
Last active February 13, 2023 15:55
Getting the transcript models out of the bioconductor ensdb tables and turning them into an awkward array
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")
@ivirshup
ivirshup / 01_scrape-dependent-packages-from-wheelodex.ipynb
Created November 16, 2022 16:17
scverse core dependent packages
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ivirshup
ivirshup / mmap_csr_sparse.ipynb
Last active November 8, 2022 10:50
Example code for reading from a memory mapped sparse array
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ivirshup
ivirshup / cellxgenedp_example.ipynb
Last active October 5, 2023 15:35
Downloading an h5ad file from cellxgene API
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ivirshup
ivirshup / scverse-core_github-dependents.ipynb
Last active October 10, 2022 18:22
Notebook for getting scverse core packages dependents from github
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ivirshup
ivirshup / scverse-core_pypi-dependents.ipynb
Created October 10, 2022 17:56
Notebook for getting scverse core packages pypi dependents from wheelodex
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ivirshup
ivirshup / anndata_dask_df.py
Created September 2, 2022 14:07
anndata dataframe -> dask with columnar support
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
@ivirshup
ivirshup / jsscatter-citeseq.ipynb
Created May 24, 2022 13:29
jupyter-scatter + citeseq example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ivirshup
ivirshup / dependents.ipynb
Created May 11, 2022 14:27
Dependents of scverse packages
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.