Skip to content

Instantly share code, notes, and snippets.

@mikelove
Last active April 16, 2016 15:40
Show Gist options
  • Save mikelove/ada6951811b8b17b8bd99f0b99877416 to your computer and use it in GitHub Desktop.
Save mikelove/ada6951811b8b17b8bd99f0b99877416 to your computer and use it in GitHub Desktop.
getting GC content
library(Homo.sapiens)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
library(BSgenome.Hsapiens.UCSC.hg19)
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
e <- exonsBy(txdb, "gene")
mapIds(Homo.sapiens, "AFTPH", "ENTREZID", "SYMBOL")
ee <- e[["54812"]]
dna <- getSeq(Hsapiens, ee)
mcols(ee)$gc <- letterFrequency(dna, "GC", as.prob=TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment