# # - eval = TRUE ---------------------------------------------------------------- 库(DNAshapeR) # # - eval = TRUE ---------------------------------------------------------------- 库(DNAshapeR) fn < -系统。文件(“extdata”、“CGRsample。足总”,包= " DNAshapeR”)pred < - getShape (fn) # # - eval = FALSE --------------------------------------------------------------- # # 如果(安装Bioconductor包# !requireNamespace("BiocManager", quiet =TRUE)) # install.packages("BiocManager") # BiocManager::install("BSgenome.Scerevisiae.UCSC.sacCer3") # # library(BSgenome.Scerevisiae.UCSC.sacCer3) # # #创建查询GRanges对象# gr <- GRanges(seqnames = c("chrI"), # strand = c("+", "-", "+"), # ranges = IRanges(start = c(100,200,300), width = 100)) # getFasta(gr, Scerevisiae, width = 100, filename = "tmp.fa") # fn <- "tmp. conf ")足总“# pred < - getShape (fn) # # - eval = FALSE --------------------------------------------------------------- # # 安装Bioconductor包#库(BSgenome.Hsapiens.UCSC.hg19) #库(AnnotationHub) # #啊< - AnnotationHub() #啊< -子集(物种啊,= =“智人”)#啊< -查询(啊,c(“H3K4me3”、“Gm12878”,“路线图”))# getFasta(啊[[1]],Hsapiens,宽度= 150,文件名=“tmp.fa”)# fn <——“tmp。足总“# pred < - getShape (fn) # # - eval = TRUE ---------------------------------------------------------------- 库(DNAshapeR) fn_methy < -系统。文件(“extdata”、“MethylSample。足总”,包= " DNAshapeR”)pred_methy < - getShape (fn_methy混入甲醇= TRUE) pred_methy MGW # #美元——eval = TRUE ---------------------------------------------------------------- 库(DNAshapeR) fn_methy < -系统。文件(“extdata”、“SingleSeqsample。fn_methy_pos <- system. fa", package = "DNAshapeR")文件(“extdata”、“MethylSamplePos。, package = "DNAshapeR") pred_methy <- getShape(fn_methy, methylate = TRUE, methylatedPosFile = fn_methy_pos) pred_methy$ mgw# # ----图。width=7, fig.height=7, fig.align='center', eval=TRUE----------------- plotShape(pred$MGW) #plotShape(pred$ProT) #plotShape(pred$Roll) #plotShape(pred$HelT) ## ----width=7, fig.height=7, fig.align='center', eval=TRUE----------------- library(fields) heatShape(pred$ProT, 20) #heatShape(pred$MGW, 20) #heatShape(pred$Roll[1:500, 1:20 0], 20) #heatShape(pred$HelT[1:500, 1:20 0], 20) #heatShape(pred$HelT[1:500, 1:20 0], 20) ## ----宽度= 7,fig.height = 7, fig.align =‘中心’,eval = TRUE ----------------- fn2 < -系统。文件(“extdata”、“SingleSeqsample。足总”,包= " DNAshapeR”)pred2 < - getShape (fn2) trackShape (pred2 fn2) #只对单一序列文件# # - eval = TRUE ---------------------------------------------------------------- 库(Biostrings) fn3 < -系统。文件(“extdata”、“PBMsample_short。足总”,包= " DNAshapeR”)pred3 < - getShape (fn3) featureType < - c(“m”、“1-shape”)featureVector < - encodeSeqShape (fn3, pred3 featureType)头(featureVector) # # - eval = TRUE ---------------------------------------------------------------- fn4 < -系统。文件(“extdata”、“PBMsample_short。s", package = "DNAshapeR") experimentalData <- read.table(fn4) df <- data.frame(affinity=experimentalData$V1, featureVector) ## ----eval=TRUE---------------------------------------------------------------- library(caret) trainControl <- trainControl(method = "cv", number = 3, savePredictions = TRUE) model <- train (affinity~ ., data = df, trControl=trainControl, method="lm", preProcess=NULL) model ## ----eval=TRUE---------------------------------------------------------------- sessionInfo()