CmhaDSO GenomicFeatures

使用例

# GenomicFeatures
BiocManager::install("GenomicFeatures")
library(GenomicFeatures)

# Human Tx Annotation
BiocManager::install("TxDb.Hsapiens.UCSC.hg19.knownGene")
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene

# Mouse Tx Annotation
BiocManager::install("TxDb.Mmusculus.UCSC.mm10.ensGene")
library(TxDb.Mmusculus.UCSC.mm10.ensGene)
txdb <- TxDb.Mmusculus.UCSC.mm10.ensGene

# Chr
seqlevels(txdb)
seqlevels(txdb) <- "chr1"
seqlevels(txdb) <- seqlevels0(txdb)

# GR
gr <- transcripts(txdb)
gr <- transcripts(txdb, filter=list(tx_chrom="chr1", tx_strand="+"))
gr <- promoters(txdb, upstream=2000, downstream=400)
gr <- exons(txdb)
gr <- cds(txdb)

# GRL
grl <- transcriptsBy(txdb, by="gene")
grl <- exonsBy(txdb, by="tx")
grl <- cdsBy(txdb, by="tx")

grl <- intronsByTranscript(txdb)
grl <- fiveUTRsByTranscript(txdb)
grl <- threeUTRsByTranscript(txdb)

length(grl)
names(grl)

# GET SEQ
seq <- extractTranscriptSeqs(Hsapiens, cdsBy(txdb, by="tx", use.name=TRUE))
translate(seq)

# NEW TxDB object
makeTxDbFromUCSC
makeTxDbFromBiomart
makeTxDbFromEnsembl
makeTxDbFromGFF

# SAVE & LOAD TxDB object
saveDb(txdb, file="foo.sqlite")
txdb <- loadDb("foo.sqlite")

参考文献