diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index 8fb8978..dd40778 100644 --- a/dev/pkgdown.yml +++ b/dev/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 3.1.11 pkgdown: 2.1.0 pkgdown_sha: ~ articles: {} -last_built: 2024-08-28T19:25Z +last_built: 2024-08-28T19:51Z urls: reference: https://huishenlab.github.io/iscream/reference article: https://huishenlab.github.io/iscream/articles diff --git a/dev/reference/query_all.html b/dev/reference/query_all.html index c6c5c67..23a41a5 100644 --- a/dev/reference/query_all.html +++ b/dev/reference/query_all.html @@ -149,7 +149,7 @@

Examples# make a vector of regions regions <- c("chr1:1-6", "chr1:7-10", "chr1:11-14") query_all(bedfiles, regions) -#> [19:25:41.281923] [iscream::query_all] [info] Querying 3 regions from 4 bedfiles +#> [19:51:14.629397] [iscream::query_all] [info] Querying 3 regions from 4 bedfiles #> #> $M #> a b c d diff --git a/dev/reference/region_map.html b/dev/reference/region_map.html index e449c3e..c4df0fc 100644 --- a/dev/reference/region_map.html +++ b/dev/reference/region_map.html @@ -160,7 +160,7 @@

Examples# make a vector of regions regions <- c("chr1:1-6", "chr1:7-10", "chr1:11-14") region_map(bedfiles, regions) -#> [19:25:54.191224] [iscream::region_map] [info] Aggregating 3 regions from 4 bedfiles +#> [19:51:27.276918] [iscream::region_map] [info] Aggregating 3 regions from 4 bedfiles #> #> Feature Cell coverage M #> 1 chr1:1-6 a 4 2 @@ -176,7 +176,7 @@

Examples#> 11 chr1:7-10 d 3 1 #> 12 chr1:11-14 d 1 1 region_map(bedfiles, regions, mval = FALSE) -#> [19:25:54.193726] [iscream::region_map] [info] Aggregating 3 regions from 4 bedfiles +#> [19:51:27.279301] [iscream::region_map] [info] Aggregating 3 regions from 4 bedfiles #> #> Feature Cell coverage beta #> 1 chr1:1-6 a 4 2.0 @@ -192,7 +192,7 @@

