scglue.data.get_gene_annotation¶
-
scglue.data.
get_gene_annotation
(adata, var_by=None, gtf=None, gtf_by=None, by_func=None)[source]¶ Get genomic annotation of genes by joining with a GTF file.
- Parameters
adata (
AnnData
) – Input datasetvar_by (
Optional
[str
]) – Specify a column inadata.var
used to merge with GTF attributes, otherwiseadata.var_names
is used by default.gtf_by (
Optional
[str
]) – Specify a field in the GTF attributes used to merge withadata.var
, e.g. “gene_id”, “gene_name”.by_func (
Optional
[Callable
]) – Specify an element-wise function used to transform merging fields, e.g. removing suffix in gene IDs.
Note
The genomic locations are converted to 0-based as specified in bed format rather than 1-based as specified in GTF format.
- Return type