# # - - - - - eval = TRUE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -库(DNAshapeR) # # - - - - - eval = TRUE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -库(DNAshapeR) fn < -系统。文件(“extdata”、“CGRsample。足总”,包= " DNAshapeR”) pred < - getShape (fn) # # - - - - - eval = FALSE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # #安装Bioconductor包#如果!requireNamespace (“BiocManager”,悄悄地= TRUE)) # install.packages (BiocManager) # BiocManager::安装(“BSgenome.Scerevisiae.UCSC.sacCer3”)图书馆(BSgenome.Scerevisiae.UCSC.sacCer3) # # # # # # gr < -创建一个查询农庄对象农庄(seqnames = c (“chrI”), #链= c(“+”、“-”、“+”), #范围= IRanges(开始= c(100、200、300),宽度= 100))# getFasta (gr、Scerevisiae宽度= 100,文件名=“tmp.fa”) # fn <——“tmp。足总“# 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。足总”,包= " DNAshapeR”) fn_methy_pos < -系统。文件(“extdata”、“MethylSamplePos。足总”,包= " DNAshapeR”) pred_methy < - getShape (fn_methy混入甲醇= TRUE, methylatedPosFile = fn_methy_pos) pred_methy MGW # #美元——无花果。宽度= 7,fig.height = 7, fig.align =‘中心’,eval = TRUE - - - - - - - - - - - - - - - - - - plotShape (pred MGW美元)# plotShape (pred ProT美元)# plotShape (pred辊美元)# plotShape (pred HelT美元)# #——无花果。宽度= 7,fig.height = 7, fig.align =‘中心’,eval = TRUE - - - - - - - - - - - - - - - - - -库(字段)heatShape (pred ProT美元,20)# heatShape (pred MGW美元,20)# heatShape (pred辊(1:50 0,1:1980)美元,20)# heatShape (pred HelT(1:50 0, 1:1980)美元,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()