Skip to main content
Ctrl+K

cellink

  • Tutorials
    • Tutorial: Pseudobulk eQTL Analysis with cellink
    • Tutorial: eQTL Analysis with JaxQTL and TensorQTL using cellink
    • Tutorial: Annotating Genetic Variants with cellink
    • Tutorial: Rare Variant Association Testing with cellink
    • Tutorial: LD Clumping and Identifying Independent Signals with cellink
    • Tutorial: Colocalization Analysis - Linking eQTLs to GWAS Signals with cellink
    • Tutorial: Integrating GWAS with Single-Cell Data using cellink
    • Tutorial: Spatially Resolved GWAS Mapping with gsMap
    • Tutorial: eQTL Analysis with SAIGE-QTL using cellink
    • Tutorial: Using EHR Data as Donor-Level Input in cellink
    • Tutorial: Using the MILDataset and PyTorch DataLoader in cellink
  • API
    • DonorData
      • cellink.DonorData
    • Preprocessing pp
      • cellink.pp.variant_qc
      • cellink.pp.cell_level_obs_filter
      • cellink.pp.donor_level_obs_filter
      • cellink.pp.donor_level_var_filter
      • cellink.pp.log_transform
      • cellink.pp.low_abundance_filter
      • cellink.pp.missing_values_filter
      • cellink.pp.normalize
    • Input-Output io
      • cellink.io.from_sgkit_dataset
      • cellink.io.read_plink
      • cellink.io.read_bgen
      • cellink.io.read_sgkit_zarr
      • cellink.io.read_pgen_zarr
      • cellink.io.stream_pgen_to_zarr
      • cellink.io.to_plink
      • cellink.io.write_variants_to_vcf
    • Tools tl
      • cellink.tl.get_snp_df
      • cellink.tl.run_favor
      • cellink.tl.run_snpeff
      • cellink.tl.run_vep
      • cellink.tl.add_vep_annos_to_gdata
      • cellink.tl.combine_annotations
      • cellink.tl.aggregate_annotations_for_varm
      • cellink.tl.run_burden_test
      • cellink.tl.run_skat_test
      • cellink.tl.beta_weighting
    • External tools tl.external
      • cellink.tl.external.calculate_ld
      • cellink.tl.external.run_jaxqtl
      • cellink.tl.external.read_jaxqtl_results
      • cellink.tl.external.run_mixmil
      • cellink.tl.external.calculate_pcs
      • cellink.tl.external.run_tensorqtl
      • cellink.tl.external.read_tensorqtl_results
      • cellink.tl.external.run_scdrs
      • cellink.tl.external.run_seismic
      • cellink.tl.external.run_magma_pipeline
      • cellink.tl.external.run_saigeqtl
      • cellink.tl.external.configure_saigeqtl_runner
      • cellink.tl.external.get_saigeqtl_runner
      • cellink.tl.external.make_group_file
      • cellink.tl.external.read_saigeqtl_results
      • cellink.tl.external.load_gsmap_results
      • cellink.tl.external.format_gsmap_sumstats
    • Plotting
      • cellink.pl.locus
      • cellink.pl.manhattan
      • cellink.pl.qq
      • cellink.pl.expression_by_genotype
      • cellink.pl.volcano
    • Machine Learning ml
      • cellink.ml.MILDataset
      • cellink.ml.mil_collate_fn
      • cellink.ml.DonorMILModel
    • Association Testing at
      • cellink.at.acat_test
      • cellink.at.compute_acat
      • cellink.at.GWAS
      • cellink.at.Skat
    • Utils
      • cellink.utils.column_normalize
      • cellink.utils.gaussianize
      • cellink.utils.one_hot_encode_genotypes
      • cellink.utils.dosage_per_strand
    • Resources
      • cellink.resources.get_1000genomes
      • cellink.resources.get_1000genomes_grch38
      • cellink.resources.get_dummy_onek1k
      • cellink.resources.get_onek1k
      • cellink.resources.get_eqtl_catalog_dataset_associations
      • cellink.resources.get_eqtl_catalog_datasets
      • cellink.resources.get_gwas_catalog_studies
      • cellink.resources.get_gwas_catalog_study
      • cellink.resources.get_gwas_catalog_study_summary_stats
      • cellink.resources.get_pgs_catalog_score
      • cellink.resources.get_pgs_catalog_scores
      • cellink.resources.get_1000genomes_ld_scores
      • cellink.resources.get_1000genomes_ld_weights
  • Changelog
  • Contributing guide
  • References
  • .rst

cellink.DonorData

