# #——风格,回声= FALSE,结果= '飞机 '------------------------------- knitr: opts_chunk设置(eval = as.logical (Sys美元。gettenv ("KNITR_EVAL", "TRUE")),缓存=as.logical(Sys. value)。采用“KNITR_CACHE”,“真正的”)))选项(宽度= 75 ) ## ---- 消息= FALSE ---------------------------------------------------- 库(SummarizedExperiment ) ## ------------------------------------------------------------------------ 库(气管)数据(气管)气道 ## ------------------------------------------------------------------------ set.seed (123) m < -矩阵(rnorm (12), nrow = 4, ncol = 3, dimnames =列表(字母[1:4],字母[1:3])) ## ------------------------------------------------------------------------ 暗(m) dimnames (m) m (1:2, 2:1) m [1:2 ,] ## ------------------------------------------------------------------------ m[[1]米,1 ] ## ------------------------------------------------------------------------ m (1,= FALSE下降 ] ## ------------------------------------------------------------------------ 米 ## ------------------------------------------------------------------------ m + 1 ## ------------------------------------------------------------------------ abs (m + 1 ) ## ------------------------------------------------------------------------ colSums (m) rowMeans (m ) ## ------------------------------------------------------------------------ colData(气管)# #------------------------------------------------------------------------ 气道美元敏捷 ## ------------------------------------------------------------------------ ridx < - rowMeans (m) > 0 m [ridx, = FALSE ] ## ------------------------------------------------------------------------ l < - (a = 1:5, b = month.abb列表 ) ## ------------------------------------------------------------------------ 名称长度(l) (l) l [c (2, 1)] l[2] #列表的长度是1,包含元素的原始列表2 l[[2]] # 2的原始列表元素 ## ------------------------------------------------------------------------ 长度(l ) ## ------------------------------------------------------------------------ r < - rowRanges(气道 ) ## ------------------------------------------------------------------------ 基因组(r) < - GRCh37 seqinfo (r ) ## ------------------------------------------------------------------------ rowRanges(气管)< - r # #------------------------------------------------------------------------ seqinfo(气道 ) ## ---- 消息= FALSE ---------------------------------------------------- 库(dplyr ) # %>% ## ------------------------------------------------------------------------ chr14 < - seqinfo (r) % > %作为(“农庄”)% > %子集(seqnames = = " 14 ") ## ------------------------------------------------------------------------ idx < - r % % chr14 r (idx ] ## ---- 消息=假 ---------------------------------------------------- 库(readr)库(宠物猫 ) ## ---- eval = FALSE ------------------------------------------------------- ## pdata_file < - file.choos () # airway-sample-sheet.csv # # counts_file < - file.choose () # airway-read-counts.csv # #——回声= FALSE ------------------------------------------------------- pdata_file < -系统。counts_file (package="BiocIntro", "extdata", "airway-sample-sheet.csv")文件(包=“BiocIntro”、“extdata”、“airway-read-counts.csv ") ## ------------------------------------------------------------------------ pdata < - read_csv (pdata_file)计数< - read_csv (counts_file ) ## ------------------------------------------------------------------------ pdata < - column_to_rownames (pdata,“运行”)计数< - column_to_rownames(计数,“运行”)se < SummarizedExperiment (t(计数)colData = pdata) ## ------------------------------------------------------------------------ sessionInfo ()