| name | gcell-gene |
| description | Gene annotations and TSS analysis using gcell. Use this skill when users ask about:
- GENCODE gene annotations
- Transcription start sites (TSS)
- Gene coordinates and metadata
- Transcript information
- Querying genes by genomic region
Triggers: gene annotation, GENCODE, TSS, transcription start site, gene coordinates, transcript, GTF
|
| refs | ["_refs/gencode-gene-api.md"] |
Gene Annotations
Loading GENCODE Annotations
from gcell.rna.gencode import Gencode
gencode = Gencode(assembly="hg38")
gencode = Gencode(assembly="hg19")
gencode = Gencode(assembly="mm10")
Accessing Gene Information
gene = gencode.get_gene("TP53")
gene = gencode.get_gene("BRCA1")
gene = gencode.get_gene("MYC")
print(gene.id)
print(gene.name)
print(gene.chrom)
print(gene.strand)
print(gene.tss_coordinate)
print(gene.tes)
chrom, start, end, strand = gene.genomic_range
Transcription Start Sites (TSS)
for tss in gene.tss:
print(tss.chrom, tss.start, tss.strand)
tss_coord = gene.tss_coordinate
print(gene.tss_list)
Query Genes by Region
result = gencode.query_region("chr17", 41196312, 41277500)
print(result[['gene_name', 'Chromosome', 'Start', 'End', 'Strand']])
Gencode Lookup Properties
strand = gencode.gene_to_strand["TP53"]
chrom = gencode.gene_to_chrom["TP53"]
tss = gencode.gene_to_tss["TP53"]
tes = gencode.gene_to_tes["TP53"]
gene_type = gencode.gene_to_type["TP53"]
gene_id = gencode.gene_to_id["TP53"]
Key Classes
| Class | Purpose |
|---|
Gencode | GENCODE annotation database |
Gene | Gene with coordinates and TSS/TES |
TSS | Transcription start site object |
GeneSets | Collection of Gene objects |
Data Location
- Annotations:
~/.gcell_data/annotations/
- Override:
GCELL_ANNOTATION_DIR environment variable