## ----风格,echo = false,结果='Asis'-----------------------------------------------------生物焦质:: markdown()选项(width = 100,max.print = 1000)knitr :: opts_chunk $ set(eval =As.Logical(sys.getenv(“knitr_eval”,“true”)),cache = as.logical(sys.getenv(“knitr_cache”,“true”)),错误= false)## ---- TXDB------------------------------------------------------------------------------------------------- uppressPackageStartUpMessages({库(“Txdb.rnorvegicus.ucsc。RN5.refgene“)})TXDB < - TXDB.rnorvegicus.Cucsc.rn5.refgene ##查找所有基因RATGENES < - 基因(TXDB)##列出所有序列SEQINFO(RUTGENES)##子集仅包含标准染色体的标准染色体<- PrecestStandardChromosomes(RATGENES)##找到基因'ACSL5'ACSL5 < - RATGENES [哪个(MCOL(RATGENES)$ GENE_ID == 94340),] ACSL5 ## ---- BSGONOME -------------------------------------------------------------------------------------------------- suppressPackageStartUpMessages({库(BSGenome.rnorvegicus.ucsc.rn5)})ratseq < - bsgenome.rnorvegicus.ucc.rn5 class(ratseq)##获取序列ACSL5_Sequence < - GetSeq(Ratseq,ACSL5)##计算GC内容Letterfruency(ACSL5_Sequence,“GC”,As.prob = True)## ----选择-RAT ---------------------------------------------------------------------------------------------------------------------------------------------------------------------论文(“rattus.norvegicus”)##获得所有entrex ID和基因名称之间的映射RatgenEnames < - 选择(rattus.norvegicus,Ratenes $ Gene_ID,列= C(“符号”,'GeneID'),KeyType =“GeneID”)##将entrz ID与子集id id id < - match(ratgenenames $ geneid,Rategenes $ Gene_id)##将碎片状结果添加到Granges MCols(RUTGENES)< - RUTGENENAMES [IDX,] RATGENES ## ---- GTF-TO-GR,EVAL = FALSE --------------------------------------------------------------------------------------#库(AnnotationHub)#Ah = AnnotationHub()############-查询(AH,C(“GTF”,“Homo Sapiens”,“grch38","80")) # gtf_humans # # ## download the file # gtfFile <- ah[["AH47066"]] # # ## create a txdb # library(GenomicFeatures) # txdb <- makeTxDbFromGRanges(gtfFile) #may take some time.. # txdb # # ## get the genes from the taxdb object # humanGenes <- genes(txdb) ## ----chainfile------------------------------------------------------------------------------------ ## a) get the chain file ## load the package and query the files to find the file we want library(AnnotationHub) ah = AnnotationHub() query(ah , c("rattus", "rn5", "rn6")) ## learn more about the file you want ah["AH14761"] ## download the file ratChain <- ah[["AH14761"]] ratChain ## b) perform the liftover library(rtracklayer) lft <- liftOver(acsl5, ratChain) lft ## ----sessionInfo---------------------------------------------------------------------------------- sessionInfo()