Contents

  • DonorData
    • DonorData.G
    • DonorData.C
    • DonorData.donor_id
  • Attributes table
  • Methods table
  • Attributes
    • DonorData.C
    • DonorData.G
    • DonorData.shape
  • Methods
    • DonorData.aggregate()
    • DonorData.copy()
    • DonorData.prep_repr()
    • DonorData.sel()
    • DonorData.write_dd()
    • DonorData.write_h5_dd()
    • DonorData.write_zarr_dd()

cellink.DonorData#

class cellink.DonorData(*, G, C, donor_id='donor_id', var_dims_to_sync=None, uns={})#

Store and manage donor-related data with single-cell readouts.

This class allows donor-level, especially genetic, analysis with single-cell datasets. It holds AnnData objects for donor-level/genetic (G) and single-cell (C) data

G(AnnData)#
Type:

Donor-level AnnData

C(AnnData)#
Type:

Cell-level AnnData

donor_id(str)#
Type:

Key for donor information in C.obs

Returns:

DonorData object

Attributes table#

C

G

shape

Methods table#

aggregate(*[, key_added, layer, obs, obsm, ...])

Aggregate single-cell data to donor-level.

copy()

prep_repr()

String representation of DonorData showing side-by-side dd.G and dd.C views.

sel(*[, G_obs, G_var, C_obs, C_var])

write_dd(path, dd[, fmt])

Write the DonorData object to the specified file paths for both gene expression data (G) and cell-type data (C).

write_h5_dd(path)

Write the DonorData object to the specified file path.

write_zarr_dd(path)

Write the DonorData object to the specified file paths for both gene expression data (G) and cell-type data (C).

Attributes#

DonorData.C#
DonorData.G#
DonorData.shape#

Methods#

DonorData.aggregate(*, key_added=None, layer=None, obs=None, obsm=None, filter_key=None, filter_value=None, add_to_obs=False, func='mean', sync_var=False, verbose=False)#

Aggregate single-cell data to donor-level.

Return type:

None

If neither layer, obsm, or obs is provided, adata.X is aggregated. Args:

key_added:

The key in gdata to store the aggregated data.

layer:

The layer in adata to aggregate. Defaults to None.

obs:

The key in adata.obs to aggregate. Defaults to None.

obsm:

The key in adata.obsm to aggregate. Defaults to None.

filter_key:

The key in adata.obs to filter by. Defaults to None.

filter_value:

The value in adata.obs[filter_key] to filter by. Defaults to None.

add_to_obs:

Whether to add the aggregated data to adata.obs. Defaults to False.

func:

The aggregation function to use. Defaults to “mean”.

sync_var:

Whether to set the variable dimensions of the aggregated data to sync with the variable dimensions of the single-cell data. Defaults to False.

verbose:

Whether to print verbose output. Defaults to False.

DonorData.copy()#
Return type:

DonorData

DonorData.prep_repr()#

String representation of DonorData showing side-by-side dd.G and dd.C views.

Return type:

str

DonorData.sel(*, G_obs=slice(None, None, None), G_var=slice(None, None, None), C_obs=slice(None, None, None), C_var=slice(None, None, None))#
DonorData.write_dd(path, dd, fmt=None)#

Write the DonorData object to the specified file paths for both gene expression data (G) and cell-type data (C).

Parameters:

path (str | Path) – Path where the donor-data object should be saved.

Return type:

None

Example

write_dd(‘path/to/donor_data.dd.h5’)

DonorData.write_h5_dd(path)#

Write the DonorData object to the specified file path.

Parameters:

path (str | Path) – Path where the donor-data object should be saved.

Return type:

None

Example

write_dd(‘path/to/donor_data.dd.h5’)

DonorData.write_zarr_dd(path)#

Write the DonorData object to the specified file paths for both gene expression data (G) and cell-type data (C).

Parameters:

path (str | Path) – Path where the donor-data object should be saved.

Return type:

None

Example

write_dd(‘path/to/donor_data.dd.zarr’)

previous

DonorData

next

Preprocessing pp

Contents
  • DonorData
    • DonorData.G
    • DonorData.C
    • DonorData.donor_id
  • Attributes table
  • Methods table
  • Attributes
    • DonorData.C
    • DonorData.G
    • DonorData.shape
  • Methods
    • DonorData.aggregate()
    • DonorData.copy()
    • DonorData.prep_repr()
    • DonorData.sel()
    • DonorData.write_dd()
    • DonorData.write_h5_dd()
    • DonorData.write_zarr_dd()

By Jan Engelmann, Lucas Arnoldt, Eva Holtkamp

© Copyright 2026, Theislab..