This function will create a gene annotation object that can be used for creating ArrowFiles or an ArchRProject, etc.

createGeneAnnotation(
  genome = NULL,
  TxDb = NULL,
  OrgDb = NULL,
  genes = NULL,
  exons = NULL,
  TSS = NULL,
  annoStyle = NULL,
  singleStrand = FALSE
)

Arguments

genome

A string that specifies the genome (ie "hg38", "hg19", "mm10", "mm9"). If genome is not supplied, TxDb and OrgDb are required. If genome is supplied, TxDb and OrgDb will be ignored.

TxDb

A TxDb object (transcript database) from Bioconductor which contains information for gene/transcript coordinates. For example, from txdb <- TxDb.Hsapiens.UCSC.hg38.knownGene.

OrgDb

An OrgDb object (organism database) from Bioconductor which contains information for gene/transcript symbols from ids. For example, from orgdb <- org.Hs.eg.db.

genes

A GRanges object containing gene coordinates (start to end). Must have a symbols column matching the symbols column of exons.

exons

A GRanges object containing gene exon coordinates. Must have a symbols column matching the symbols column of genes.

TSS

A GRanges object containing standed transcription start site coordinates for computing TSS enrichment scores downstream.

annoStyle

annotation style to map between gene names and various gene identifiers e.g. "ENTREZID", "ENSEMBL".

singleStrand

A boolean for GenomicFeatures::genes(single.strand.genes.only) parameter

Examples


if (!require("TxDb.Hsapiens.UCSC.hg19.knownGene", quietly = TRUE)) BiocManager::install("TxDb.Hsapiens.UCSC.hg19.knownGene")
if (!require("org.Hs.eg.db", quietly = TRUE)) BiocManager::install("org.Hs.eg.db")
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
library(org.Hs.eg.db)

# Get Txdb
TxDb <- TxDb.Hsapiens.UCSC.hg19.knownGene

# Get OrgDb
OrgDb <- org.Hs.eg.db

# Create Genome Annotation
geneAnno <- createGeneAnnotation(TxDb=TxDb, OrgDb=OrgDb)

# Also can create from a string if BSgenome exists
geneAnno <- createGeneAnnotation("hg19")