Examples#> 11 chr1:7-10 d 3 0.5 #> 12 chr1:11-14 d 1 1.0 region_map(bedfiles, regions, fun = "average") -#> [19:25:54.195976] [iscream::region_map] [info] Averaging 3 regions from 4 bedfiles +#> [19:51:27.281439] [iscream::region_map] [info] Averaging 3 regions from 4 bedfiles #> #> Feature Cell coverage M #> 1 chr1:1-6 a 1.333333 0.6666667 diff --git a/dev/search.json b/dev/search.json index a25381e..e9e0dc7 100644 --- a/dev/search.json +++ b/dev/search.json @@ -1 +1 @@ -[{"path":"https://huishenlab.github.io/iscream/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 iscream authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"James Eapen. Author, maintainer.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Eapen J (2024). iscream: Integrating Single-Cell Results Exploring Analyzing Methylation. R package version 0.0.0.9000, https://github.com/huishenlab/iscream/, https://huishenlab.github.io/iscream/.","code":"@Manual{, title = {iscream: Integrating Single-Cell Results for Exploring and Analyzing Methylation}, author = {James Eapen}, year = {2024}, note = {R package version 0.0.0.9000, https://github.com/huishenlab/iscream/}, url = {https://huishenlab.github.io/iscream/}, }"},{"path":"https://huishenlab.github.io/iscream/dev/index.html","id":"iscream-","dir":"","previous_headings":"","what":"iscream","title":"Integrating Single-Cell Results for Exploring and Analyzing Methylation","text":"Integrating Single-Cell Results Exploring Analyzing Methylation Analysis visualization Whole Genome Bisulfite Sequencing (WGBS) data requires reading aligned sequencing data formats existing packages like BSseq scMET can analyze. Getting data -disk formats like bedfiles matrix methylation values can difficult , nearly 30 million CpGs, WGBS data can quite large. iscream aims efficiently read alinged (sc)WGBS data formats can used packages. iscream uses htslib query genomic regions make matrices BSSeq aggregate methylated reads scMET.","code":""},{"path":[]},{"path":[]},{"path":"https://huishenlab.github.io/iscream/dev/index.html","id":"htslib","dir":"","previous_headings":"Installation > System dependencies","what":"htslib","title":"Integrating Single-Cell Results for Exploring and Analyzing Methylation","text":"iscream depends htslib header files. may installed package manager: ubuntu/debian: libhts-dev fedora/RHEL: htslib-devel brew: htslib nixpkgs: htslib may also found among HPC modules - make sure PKG_CONFIG_PATH environment variable includes pkgconfig location installation htslib. can verify htslib development libraries installed pkg-config:","code":"pkg-config --cflags --libs htslib"},{"path":"https://huishenlab.github.io/iscream/dev/index.html","id":"github","dir":"","previous_headings":"Installation","what":"GitHub","title":"Integrating Single-Cell Results for Exploring and Analyzing Methylation","text":"can install development version Github cloning repo running can also use R devtools package: pak:","code":"git clone https://github.com/huishenlab/iscream R CMD INSTALL iscream devtools::install_github(\"huishenlab/iscream\") pak::pkg_install(\"huishenlab/iscream\")"},{"path":"https://huishenlab.github.io/iscream/dev/index.html","id":"usage","dir":"","previous_headings":"Installation","what":"Usage","title":"Integrating Single-Cell Results for Exploring and Analyzing Methylation","text":"user guide available package website. Bug reports may submitted GitHub issues.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_query_all.html","id":null,"dir":"Reference","previous_headings":"","what":"Make a Bsseq object — Cpp_query_all","title":"Make a Bsseq object — Cpp_query_all","text":"Make Bsseq object","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_query_all.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make a Bsseq object — Cpp_query_all","text":"","code":"Cpp_query_all(bedfiles, regions, bismark, merged, sparse, nthreads)"},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_query_all.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make a Bsseq object — Cpp_query_all","text":"bedfiles vector bedfiles regions vector regions bismark Whether input bismark coverage file nthreads Set number threads use overriding \"iscream.threads\" option. See ?set_threads information.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_region_map.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply a function over CpGs within features — Cpp_region_map","title":"Apply a function over CpGs within features — Cpp_region_map","text":"function called region_map() since sanity checks C++ side.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_region_map.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply a function over CpGs within features — Cpp_region_map","text":"","code":"Cpp_region_map( bedfiles, regions, fun, mval, bismark, region_rownames = FALSE, nthreads = 1L )"},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_region_map.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply a function over CpGs within features — Cpp_region_map","text":"bedfiles vector bedfile paths regions vector genomic regions fun One supported functions apply CpGs regions: \"aggregate\", \"average\". mval Calculates M values TRUE, use beta values FALSE region_rownames Whether set rownames regions strings nthreads Number cores use. See details.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_region_map.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Apply a function over CpGs within features — Cpp_region_map","text":"optimal number threads depends number bedfiles, set half available OpenMP cores. See ?get_threads details. can manaully set set_threads().","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_set_log_level.html","id":null,"dir":"Reference","previous_headings":"","what":"spdlog Logging Lever Setter — Cpp_set_log_level","title":"spdlog Logging Lever Setter — Cpp_set_log_level","text":"helper function turn logging level given string current logging level","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_set_log_level.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"spdlog Logging Lever Setter — Cpp_set_log_level","text":"","code":"Cpp_set_log_level(name)"},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_set_log_level.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"spdlog Logging Lever Setter — Cpp_set_log_level","text":"name string logging level. Value understood , decreasing verbosity ‘trace’, ‘debug’, ‘info’, ‘warning’, ‘error’, ‘critical’, ‘’. Unrecognised names equivalent ‘’.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_set_log_level.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"spdlog Logging Lever Setter — Cpp_set_log_level","text":"Nothing returned.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/check_files_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Check that files exist — check_files_exist","title":"Check that files exist — check_files_exist","text":"Check files exist","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/check_files_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check that files exist — check_files_exist","text":"","code":"check_files_exist(files_vec, error_file_prefix = \"Bedfile\")"},{"path":"https://huishenlab.github.io/iscream/dev/reference/check_files_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check that files exist — check_files_exist","text":"files_vec vector file paths error_file_prefix Error message prefix 'Bedfile' vs 'Tabix file'","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/check_files_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check that files exist — check_files_exist","text":"TRUE input bedfiles associated tabix index file. FALSE ","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/check_thread_count.html","id":null,"dir":"Reference","previous_headings":"","what":"Check that the required threads are available — check_thread_count","title":"Check that the required threads are available — check_thread_count","text":"Check required threads available","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/check_thread_count.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check that the required threads are available — check_thread_count","text":"","code":"check_thread_count( n_threads, avail_threads = availableCores(), opt_set = FALSE )"},{"path":"https://huishenlab.github.io/iscream/dev/reference/check_thread_count.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check that the required threads are available — check_thread_count","text":"n_threads number threads check availability avail_threads number threads available system. Defaults parallelly::availableCores() opt_set Whether iscream.threads options set","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/check_thread_count.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check that the required threads are available — check_thread_count","text":"n_threads requested number threads available stops ","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_log_level.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the current log level — get_log_level","title":"Get the current log level — get_log_level","text":"Can handle spdlogs levels, iscream functions supports \"info\" \"debug\"","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_log_level.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the current log level — get_log_level","text":"","code":"get_log_level()"},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_log_level.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the current log level — get_log_level","text":"current logging level string","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_omp_threads.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the number of available threads from OpenMP. — get_omp_threads","title":"Get the number of available threads from OpenMP. — get_omp_threads","text":"queries number available threads usign OpenMP, reliably provide accurate available thread count. get reliable count accounts environment variables HPC schedulers, use get_threads()`. function pulled github.com/rdatatable/data.table","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_omp_threads.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the number of available threads from OpenMP. — get_omp_threads","text":"","code":"get_omp_threads(verbose)"},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_omp_threads.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the number of available threads from OpenMP. — get_omp_threads","text":"verbose Whether verbose available omp threads","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_omp_threads.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get the number of available threads from OpenMP. — get_omp_threads","text":"","code":"get_omp_threads(verbose = TRUE) #> OpenMP version (_OPENMP) 201511 #> omp_get_num_procs() 4 #> omp_get_thread_limit() 2147483647 #> omp_get_max_threads() 4 #> [1] 4"},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_threads.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the number of available threads — get_threads","title":"Get the number of available threads — get_threads","text":"function sets number threads iscream uses 1 iscream.threads option set. set number threads use setDTthreads set iscream.threads option ~/.Rprofile. See ?set_threads information.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_threads.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the number of available threads — get_threads","text":"","code":"get_threads()"},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_threads.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the number of available threads — get_threads","text":"named vector: use_threads = iscream.threads option, whether option set user, available threads system","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_threads.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get the number of available threads — get_threads","text":"","code":"get_threads() #> use_threads opt_set avail_threads #> 1 1 4"},{"path":"https://huishenlab.github.io/iscream/dev/reference/query_all.html","id":null,"dir":"Reference","previous_headings":"","what":"Query all CpGs from input genomic regions — query_all","title":"Query all CpGs from input genomic regions — query_all","text":"Queries provided regions produces M Coverage matrices genomic positions. Parallelized across files using threads \"iscream.threads\" option. output query_all may used create BSseq object: .call(BSseq, query_all(...)).","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/query_all.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query all CpGs from input genomic regions — query_all","text":"","code":"query_all( bedfiles, regions, bismark = FALSE, merged = TRUE, sparse = FALSE, nthreads = NULL )"},{"path":"https://huishenlab.github.io/iscream/dev/reference/query_all.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query all CpGs from input genomic regions — query_all","text":"bedfiles vector bedfile paths regions vector genomic regions strings bismark Whether input bismark coverage file merged Whether input strands merged/collapsed sparse Whether return M coverage matrices sparse matrices (\"dgCMatrix\"). Set TRUE scWGBS data nthreads Set number threads use overriding \"iscream.threads\" option. See ?set_threads information.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/query_all.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Query all CpGs from input genomic regions — query_all","text":"named list M coverage matrices character vector chromosomes numeric vector corresponding CpG base positions character vector input sample names","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/query_all.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Query all CpGs from input genomic regions — query_all","text":"","code":"bedfiles <- system.file(\"extdata\", package = \"iscream\") |> list.files(pattern = \"[a|b|c|d].bed.gz$\", full.names = TRUE) # examine the bedfiles colnames <- c(\"chr\", \"start\", \"end\", \"beta\", \"coverage\") lapply(bedfiles, function(i) knitr::kable(data.table::fread(i, col.names = colnames))) #> [[1]] #> #> #> |chr | start| end| beta| coverage| #> |:----|-----:|---:|----:|--------:| #> |chr1 | 1| 2| 1.0| 1| #> |chr1 | 3| 4| 1.0| 1| #> |chr1 | 5| 6| 0.0| 2| #> |chr1 | 7| 8| 0.0| 1| #> |chr1 | 9| 10| 0.5| 2| #> |chr1 | 11| 12| 1.0| 2| #> |chr1 | 13| 14| 1.0| 3| #> #> [[2]] #> #> #> |chr | start| end| beta| coverage| #> |:----|-----:|---:|----:|--------:| #> |chr1 | 1| 2| 0| 2| #> |chr1 | 5| 6| 1| 2| #> |chr1 | 7| 8| 1| 1| #> |chr1 | 11| 12| 0| 2| #> |chr1 | 13| 14| 1| 1| #> #> [[3]] #> #> #> |chr | start| end| beta| coverage| #> |:----|-----:|---:|----:|--------:| #> |chr1 | 3| 4| 1| 2| #> |chr1 | 7| 8| 0| 2| #> |chr1 | 9| 10| 1| 1| #> #> [[4]] #> #> #> |chr | start| end| beta| coverage| #> |:----|-----:|---:|----:|--------:| #> |chr1 | 1| 2| 1.0| 1| #> |chr1 | 3| 4| 1.0| 2| #> |chr1 | 7| 8| 0.0| 1| #> |chr1 | 9| 10| 0.5| 2| #> |chr1 | 13| 14| 1.0| 1| #> # make a vector of regions regions <- c(\"chr1:1-6\", \"chr1:7-10\", \"chr1:11-14\") query_all(bedfiles, regions) #> [19:25:41.281923] [iscream::query_all] [info] Querying 3 regions from 4 bedfiles #> #> $M #> a b c d #> chr1:2 1 0 0 1 #> chr1:4 1 0 2 2 #> chr1:6 0 2 0 0 #> chr1:8 0 1 0 0 #> chr1:10 1 0 1 1 #> chr1:12 2 0 0 0 #> chr1:14 3 1 0 1 #> #> $Cov #> a b c d #> chr1:2 1 2 0 1 #> chr1:4 1 0 2 2 #> chr1:6 2 2 0 0 #> chr1:8 1 1 2 1 #> chr1:10 2 0 1 2 #> chr1:12 2 2 0 0 #> chr1:14 3 1 0 1 #> #> $pos #> [1] 1 3 5 7 9 11 13 #> #> $chr #> [1] \"chr1\" \"chr1\" \"chr1\" \"chr1\" \"chr1\" \"chr1\" \"chr1\" #> #> $sampleNames #> [1] \"a\" \"b\" \"c\" \"d\" #> # for BSseq object run if (FALSE) { # \\dontrun{ library(bsseq) do.call(BSseq, query_all(bedfiles, regions)) } # }"},{"path":"https://huishenlab.github.io/iscream/dev/reference/region_map.html","id":null,"dir":"Reference","previous_headings":"","what":"Run a defined function over genomic regions — region_map","title":"Run a defined function over genomic regions — region_map","text":"Run function CpGs bedfiles across genomic regions. Currently supported functions aggregate average. Parallelized across files using threads \"iscream.threads\" option.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/region_map.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run a defined function over genomic regions — region_map","text":"","code":"region_map( bedfiles, regions, fun = \"aggregate\", bismark = FALSE, mval = TRUE, set_region_rownames = FALSE, nthreads = NULL )"},{"path":"https://huishenlab.github.io/iscream/dev/reference/region_map.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run a defined function over genomic regions — region_map","text":"bedfiles vector bedfile paths regions vector genomic regions strings. named vector provided, names used feature column instead genomic regions string fun Function apply region. See details. bismark Whether input bismark coverage file mval Whether calculate M value (coverage \\(\\times \\beta\\)) use beta value applying function. set_region_rownames Use region strings returned data frame's rownames. Can useful named vector regions want rownames feature names. nthreads Set number threads use overriding \"iscream.threads\" option. See ?set_threads information.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/region_map.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Run a defined function over genomic regions — region_map","text":"data.frame","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/region_map.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Run a defined function over genomic regions — region_map","text":"Available functions: \"aggregate\" sums values region aggregated beta values mval = FALSE aggregated M values mval = TRUE \"average\" averages values region average beta values mval = FALSE average M values mval = TRUE","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/region_map.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run a defined function over genomic regions — region_map","text":"","code":"bedfiles <- system.file(\"extdata\", package = \"iscream\") |> list.files(pattern = \"[a|b|c|d].bed.gz$\", full.names = TRUE) # examine the bedfiles colnames <- c(\"chr\", \"start\", \"end\", \"beta\", \"coverage\") lapply(bedfiles, function(i) knitr::kable(data.table::fread(i, col.names = colnames))) #> [[1]] #> #> #> |chr | start| end| beta| coverage| #> |:----|-----:|---:|----:|--------:| #> |chr1 | 1| 2| 1.0| 1| #> |chr1 | 3| 4| 1.0| 1| #> |chr1 | 5| 6| 0.0| 2| #> |chr1 | 7| 8| 0.0| 1| #> |chr1 | 9| 10| 0.5| 2| #> |chr1 | 11| 12| 1.0| 2| #> |chr1 | 13| 14| 1.0| 3| #> #> [[2]] #> #> #> |chr | start| end| beta| coverage| #> |:----|-----:|---:|----:|--------:| #> |chr1 | 1| 2| 0| 2| #> |chr1 | 5| 6| 1| 2| #> |chr1 | 7| 8| 1| 1| #> |chr1 | 11| 12| 0| 2| #> |chr1 | 13| 14| 1| 1| #> #> [[3]] #> #> #> |chr | start| end| beta| coverage| #> |:----|-----:|---:|----:|--------:| #> |chr1 | 3| 4| 1| 2| #> |chr1 | 7| 8| 0| 2| #> |chr1 | 9| 10| 1| 1| #> #> [[4]] #> #> #> |chr | start| end| beta| coverage| #> |:----|-----:|---:|----:|--------:| #> |chr1 | 1| 2| 1.0| 1| #> |chr1 | 3| 4| 1.0| 2| #> |chr1 | 7| 8| 0.0| 1| #> |chr1 | 9| 10| 0.5| 2| #> |chr1 | 13| 14| 1.0| 1| #> # make a vector of regions regions <- c(\"chr1:1-6\", \"chr1:7-10\", \"chr1:11-14\") region_map(bedfiles, regions) #> [19:25:54.191224] [iscream::region_map] [info] Aggregating 3 regions from 4 bedfiles #> #> Feature Cell coverage M #> 1 chr1:1-6 a 4 2 #> 2 chr1:7-10 a 3 1 #> 3 chr1:11-14 a 5 5 #> 4 chr1:1-6 b 4 2 #> 5 chr1:7-10 b 1 1 #> 6 chr1:11-14 b 3 1 #> 7 chr1:1-6 c 2 2 #> 8 chr1:7-10 c 3 1 #> 9 chr1:11-14 c 0 0 #> 10 chr1:1-6 d 3 3 #> 11 chr1:7-10 d 3 1 #> 12 chr1:11-14 d 1 1 region_map(bedfiles, regions, mval = FALSE) #> [19:25:54.193726] [iscream::region_map] [info] Aggregating 3 regions from 4 bedfiles #> #> Feature Cell coverage beta #> 1 chr1:1-6 a 4 2.0 #> 2 chr1:7-10 a 3 0.5 #> 3 chr1:11-14 a 5 2.0 #> 4 chr1:1-6 b 4 1.0 #> 5 chr1:7-10 b 1 1.0 #> 6 chr1:11-14 b 3 1.0 #> 7 chr1:1-6 c 2 1.0 #> 8 chr1:7-10 c 3 1.0 #> 9 chr1:11-14 c 0 0.0 #> 10 chr1:1-6 d 3 2.0 #> 11 chr1:7-10 d 3 0.5 #> 12 chr1:11-14 d 1 1.0 region_map(bedfiles, regions, fun = \"average\") #> [19:25:54.195976] [iscream::region_map] [info] Averaging 3 regions from 4 bedfiles #> #> Feature Cell coverage M #> 1 chr1:1-6 a 1.333333 0.6666667 #> 2 chr1:7-10 a 1.500000 0.5000000 #> 3 chr1:11-14 a 2.500000 2.5000000 #> 4 chr1:1-6 b 2.000000 1.0000000 #> 5 chr1:7-10 b 1.000000 1.0000000 #> 6 chr1:11-14 b 1.500000 0.5000000 #> 7 chr1:1-6 c 2.000000 2.0000000 #> 8 chr1:7-10 c 1.500000 0.5000000 #> 9 chr1:11-14 c 0.000000 0.0000000 #> 10 chr1:1-6 d 1.500000 1.5000000 #> 11 chr1:7-10 d 1.500000 0.5000000 #> 12 chr1:11-14 d 1.000000 1.0000000"},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_log_level.html","id":null,"dir":"Reference","previous_headings":"","what":"Set logging level — set_log_level","title":"Set logging level — set_log_level","text":"Set logging level","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_log_level.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set logging level — set_log_level","text":"","code":"set_log_level(level = \"info\")"},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_log_level.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set logging level — set_log_level","text":"level logging verbosity level use \"info\": default gives provides basic information number files regions used function \"debug\": verbose row allocations, many CpGs found region, filename parsing etc. mode used one thread R output messages multiple threads without crashing.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_log_level.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set logging level — set_log_level","text":"None; sets log level provided level","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_log_level.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set logging level — set_log_level","text":"","code":"set_log_level(\"info\")"},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_threads.html","id":null,"dir":"Reference","previous_headings":"","what":"Set the number of available threads — set_threads","title":"Set the number of available threads — set_threads","text":"function sets 'iscream.threads' option n_threads. see many threads available see parallelly::availableCores.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_threads.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set the number of available threads — set_threads","text":"","code":"set_threads(n_threads)"},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_threads.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set the number of available threads — set_threads","text":"n_threads number threads use","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_threads.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set the number of available threads — set_threads","text":"NULL. Sets iscream.threads option requested number threads available","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_threads.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set the number of available threads — set_threads","text":"iscream uses OpenMP parallelize certain functions. can use many threads available system varying degrees performance improvements. parallelly::availableCores() function report number available threads. get information OpenMP threads, run get_omp_threads(verbose = TRUE). However, high preformance computers (HPCs) resource allocating job schedulers like SLURM, OpenMP may detect available threads across HPC limit cores allocated scheduler. system administrator set limits, may result job taking resources jobs. limits, trying use threads available reduce iscream's performance. Job schedulers typically environment variable (e.g. SLURM_CPUS_ON_NODE SLURM) gives actual number available cores. , hyperthreaded systems, count may double available processors. Using hyperthreading guarantee performance improvement - may better set number threads half reported number. parallelly::availableCores() takes HPC scheduler/CRAN/Bioconductor limits account reporting number available threads may reliably report hyperthreading ('system' 'nproc'). set number threads without call set_threads() every session, put .Rprofile See help('Rprofile') information startup options. Functions currently using OpenMP: region_map() query_all()","code":"options(iscream.threads = [n_threads])"},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_threads.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set the number of available threads — set_threads","text":"","code":"(ncores <- parallelly::availableCores()) #> system #> 4 if (FALSE) { # \\dontrun{ set_threads(ncores) } # }"},{"path":"https://huishenlab.github.io/iscream/dev/reference/validate_log_level.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate provided logging level — validate_log_level","title":"Validate provided logging level — validate_log_level","text":"\"info\" \"debug\" currently supported, \"debug\" supported using 1 thread","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/validate_log_level.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate provided logging level — validate_log_level","text":"","code":"validate_log_level(level = get_log_level(), n_threads)"},{"path":"https://huishenlab.github.io/iscream/dev/reference/validate_log_level.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate provided logging level — validate_log_level","text":"level logging level validate n_threads number threads next iscream function call use","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/validate_log_level.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate provided logging level — validate_log_level","text":"None; sets log level provide level","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/validate_log_level.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate provided logging level — validate_log_level","text":"","code":"set_log_level(\"info\")"},{"path":"https://huishenlab.github.io/iscream/dev/reference/verify_files_or_stop.html","id":null,"dir":"Reference","previous_headings":"","what":"Verify that bedfiles are tabixed — verify_files_or_stop","title":"Verify that bedfiles are tabixed — verify_files_or_stop","text":"Verify bedfiles tabixed","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/verify_files_or_stop.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Verify that bedfiles are tabixed — verify_files_or_stop","text":"","code":"verify_files_or_stop(bedfiles, verify_tabix = TRUE)"},{"path":"https://huishenlab.github.io/iscream/dev/reference/verify_files_or_stop.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Verify that bedfiles are tabixed — verify_files_or_stop","text":"bedfiles vector bedfile paths verify_tabix Whether verify presence tabix files","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/verify_files_or_stop.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Verify that bedfiles are tabixed — verify_files_or_stop","text":"TRUE input bedfiles associated tabix index file. FALSE ","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/verify_regions_or_stop.html","id":null,"dir":"Reference","previous_headings":"","what":"Verify that regions are valid — verify_regions_or_stop","title":"Verify that regions are valid — verify_regions_or_stop","text":"Verify regions valid","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/verify_regions_or_stop.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Verify that regions are valid — verify_regions_or_stop","text":"","code":"verify_regions_or_stop(regions)"},{"path":"https://huishenlab.github.io/iscream/dev/reference/verify_regions_or_stop.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Verify that regions are valid — verify_regions_or_stop","text":"regions vector genomic regions","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/verify_regions_or_stop.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Verify that regions are valid — verify_regions_or_stop","text":"TRUE input regions start 'chr' FALSE ","code":""}] +[{"path":"https://huishenlab.github.io/iscream/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 iscream authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"James Eapen. Author, maintainer.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Eapen J (2024). iscream: Integrating Single-Cell Results Exploring Analyzing Methylation. R package version 0.0.0.9000, https://github.com/huishenlab/iscream/, https://huishenlab.github.io/iscream/.","code":"@Manual{, title = {iscream: Integrating Single-Cell Results for Exploring and Analyzing Methylation}, author = {James Eapen}, year = {2024}, note = {R package version 0.0.0.9000, https://github.com/huishenlab/iscream/}, url = {https://huishenlab.github.io/iscream/}, }"},{"path":"https://huishenlab.github.io/iscream/dev/index.html","id":"iscream-","dir":"","previous_headings":"","what":"iscream","title":"Integrating Single-Cell Results for Exploring and Analyzing Methylation","text":"Integrating Single-Cell Results Exploring Analyzing Methylation Analysis visualization Whole Genome Bisulfite Sequencing (WGBS) data requires reading aligned sequencing data formats existing packages like BSseq scMET can analyze. Getting data -disk formats like bedfiles matrix methylation values can difficult , nearly 30 million CpGs, WGBS data can quite large. iscream aims efficiently read alinged (sc)WGBS data formats can used packages. iscream uses htslib query genomic regions make matrices BSSeq aggregate methylated reads scMET.","code":""},{"path":[]},{"path":[]},{"path":"https://huishenlab.github.io/iscream/dev/index.html","id":"htslib","dir":"","previous_headings":"Installation > System dependencies","what":"htslib","title":"Integrating Single-Cell Results for Exploring and Analyzing Methylation","text":"iscream depends htslib header files. may installed package manager: ubuntu/debian: libhts-dev fedora/RHEL: htslib-devel brew: htslib nixpkgs: htslib may also found among HPC modules - make sure PKG_CONFIG_PATH environment variable includes pkgconfig location installation htslib. can verify htslib development libraries installed pkg-config:","code":"pkg-config --cflags --libs htslib"},{"path":"https://huishenlab.github.io/iscream/dev/index.html","id":"github","dir":"","previous_headings":"Installation","what":"GitHub","title":"Integrating Single-Cell Results for Exploring and Analyzing Methylation","text":"can install development version Github cloning repo running can also use R devtools package: pak:","code":"git clone https://github.com/huishenlab/iscream R CMD INSTALL iscream devtools::install_github(\"huishenlab/iscream\") pak::pkg_install(\"huishenlab/iscream\")"},{"path":"https://huishenlab.github.io/iscream/dev/index.html","id":"usage","dir":"","previous_headings":"Installation","what":"Usage","title":"Integrating Single-Cell Results for Exploring and Analyzing Methylation","text":"user guide available package website. Bug reports may submitted GitHub issues.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_query_all.html","id":null,"dir":"Reference","previous_headings":"","what":"Make a Bsseq object — Cpp_query_all","title":"Make a Bsseq object — Cpp_query_all","text":"Make Bsseq object","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_query_all.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make a Bsseq object — Cpp_query_all","text":"","code":"Cpp_query_all(bedfiles, regions, bismark, merged, sparse, nthreads)"},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_query_all.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make a Bsseq object — Cpp_query_all","text":"bedfiles vector bedfiles regions vector regions bismark Whether input bismark coverage file nthreads Set number threads use overriding \"iscream.threads\" option. See ?set_threads information.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_region_map.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply a function over CpGs within features — Cpp_region_map","title":"Apply a function over CpGs within features — Cpp_region_map","text":"function called region_map() since sanity checks C++ side.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_region_map.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply a function over CpGs within features — Cpp_region_map","text":"","code":"Cpp_region_map( bedfiles, regions, fun, mval, bismark, region_rownames = FALSE, nthreads = 1L )"},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_region_map.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply a function over CpGs within features — Cpp_region_map","text":"bedfiles vector bedfile paths regions vector genomic regions fun One supported functions apply CpGs regions: \"aggregate\", \"average\". mval Calculates M values TRUE, use beta values FALSE region_rownames Whether set rownames regions strings nthreads Number cores use. See details.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_region_map.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Apply a function over CpGs within features — Cpp_region_map","text":"optimal number threads depends number bedfiles, set half available OpenMP cores. See ?get_threads details. can manaully set set_threads().","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_set_log_level.html","id":null,"dir":"Reference","previous_headings":"","what":"spdlog Logging Lever Setter — Cpp_set_log_level","title":"spdlog Logging Lever Setter — Cpp_set_log_level","text":"helper function turn logging level given string current logging level","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_set_log_level.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"spdlog Logging Lever Setter — Cpp_set_log_level","text":"","code":"Cpp_set_log_level(name)"},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_set_log_level.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"spdlog Logging Lever Setter — Cpp_set_log_level","text":"name string logging level. Value understood , decreasing verbosity ‘trace’, ‘debug’, ‘info’, ‘warning’, ‘error’, ‘critical’, ‘’. Unrecognised names equivalent ‘’.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/Cpp_set_log_level.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"spdlog Logging Lever Setter — Cpp_set_log_level","text":"Nothing returned.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/check_files_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Check that files exist — check_files_exist","title":"Check that files exist — check_files_exist","text":"Check files exist","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/check_files_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check that files exist — check_files_exist","text":"","code":"check_files_exist(files_vec, error_file_prefix = \"Bedfile\")"},{"path":"https://huishenlab.github.io/iscream/dev/reference/check_files_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check that files exist — check_files_exist","text":"files_vec vector file paths error_file_prefix Error message prefix 'Bedfile' vs 'Tabix file'","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/check_files_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check that files exist — check_files_exist","text":"TRUE input bedfiles associated tabix index file. FALSE ","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/check_thread_count.html","id":null,"dir":"Reference","previous_headings":"","what":"Check that the required threads are available — check_thread_count","title":"Check that the required threads are available — check_thread_count","text":"Check required threads available","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/check_thread_count.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check that the required threads are available — check_thread_count","text":"","code":"check_thread_count( n_threads, avail_threads = availableCores(), opt_set = FALSE )"},{"path":"https://huishenlab.github.io/iscream/dev/reference/check_thread_count.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check that the required threads are available — check_thread_count","text":"n_threads number threads check availability avail_threads number threads available system. Defaults parallelly::availableCores() opt_set Whether iscream.threads options set","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/check_thread_count.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check that the required threads are available — check_thread_count","text":"n_threads requested number threads available stops ","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_log_level.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the current log level — get_log_level","title":"Get the current log level — get_log_level","text":"Can handle spdlogs levels, iscream functions supports \"info\" \"debug\"","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_log_level.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the current log level — get_log_level","text":"","code":"get_log_level()"},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_log_level.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the current log level — get_log_level","text":"current logging level string","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_omp_threads.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the number of available threads from OpenMP. — get_omp_threads","title":"Get the number of available threads from OpenMP. — get_omp_threads","text":"queries number available threads usign OpenMP, reliably provide accurate available thread count. get reliable count accounts environment variables HPC schedulers, use get_threads()`. function pulled github.com/rdatatable/data.table","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_omp_threads.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the number of available threads from OpenMP. — get_omp_threads","text":"","code":"get_omp_threads(verbose)"},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_omp_threads.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the number of available threads from OpenMP. — get_omp_threads","text":"verbose Whether verbose available omp threads","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_omp_threads.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get the number of available threads from OpenMP. — get_omp_threads","text":"","code":"get_omp_threads(verbose = TRUE) #> OpenMP version (_OPENMP) 201511 #> omp_get_num_procs() 4 #> omp_get_thread_limit() 2147483647 #> omp_get_max_threads() 4 #> [1] 4"},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_threads.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the number of available threads — get_threads","title":"Get the number of available threads — get_threads","text":"function sets number threads iscream uses 1 iscream.threads option set. set number threads use setDTthreads set iscream.threads option ~/.Rprofile. See ?set_threads information.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_threads.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the number of available threads — get_threads","text":"","code":"get_threads()"},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_threads.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the number of available threads — get_threads","text":"named vector: use_threads = iscream.threads option, whether option set user, available threads system","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/get_threads.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get the number of available threads — get_threads","text":"","code":"get_threads() #> use_threads opt_set avail_threads #> 1 1 4"},{"path":"https://huishenlab.github.io/iscream/dev/reference/query_all.html","id":null,"dir":"Reference","previous_headings":"","what":"Query all CpGs from input genomic regions — query_all","title":"Query all CpGs from input genomic regions — query_all","text":"Queries provided regions produces M Coverage matrices genomic positions. Parallelized across files using threads \"iscream.threads\" option. output query_all may used create BSseq object: .call(BSseq, query_all(...)).","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/query_all.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query all CpGs from input genomic regions — query_all","text":"","code":"query_all( bedfiles, regions, bismark = FALSE, merged = TRUE, sparse = FALSE, nthreads = NULL )"},{"path":"https://huishenlab.github.io/iscream/dev/reference/query_all.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query all CpGs from input genomic regions — query_all","text":"bedfiles vector bedfile paths regions vector genomic regions strings bismark Whether input bismark coverage file merged Whether input strands merged/collapsed sparse Whether return M coverage matrices sparse matrices (\"dgCMatrix\"). Set TRUE scWGBS data nthreads Set number threads use overriding \"iscream.threads\" option. See ?set_threads information.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/query_all.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Query all CpGs from input genomic regions — query_all","text":"named list M coverage matrices character vector chromosomes numeric vector corresponding CpG base positions character vector input sample names","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/query_all.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Query all CpGs from input genomic regions — query_all","text":"","code":"bedfiles <- system.file(\"extdata\", package = \"iscream\") |> list.files(pattern = \"[a|b|c|d].bed.gz$\", full.names = TRUE) # examine the bedfiles colnames <- c(\"chr\", \"start\", \"end\", \"beta\", \"coverage\") lapply(bedfiles, function(i) knitr::kable(data.table::fread(i, col.names = colnames))) #> [[1]] #> #> #> |chr | start| end| beta| coverage| #> |:----|-----:|---:|----:|--------:| #> |chr1 | 1| 2| 1.0| 1| #> |chr1 | 3| 4| 1.0| 1| #> |chr1 | 5| 6| 0.0| 2| #> |chr1 | 7| 8| 0.0| 1| #> |chr1 | 9| 10| 0.5| 2| #> |chr1 | 11| 12| 1.0| 2| #> |chr1 | 13| 14| 1.0| 3| #> #> [[2]] #> #> #> |chr | start| end| beta| coverage| #> |:----|-----:|---:|----:|--------:| #> |chr1 | 1| 2| 0| 2| #> |chr1 | 5| 6| 1| 2| #> |chr1 | 7| 8| 1| 1| #> |chr1 | 11| 12| 0| 2| #> |chr1 | 13| 14| 1| 1| #> #> [[3]] #> #> #> |chr | start| end| beta| coverage| #> |:----|-----:|---:|----:|--------:| #> |chr1 | 3| 4| 1| 2| #> |chr1 | 7| 8| 0| 2| #> |chr1 | 9| 10| 1| 1| #> #> [[4]] #> #> #> |chr | start| end| beta| coverage| #> |:----|-----:|---:|----:|--------:| #> |chr1 | 1| 2| 1.0| 1| #> |chr1 | 3| 4| 1.0| 2| #> |chr1 | 7| 8| 0.0| 1| #> |chr1 | 9| 10| 0.5| 2| #> |chr1 | 13| 14| 1.0| 1| #> # make a vector of regions regions <- c(\"chr1:1-6\", \"chr1:7-10\", \"chr1:11-14\") query_all(bedfiles, regions) #> [19:51:14.629397] [iscream::query_all] [info] Querying 3 regions from 4 bedfiles #> #> $M #> a b c d #> chr1:2 1 0 0 1 #> chr1:4 1 0 2 2 #> chr1:6 0 2 0 0 #> chr1:8 0 1 0 0 #> chr1:10 1 0 1 1 #> chr1:12 2 0 0 0 #> chr1:14 3 1 0 1 #> #> $Cov #> a b c d #> chr1:2 1 2 0 1 #> chr1:4 1 0 2 2 #> chr1:6 2 2 0 0 #> chr1:8 1 1 2 1 #> chr1:10 2 0 1 2 #> chr1:12 2 2 0 0 #> chr1:14 3 1 0 1 #> #> $pos #> [1] 1 3 5 7 9 11 13 #> #> $chr #> [1] \"chr1\" \"chr1\" \"chr1\" \"chr1\" \"chr1\" \"chr1\" \"chr1\" #> #> $sampleNames #> [1] \"a\" \"b\" \"c\" \"d\" #> # for BSseq object run if (FALSE) { # \\dontrun{ library(bsseq) do.call(BSseq, query_all(bedfiles, regions)) } # }"},{"path":"https://huishenlab.github.io/iscream/dev/reference/region_map.html","id":null,"dir":"Reference","previous_headings":"","what":"Run a defined function over genomic regions — region_map","title":"Run a defined function over genomic regions — region_map","text":"Run function CpGs bedfiles across genomic regions. Currently supported functions aggregate average. Parallelized across files using threads \"iscream.threads\" option.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/region_map.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run a defined function over genomic regions — region_map","text":"","code":"region_map( bedfiles, regions, fun = \"aggregate\", bismark = FALSE, mval = TRUE, set_region_rownames = FALSE, nthreads = NULL )"},{"path":"https://huishenlab.github.io/iscream/dev/reference/region_map.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run a defined function over genomic regions — region_map","text":"bedfiles vector bedfile paths regions vector genomic regions strings. named vector provided, names used feature column instead genomic regions string fun Function apply region. See details. bismark Whether input bismark coverage file mval Whether calculate M value (coverage \\(\\times \\beta\\)) use beta value applying function. set_region_rownames Use region strings returned data frame's rownames. Can useful named vector regions want rownames feature names. nthreads Set number threads use overriding \"iscream.threads\" option. See ?set_threads information.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/region_map.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Run a defined function over genomic regions — region_map","text":"data.frame","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/region_map.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Run a defined function over genomic regions — region_map","text":"Available functions: \"aggregate\" sums values region aggregated beta values mval = FALSE aggregated M values mval = TRUE \"average\" averages values region average beta values mval = FALSE average M values mval = TRUE","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/region_map.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run a defined function over genomic regions — region_map","text":"","code":"bedfiles <- system.file(\"extdata\", package = \"iscream\") |> list.files(pattern = \"[a|b|c|d].bed.gz$\", full.names = TRUE) # examine the bedfiles colnames <- c(\"chr\", \"start\", \"end\", \"beta\", \"coverage\") lapply(bedfiles, function(i) knitr::kable(data.table::fread(i, col.names = colnames))) #> [[1]] #> #> #> |chr | start| end| beta| coverage| #> |:----|-----:|---:|----:|--------:| #> |chr1 | 1| 2| 1.0| 1| #> |chr1 | 3| 4| 1.0| 1| #> |chr1 | 5| 6| 0.0| 2| #> |chr1 | 7| 8| 0.0| 1| #> |chr1 | 9| 10| 0.5| 2| #> |chr1 | 11| 12| 1.0| 2| #> |chr1 | 13| 14| 1.0| 3| #> #> [[2]] #> #> #> |chr | start| end| beta| coverage| #> |:----|-----:|---:|----:|--------:| #> |chr1 | 1| 2| 0| 2| #> |chr1 | 5| 6| 1| 2| #> |chr1 | 7| 8| 1| 1| #> |chr1 | 11| 12| 0| 2| #> |chr1 | 13| 14| 1| 1| #> #> [[3]] #> #> #> |chr | start| end| beta| coverage| #> |:----|-----:|---:|----:|--------:| #> |chr1 | 3| 4| 1| 2| #> |chr1 | 7| 8| 0| 2| #> |chr1 | 9| 10| 1| 1| #> #> [[4]] #> #> #> |chr | start| end| beta| coverage| #> |:----|-----:|---:|----:|--------:| #> |chr1 | 1| 2| 1.0| 1| #> |chr1 | 3| 4| 1.0| 2| #> |chr1 | 7| 8| 0.0| 1| #> |chr1 | 9| 10| 0.5| 2| #> |chr1 | 13| 14| 1.0| 1| #> # make a vector of regions regions <- c(\"chr1:1-6\", \"chr1:7-10\", \"chr1:11-14\") region_map(bedfiles, regions) #> [19:51:27.276918] [iscream::region_map] [info] Aggregating 3 regions from 4 bedfiles #> #> Feature Cell coverage M #> 1 chr1:1-6 a 4 2 #> 2 chr1:7-10 a 3 1 #> 3 chr1:11-14 a 5 5 #> 4 chr1:1-6 b 4 2 #> 5 chr1:7-10 b 1 1 #> 6 chr1:11-14 b 3 1 #> 7 chr1:1-6 c 2 2 #> 8 chr1:7-10 c 3 1 #> 9 chr1:11-14 c 0 0 #> 10 chr1:1-6 d 3 3 #> 11 chr1:7-10 d 3 1 #> 12 chr1:11-14 d 1 1 region_map(bedfiles, regions, mval = FALSE) #> [19:51:27.279301] [iscream::region_map] [info] Aggregating 3 regions from 4 bedfiles #> #> Feature Cell coverage beta #> 1 chr1:1-6 a 4 2.0 #> 2 chr1:7-10 a 3 0.5 #> 3 chr1:11-14 a 5 2.0 #> 4 chr1:1-6 b 4 1.0 #> 5 chr1:7-10 b 1 1.0 #> 6 chr1:11-14 b 3 1.0 #> 7 chr1:1-6 c 2 1.0 #> 8 chr1:7-10 c 3 1.0 #> 9 chr1:11-14 c 0 0.0 #> 10 chr1:1-6 d 3 2.0 #> 11 chr1:7-10 d 3 0.5 #> 12 chr1:11-14 d 1 1.0 region_map(bedfiles, regions, fun = \"average\") #> [19:51:27.281439] [iscream::region_map] [info] Averaging 3 regions from 4 bedfiles #> #> Feature Cell coverage M #> 1 chr1:1-6 a 1.333333 0.6666667 #> 2 chr1:7-10 a 1.500000 0.5000000 #> 3 chr1:11-14 a 2.500000 2.5000000 #> 4 chr1:1-6 b 2.000000 1.0000000 #> 5 chr1:7-10 b 1.000000 1.0000000 #> 6 chr1:11-14 b 1.500000 0.5000000 #> 7 chr1:1-6 c 2.000000 2.0000000 #> 8 chr1:7-10 c 1.500000 0.5000000 #> 9 chr1:11-14 c 0.000000 0.0000000 #> 10 chr1:1-6 d 1.500000 1.5000000 #> 11 chr1:7-10 d 1.500000 0.5000000 #> 12 chr1:11-14 d 1.000000 1.0000000"},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_log_level.html","id":null,"dir":"Reference","previous_headings":"","what":"Set logging level — set_log_level","title":"Set logging level — set_log_level","text":"Set logging level","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_log_level.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set logging level — set_log_level","text":"","code":"set_log_level(level = \"info\")"},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_log_level.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set logging level — set_log_level","text":"level logging verbosity level use \"info\": default gives provides basic information number files regions used function \"debug\": verbose row allocations, many CpGs found region, filename parsing etc. mode used one thread R output messages multiple threads without crashing.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_log_level.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set logging level — set_log_level","text":"None; sets log level provided level","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_log_level.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set logging level — set_log_level","text":"","code":"set_log_level(\"info\")"},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_threads.html","id":null,"dir":"Reference","previous_headings":"","what":"Set the number of available threads — set_threads","title":"Set the number of available threads — set_threads","text":"function sets 'iscream.threads' option n_threads. see many threads available see parallelly::availableCores.","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_threads.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set the number of available threads — set_threads","text":"","code":"set_threads(n_threads)"},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_threads.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set the number of available threads — set_threads","text":"n_threads number threads use","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_threads.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set the number of available threads — set_threads","text":"NULL. Sets iscream.threads option requested number threads available","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_threads.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set the number of available threads — set_threads","text":"iscream uses OpenMP parallelize certain functions. can use many threads available system varying degrees performance improvements. parallelly::availableCores() function report number available threads. get information OpenMP threads, run get_omp_threads(verbose = TRUE). However, high preformance computers (HPCs) resource allocating job schedulers like SLURM, OpenMP may detect available threads across HPC limit cores allocated scheduler. system administrator set limits, may result job taking resources jobs. limits, trying use threads available reduce iscream's performance. Job schedulers typically environment variable (e.g. SLURM_CPUS_ON_NODE SLURM) gives actual number available cores. , hyperthreaded systems, count may double available processors. Using hyperthreading guarantee performance improvement - may better set number threads half reported number. parallelly::availableCores() takes HPC scheduler/CRAN/Bioconductor limits account reporting number available threads may reliably report hyperthreading ('system' 'nproc'). set number threads without call set_threads() every session, put .Rprofile See help('Rprofile') information startup options. Functions currently using OpenMP: region_map() query_all()","code":"options(iscream.threads = [n_threads])"},{"path":"https://huishenlab.github.io/iscream/dev/reference/set_threads.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set the number of available threads — set_threads","text":"","code":"(ncores <- parallelly::availableCores()) #> system #> 4 if (FALSE) { # \\dontrun{ set_threads(ncores) } # }"},{"path":"https://huishenlab.github.io/iscream/dev/reference/validate_log_level.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate provided logging level — validate_log_level","title":"Validate provided logging level — validate_log_level","text":"\"info\" \"debug\" currently supported, \"debug\" supported using 1 thread","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/validate_log_level.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate provided logging level — validate_log_level","text":"","code":"validate_log_level(level = get_log_level(), n_threads)"},{"path":"https://huishenlab.github.io/iscream/dev/reference/validate_log_level.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate provided logging level — validate_log_level","text":"level logging level validate n_threads number threads next iscream function call use","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/validate_log_level.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate provided logging level — validate_log_level","text":"None; sets log level provide level","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/validate_log_level.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate provided logging level — validate_log_level","text":"","code":"set_log_level(\"info\")"},{"path":"https://huishenlab.github.io/iscream/dev/reference/verify_files_or_stop.html","id":null,"dir":"Reference","previous_headings":"","what":"Verify that bedfiles are tabixed — verify_files_or_stop","title":"Verify that bedfiles are tabixed — verify_files_or_stop","text":"Verify bedfiles tabixed","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/verify_files_or_stop.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Verify that bedfiles are tabixed — verify_files_or_stop","text":"","code":"verify_files_or_stop(bedfiles, verify_tabix = TRUE)"},{"path":"https://huishenlab.github.io/iscream/dev/reference/verify_files_or_stop.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Verify that bedfiles are tabixed — verify_files_or_stop","text":"bedfiles vector bedfile paths verify_tabix Whether verify presence tabix files","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/verify_files_or_stop.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Verify that bedfiles are tabixed — verify_files_or_stop","text":"TRUE input bedfiles associated tabix index file. FALSE ","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/verify_regions_or_stop.html","id":null,"dir":"Reference","previous_headings":"","what":"Verify that regions are valid — verify_regions_or_stop","title":"Verify that regions are valid — verify_regions_or_stop","text":"Verify regions valid","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/verify_regions_or_stop.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Verify that regions are valid — verify_regions_or_stop","text":"","code":"verify_regions_or_stop(regions)"},{"path":"https://huishenlab.github.io/iscream/dev/reference/verify_regions_or_stop.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Verify that regions are valid — verify_regions_or_stop","text":"regions vector genomic regions","code":""},{"path":"https://huishenlab.github.io/iscream/dev/reference/verify_regions_or_stop.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Verify that regions are valid — verify_regions_or_stop","text":"TRUE input regions start 'chr' FALSE ","code":""}]