scatrans.add_gene_features#
- scatrans.add_gene_features(adata, organism='mouse', gene_feature_file=None, gene_features_path=None)[source]#
Add gene features (length, intron number) to adata.var for bias correction.
The function looks for files in three ways (priority order): 1. gene_features_path (full user-provided path; ~ expanded) 2. gene_feature_file (bare filename inside package data/; path-like values auto-treated as custom) 3. Default filename chosen from organism
Uses robust importlib.resources access so it works whether the package is installed from wheel, sdist, or in editable mode.
- Parameters:
adata (AnnData)
organism (str, default "mouse") – Used only as fallback when gene_feature_file is not provided.
gene_feature_file (str, optional) – Bare filename inside the package data/ directory (e.g. one of the files from list_available_gene_features()). If you pass a path containing / or ~ here, it will be treated as a custom file (like gene_features_path) for convenience.
gene_features_path (str, optional) – Full custom path to a parquet file (highest priority). ~ is expanded to $HOME.