在这个小插曲中,我们演示了在nullranges.“不分段的”指的是这个实现不考虑对基因组的分段来进行块的采样,参见分段块引导小插图的替代实现。
首先我们使用下载的A549中的dna酶超敏峰AnnotationHub,并按nullrangesData包中。
下面的代码块计算各种类型的引导/排列方案,首先在染色体内,然后跨染色体(默认值)。默认的类型
是bootstrap,和默认的withinChrom
是假
(引导块在染色体之间移动)。
set.seed(5)#再现性图书馆(微基准测试)blockLength < -5 e5微基准测试(列表=船向一边倾斜的(p_within =bootRanges(国土安全部blockLength =blockLength,类型=“交换”,withinChrom =真正的),b_within =bootRanges(国土安全部blockLength =blockLength,类型=“引导”,withinChrom =真正的),p_across =bootRanges(国土安全部blockLength =blockLength,类型=“交换”,withinChrom =假),b_across =bootRanges(国土安全部blockLength =blockLength,类型=“引导”,withinChrom =假)),* =10)
##单位:毫秒## expr min lq mean median uq max neval cld ## p_within 933.3921 960.8329 1360.1196 1167.8408 1935.4512 2163.3598 10 b# # b_within 852.4478 942.3608 1340.6979 947.0155 1221.6593 3875.1583 10 b# # p_across 214.8735 231.0009 280.1609 255.0290 296.8121 487.2238 10 a ## b_across 238.9146 247.7053 263.8726 259.3734 278.3249 313.9127 10 a
中实现的无分段引导的不同选项的可视化,我们创建了一些合成范围nullranges.
图书馆(GenomicRanges)seq_nms < -代表(c(“chr1”,“chr2”,“chr3”),c(4,5,2))gr < -农庄(seqnames =seq_nms,IRanges(开始=c(1,101,121,201,101,201,216,231,401,1,101),宽度=c(20.,5,5,30.,20.,5,5,5,30.,80,40)),seqlengths =c(chr1 =300,chr2 =450,chr3 =200),空空的=因素(seq_nms))
下面的函数使用来自的函数plotgardener画出范围。在绘图助手函数中注意空空的
将用于颜色范围的染色体起源。
suppressPackageStartupMessages(图书馆(plotgardener))plotGRanges < -函数(gr) {pageCreate(宽度=5,身高=2,xgrid =0,ygrid =0,showGuides =假)为(我在seq_along(seqlevels(gr))) {铬< -seqlevels(gr)[我]chromend < -seqlengths(gr)[[铬]]suppressMessages({p < - - - - - -pgParams(chromstart =0,chromend =chromend,x =0.5,宽度=4*chromend/500,身高=0.5,在=seq(0chromend,50),填补=colorby(“装备”,面板=palette.colors))prng < -plotRanges(data =gr,params =p,铬=铬,y =0.25+(我-1)*.7,就=c(“左”,“底”))annoGenomeLabel(情节=prng,params =p,y =0.30+(我-1)*.7)})}}
可视化染色体内的两种排列:
为(我在1:2){gr_prime < -bootRanges(gr,blockLength =One hundred.,类型=“交换”,withinChrom =真正的)plotGRanges(gr_prime)}
染色体中的两个自举带形象化:
## R版本4.2.1(22-06-23)##平台:x86_64-pc-linux-gnu(64位)##运行在:Ubuntu 20.04.5 LTS ## ##矩阵产品:default ## BLAS: /home/biocbuild/bbs-3.16-bio /R/lib/libRblas. ##因此## LAPACK: /home/biocbuild/bbs-3.16-bio /R/lib/libRlapack。因此## ## locale: ## [1] LC_CTYPE=en_US。UTF-8 LC_NUMERIC= c# [3] LC_TIME=en_GB LC_COLLATE= c# [5] LC_MONETARY=en_US。utf - 8 LC_MESSAGES = en_US。UTF-8 ## [7] LC_PAPER=en_US。UTF-8 LC_NAME= c# [9] LC_ADDRESS=C LC_TELEPHONE= c# [11] LC_MEASUREMENT=en_US。UTF-8 LC_IDENTIFICATION=C ## ##附加的基本包:## [1]grid stats4 stats graphics grDevices utils datasets ## [8] methods base ## ##其他附加包:# # # # [1] microbenchmark_1.4.9 purrr_0.3.5 [3] ggridges_0.5.4 tidyr_1.2.1 # # [5] EnsDb.Hsapiens.v86_2.99.0 ensembldb_2.22.0 # # [7] AnnotationFilter_1.22.0 GenomicFeatures_1.50.0 # # [9] AnnotationDbi_1.60.0 patchwork_1.1.2 # # [11] plyranges_1.18.0 nullrangesData_1.3.0 # # [13] ExperimentHub_2.6.0 AnnotationHub_3.6.0 # # [15] BiocFileCache_2.6.0 dbplyr_2.2.1 # # [17] ggplot2_3.3.6 plotgardener_1.4.0 # # [19] nullranges_1.4.0 InteractionSet_1.26.0 # # [21] SummarizedExperiment_1.28.0 Biobase_2.58.0 # #[23] MatrixGenerics_1.10.0 matrixStats_0.62.0 ## [25] genome icranges_1 .50.0 GenomeInfoDb_1.34.0 ## [27] IRanges_2.32.0 S4Vectors_0.36.0 ## [29] BiocGenerics_0.44.0 ## ##通过命名空间加载(并没有附加):# # # # [1] RcppHMM_1.2.2 lazyeval_0.2.2 [3] splines_4.2.1 BiocParallel_1.32.0 # # [5] TH.data_1.1-1 digest_0.6.30 # # [7] yulab.utils_0.0.5 htmltools_0.5.3 # # [9] fansi_1.0.3 magrittr_2.0.3 # # [11] memoise_2.0.1 ks_1.13.5 # # [13] Biostrings_2.66.0 sandwich_3.0-2 # # [15] prettyunits_1.1.1 jpeg_0.1-9 # # [17] colorspace_2.0-3 blob_1.2.3 # # [19] rappdirs_0.3.3 xfun_0.34 # # [21] dplyr_1.0.10 crayon_1.5.2 # # [23] rcurl_1.98 - 1.9 jsonlite_1.8.3 # # [25] survival_3.4-0 zoo_1.8-11 # # [27] glue_1.6.2gtable_0.3.1 # # [29] zlibbioc_1.44.0 XVector_0.38.0 # # [31] strawr_0.0.9 DelayedArray_0.24.0 # # [33] scales_1.2.1 mvtnorm_1.1-3 # # [35] DBI_1.1.3 Rcpp_1.0.9 # # [37] xtable_1.8-4 progress_1.2.2 # # [39] gridGraphics_0.5-1 bit_4.0.4 # # [41] mclust_6.0.0 httr_1.4.4 # # [43] RColorBrewer_1.1-3 speedglm_0.3-4 # # [45] ellipsis_0.3.2 pkgconfig_2.0.3 # # [47] xml_3.99 - 0.12 farver_2.1.1 # # [49] sass_0.4.2 utf8_1.2.2 # # [51] DNAcopy_1.72.0 ggplotify_0.1.0 # # [53] tidyselect_1.2.0 labeling_0.4.2 # # [55]rlang_1.0.6 later_1.3.0 ## [57] munsell_0.5.0 biocversion_1 .16.0 ## # [59] tools_4.2.1 cachem_1.0.6 ## [63] RSQLite_2.2.18 evaluate_0.17 ## [65] string_1 .4.1 fastmap_1.1.0 ## [67] yaml_2.3.6 knitr_1.40 ## [69] bit64_1 .0.5 KEGGREST_1.38.0 ## [71] mime_0.12 pracma_2.4.2 ## [73] xml2_1.3.3 biomaRt_2.54.0 ## [75] compiler_4.2.1 filelock_1.0.2 ## [77] curl_1 .3.3 png_0.1-7 ## [79] interactiveDisplayBase_1.36.0 tibb_7.8 ## [83] highr_0.9 lattice_0.20-45 ## [85] ProtGenerics_1.30.0 Matrix_1.5-1 ## [87] vctrs_0.5.0 pillar_1.8.1 ## [89] lifecycle_1.0.3 BiocManager_1.30.19 ## [91] jquerylib_0.1.4 data.table_1.14.4 ## [93] bitops_1.0-7 httpuv_1.6.6 ## [95] rtracklayer_1.58.0 R6_2.5.1 ## [97] BiocIO_1.8.0 promises_1.2.0.1 ## [99] KernSmooth_2.23-20 codetools_0.2-18 ## [101] MASS_7.3-58.1 assertthat_0.2.1 ## [103] rjson_0.2.21 withr_2.5.0 ## [105] GenomicAlignments_1.34.0 Rsamtools_2.14.0 ## [107] multcomp_1.4-20 GenomeInfoDbData_1.2.9 ## [109] parallel_4.2.1 hms_1.1.2 ## [111] rmarkdown_2.17 shiny_1.7.3 ## [113] restfulr_0.0.15