, var_by=None, gtf=None, gtf_by=None, by_func=None)[源代码]

Get genomic annotation of genes by joining with a GTF file.

  • adata (AnnData) – Input dataset

  • var_by (typing.Optional[str]) – Specify a column in adata.var used to merge with GTF attributes, otherwise adata.var_names is used by default.

  • gtf (typing.Optional[os.PathLike]) – Path to the GTF file

  • gtf_by (typing.Optional[str]) – Specify a field in the GTF attributes used to merge with adata.var, e.g. “gene_id”, “gene_name”.

  • by_func (typing.Optional[typing.Callable]) – Specify an element-wise function used to transform merging fields, e.g. removing suffix in gene IDs.




The genomic locations are converted to 0-based as specified in bed format rather than 1-based as specified in GTF format.