infercnvpy.io.genomic_position_from_gtf
- infercnvpy.io.genomic_position_from_gtf(gtf_file, adata=None, *, gtf_gene_id='gene_name', adata_gene_id=None, inplace=True)
Get genomic gene positions from a GTF file.
The GTF file needs to match the genome annotation used for your single cell dataset.
Warning
Currently only tested with GENCODE GTFs.
- Parameters
- gtf_file :
Path|strUnion[Path,str] Path to the GTF file
- adata :
AnnData|NoneOptional[AnnData] (default:None) Adds the genomic positions to
adata.var. If adata is None, returns a data frame with the genomic positions instead.- gtf_gene_id : {‘gene_id’, ‘gene_name’}
Literal[‘gene_id’, ‘gene_name’] (default:'gene_name') Use this GTF column to match it to anndata
- adata_gene_id :
str|NoneOptional[str] (default:None) Match this column to the gene ids from the GTF file. Default: use adata.var_names.
- inplace :
bool(default:True) If True, add the annotations directly to adata, otherwise return a dataframe.
- gtf_file :
- Return type