diff --git a/DESCRIPTION b/DESCRIPTION index 1e16baf..d2762b0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -27,7 +27,7 @@ LazyData: true Depends: R (>= 4.1) SystemRequirements: Python (>= 3.7.0) biocViews: -Imports: +Imports: echodata, echotabix, dplyr, @@ -50,7 +50,8 @@ Imports: S4Vectors, GenomeInfoDb, biomaRt, - IRanges + IRanges, + XGR Suggests: markdown, rmarkdown, diff --git a/NAMESPACE b/NAMESPACE index 3dd9787..f1a8600 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -3,24 +3,39 @@ export(CORCES_2020.get_HiChIP_FitHiChIP_overlap) export(CS_bin_plot) export(CS_counts_plot) +export(ROADMAP.construct_reference) +export(ROADMAP.query) +export(ROADMAP.query_and_plot) +export(XGR.download_and_standardize) +export(XGR.enrichment) +export(merge_celltype_specific_epigenomics) export(merge_finemapping_results) export(peak_overlap_plot) export(plot_dataset_overlap) export(super_summary_plot) -import(ggplot2) +import(ggplot2, except = c(geom_rect, ggsave)) +import(ggplot2, except = geom_rect) +import(ggplot2, except = ggsave) importFrom(DescTools,Divisors) +importFrom(DescTools,RoundTo) importFrom(GenomeInfoDb,seqlevelsStyle) importFrom(GenomicRanges,GRanges) +importFrom(GenomicRanges,GRangesList) importFrom(GenomicRanges,elementMetadata) importFrom(GenomicRanges,end) importFrom(GenomicRanges,findOverlaps) importFrom(GenomicRanges,makeGRangesFromDataFrame) importFrom(GenomicRanges,mcols) +importFrom(GenomicRanges,seqnames) importFrom(GenomicRanges,start) importFrom(IRanges,IRanges) +importFrom(IRanges,overlapsAny) +importFrom(R.utils,gzip) importFrom(RColorBrewer,brewer.pal) importFrom(S4Vectors,queryHits) importFrom(S4Vectors,subjectHits) +importFrom(XGR,xGRviaGenomicAnno) +importFrom(XGR,xRDataLoader) importFrom(biomaRt,getBM) importFrom(biomaRt,useMart) importFrom(data.table,as.data.table) @@ -30,6 +45,7 @@ importFrom(data.table,fwrite) importFrom(data.table,melt.data.table) importFrom(data.table,merge.data.table) importFrom(data.table,rbindlist) +importFrom(data.table,transpose) importFrom(dplyr,"%>%") importFrom(dplyr,arrange) importFrom(dplyr,case_when) @@ -39,12 +55,15 @@ importFrom(dplyr,group_by) importFrom(dplyr,mutate) importFrom(dplyr,n_distinct) importFrom(dplyr,rename) +importFrom(dplyr,sample_n) importFrom(dplyr,select) importFrom(dplyr,slice) importFrom(dplyr,summarise) importFrom(dplyr,summarise_at) +importFrom(dplyr,tally) importFrom(dplyr,top_n) importFrom(dplyr,vars) +importFrom(echotabix,query_tabular) importFrom(ggbio,autoplot) importFrom(ggbio,geom_arch) importFrom(ggbio,geom_rect) @@ -53,9 +72,18 @@ importFrom(ggbio,ggsave) importFrom(ggbio,plotGrandLinear) importFrom(ggbio,scale_x_sequnit) importFrom(ggbio,theme_genome) +importFrom(ggplot2,aes) +importFrom(ggplot2,element_text) +importFrom(ggplot2,ggplot_build) +importFrom(ggplot2,guide_legend) +importFrom(ggplot2,guides) +importFrom(ggplot2,scale_y_continuous) +importFrom(ggplot2,theme) +importFrom(ggplot2,theme_classic) importFrom(grDevices,dev.off) importFrom(grDevices,png) importFrom(haploR,queryRegulome) +importFrom(methods,is) importFrom(parallel,mclapply) importFrom(patchwork,plot_layout) importFrom(patchwork,plot_spacer) @@ -65,6 +93,7 @@ importFrom(scales,alpha) importFrom(stats,as.formula) importFrom(stats,formula) importFrom(stats,median) +importFrom(stats,p.adjust) importFrom(stats,setNames) importFrom(tidyr,separate) importFrom(utils,head) diff --git a/R/CS_bin_plot.R b/R/CS_bin_plot.R index 21f5fe6..b34bdcc 100644 --- a/R/CS_bin_plot.R +++ b/R/CS_bin_plot.R @@ -4,8 +4,8 @@ #' @examples #' bin_plot <- CS_bin_plot(merged_DT = echodata::Nalls2019_merged) #' @export -#' @import ggplot2 #' @importFrom RColorBrewer brewer.pal +#' @importFrom stats setNames CS_bin_plot <- function(merged_DT, show_plot = TRUE) { Method <- bin <- ..count.. <- NULL @@ -17,40 +17,40 @@ CS_bin_plot <- function(merged_DT, custom_colors <- RColorBrewer::brewer.pal( n = length(levels(bin_counts$bin)), "GnBu" ) - custom_colors_dict <- setNames( + custom_colors_dict <- stats::setNames( custom_colors[seq(1, length(used_bins))], rev(used_bins) ) custom_colors_dict[names(custom_colors_dict) == "0"] <- "lightgray" - bin_plot <- ggplot( + bin_plot <- ggplot2::ggplot( subset(bin_counts, Method != "mean"), - aes(x = Method, fill = bin) + ggplot2::aes(x = Method, fill = bin) ) + - geom_bar( + gggplot2::eom_bar( stat = "count", show.legend = TRUE, - position = position_stack(reverse = FALSE), color = "white" + position = ggplot2::position_stack(reverse = FALSE), color = "white" ) + # scale_fill_brewer(palette = "Spectral", direction = -1) + - scale_fill_manual(values = custom_colors_dict) + + ggplot2::scale_fill_manual(values = custom_colors_dict) + # geom_text(aes(label = paste(bin,"SNPs")), # position = position_stack(vjust = .5), vjust=-1, stat = "count") + - geom_text(aes(label = ..count..), - position = position_stack(vjust = .5), + ggplot2::geom_text(ggplot2::aes(label = ..count..), + position = ggplot2::position_stack(vjust = .5), vjust = .5, stat = "count" ) + - theme_bw() + - labs(x = NULL, y = "Loci", fill = "CS size") + - coord_flip() + - theme( - panel.grid.major = element_blank(), - panel.grid.minor = element_blank(), - rect = element_blank(), - axis.text.x = element_blank(), - axis.ticks = element_blank(), + ggplot2::theme_bw() + + ggplot2::labs(x = NULL, y = "Loci", fill = "CS size") + + ggplot2::coord_flip() + + ggplot2::theme( + panel.grid.major = ggplot2::element_blank(), + panel.grid.minor = ggplot2::element_blank(), + rect = ggplot2::element_blank(), + axis.text.x = ggplot2::element_blank(), + axis.ticks = ggplot2::element_blank(), legend.position = "top" ) + - guides(fill = guide_legend(nrow = 1, reverse = TRUE)) + ggplot2::guides(fill = ggplot2::guide_legend(nrow = 1, reverse = TRUE)) if (show_plot) print(bin_plot) return(list( plot = bin_plot, diff --git a/R/CS_counts_plot.R b/R/CS_counts_plot.R index 760427c..b5ea64d 100644 --- a/R/CS_counts_plot.R +++ b/R/CS_counts_plot.R @@ -5,7 +5,7 @@ #' @examples #' gg_CS <- CS_counts_plot(merged_DT = echodata::Nalls2019_merged) #' @export -#' @import ggplot2 +#' @rawNamespace import(ggplot2, except = c(geom_rect, ggsave)) #' @importFrom dplyr %>% mutate arrange CS_counts_plot <- function(merged_DT, show_numbers = TRUE, diff --git a/R/GR.name_filter_convert.R b/R/GR.name_filter_convert.R new file mode 100644 index 0000000..08d7ea7 --- /dev/null +++ b/R/GR.name_filter_convert.R @@ -0,0 +1,17 @@ +#' GR.name_filter_convert +#' +#' @family plot +#' @keywords internal +GR.name_filter_convert <- function(GR.final, + GR.names, + min_hits = 1) { + names(GR.final) <- GR.names + grl <- GR.final[!as.logical(lapply(GR.final, is.null))] + # Filter to those that had at least N hits + grl <- grl[as.logical(lapply(grl, function(g, min_hits. = min_hits) { + length(GenomicRanges::seqnames(g)) >= min_hits. + }))] + # Convert to GRangesList (important) + grl <- GenomicRanges::GRangesList(grl) + return(grl) +} diff --git a/R/NOTT_2019.epigenomic_histograms.R b/R/NOTT_2019.epigenomic_histograms.R index 2f8627f..62d767c 100644 --- a/R/NOTT_2019.epigenomic_histograms.R +++ b/R/NOTT_2019.epigenomic_histograms.R @@ -14,10 +14,11 @@ #' return_assay_track = TRUE, #' save_annot = FALSE #' ) -#' @import ggplot2 +#' @rawNamespace import(ggplot2, except = c(geom_rect, ggsave)) #' @importFrom ggbio autoplot geom_rect scale_x_sequnit plotGrandLinear #' @importFrom ggbio theme_genome ggsave #' @importFrom stats formula +#' @importFrom GenomeInfoDb seqlevelsStyle NOTT_2019.epigenomic_histograms <- function(finemap_dat, locus_dir, show_plot = TRUE, @@ -45,15 +46,20 @@ NOTT_2019.epigenomic_histograms <- function(finemap_dat, # library(BiocGenerics) # library(GenomicRanges) # library(ggbio) - # show_plot=T;save_plot=T;full_data=T;return_assay_track=F;binwidth=2500; geom="histogram"; plot_formula="Cell_type ~."; show_regulatory_rects=T; bigwig_dir=NULL; verbose=T; nThread=1; - # finemap_dat=echoannot::LRRK2; plot.zoom=500000; fill_var="Assay"; density_adjust=.2; strip.text.y.angle=0; + # show_plot=T;save_plot=T;full_data=T;return_assay_track=F; + # binwidth=2500; geom="histogram"; plot_formula="Cell_type ~."; + # show_regulatory_rects=T; bigwig_dir=NULL; verbose=T; nThread=1; + # finemap_dat=echoannot::LRRK2; plot.zoom=500000; fill_var="Assay"; + # density_adjust=.2; strip.text.y.angle=0; # Import BigWig annotation files bigWigFiles <- echoannot::NOTT_2019.bigwig_metadata - # Some bigWig files were initially loaded to UCSC GB, but then later taken down by the authors.... + # Some bigWig files were initially loaded to UCSC GB, + # but then later taken down by the authors.... # However I saved these files on Minerva beforehand. bigWigFiles <- subset(bigWigFiles, UCSC_available == "T") - bigWigFiles <- dplyr::mutate(bigWigFiles, cell_type = gsub(" ", ".", cell_type)) + bigWigFiles <- dplyr::mutate(bigWigFiles, + cell_type = gsub(" ", ".", cell_type)) # Convert finemap data to granges dat <- finemap_dat dat$seqnames <- dat$CHR diff --git a/R/NOTT_2019.plac_seq_plot.R b/R/NOTT_2019.plac_seq_plot.R index 4365612..bd2d6f5 100644 --- a/R/NOTT_2019.plac_seq_plot.R +++ b/R/NOTT_2019.plac_seq_plot.R @@ -13,7 +13,8 @@ #' # Zoom in #' trks_plus_lines <- NOTT_2019.plac_seq_plot(finemap_dat = BST1, locus_dir = file.path("~/Desktop", locus_dir), zoom_window = 500000, highlight_plac = TRUE) #' } -#' @import ggplot2 +#' @rawNamespace import(ggplot2, except = geom_rect) +#' @rawNamespace import(ggplot2, except = ggsave) #' @importFrom ggbio ggbio geom_arch geom_rect scale_x_sequnit ggsave #' @importFrom IRanges IRanges NOTT_2019.plac_seq_plot <- function(finemap_dat = NULL, diff --git a/R/PLOT.get_max_histogram_height.R b/R/PLOT.get_max_histogram_height.R index d214fab..dca404b 100644 --- a/R/PLOT.get_max_histogram_height.R +++ b/R/PLOT.get_max_histogram_height.R @@ -1,10 +1,16 @@ +#' PLOT.get_max_histogram_height +#' +#' @keywords internal +#' @importFrom methods is +#' @importFrom ggplot2 ggplot_build +#' @importFrom DescTools RoundTo PLOT.get_max_histogram_height <- function(gg, round_to = NULL, verbose = TRUE) { - if (tolower(class(gg)[1]) == "ggbio") gg <- gg@ggplot - printer("+ PLOT:: Calculating max histogram height", v = verbose) + if (methods::is(gg,"ggbio")) {gg <- gg@ggplot} + messager("+ PLOT:: Calculating max histogram height", v = verbose) dat <- ggplot2::ggplot_build(gg)$data[[1]] - max_height <- max(dat$ymax) + max_height <- max(dat$ymax, na.rm = TRUE) if (!is.null(round_to)) { max_height <- DescTools::RoundTo(max_height, round_to) } diff --git a/R/PLOT.get_window_limits.R b/R/PLOT.get_window_limits.R index f9b73e7..032e81a 100644 --- a/R/PLOT.get_window_limits.R +++ b/R/PLOT.get_window_limits.R @@ -26,7 +26,7 @@ PLOT.get_window_limits <- function(finemap_dat, .index_as_center = index_as_center, .genomic_units = genomic_units, .verbose = verbose) { - printer("+ Inferring genomic limits for window:", pz, v = .verbose) + messager("+ Inferring genomic limits for window:", pz, v = .verbose) # Zoom #x as input if (.index_as_center) { middle_pos <- subset(.finemap_dat, leadSNP)$POS[1] diff --git a/R/ROADMAP.construct_reference.R b/R/ROADMAP.construct_reference.R new file mode 100644 index 0000000..640dfa1 --- /dev/null +++ b/R/ROADMAP.construct_reference.R @@ -0,0 +1,40 @@ +#' Gather Roadmap annotation metadata +#' +#' @param ref_path Where the ROADMAP metadata is stored. +#' @param keyword_query Search all columns in the Roadmap annotations metadata +#' and only query annotations that contain your keywords. +#' Can provide multiple keywords in list form: +#' \code{c("placenta","liver","monocytes")} +#' +#' @examples +#' ref <- ROADMAP.construct_reference(keyword_query = c( +#' "placenta", +#' "liver", +#' "monocytes" +#' )) +#' @family ROADMAP +#' @export +#' @importFrom data.table transpose fread +ROADMAP.construct_reference <- function(ref_path = + system.file( + "extdata/ROADMAP", + "ROADMAP_Epigenomic.js", + package = "echoannot" + ), + keyword_query = NULL) { + # %like% is from data.table + ref <- suppressWarnings(data.table::fread(ref_path)) + colnames(ref)[1] <- "EID" + if (!is.null(keyword_query)) { + rows <- grep(paste(keyword_query, collapse = "|"), + data.table::transpose(ref), + ignore.case = TRUE + ) + ref <- ref[rows, ] + messager( + "+ ROADMAP::", nrow(ref), + "annotation(s) identified that match `keyword_query`." + ) + } + return(ref) +} diff --git a/R/ROADMAP.merge_and_process_grl.R b/R/ROADMAP.merge_and_process_grl.R new file mode 100644 index 0000000..014f25b --- /dev/null +++ b/R/ROADMAP.merge_and_process_grl.R @@ -0,0 +1,44 @@ +#' Standardize Roadmap query +#' +#' @param grl.roadmap Roadmap query results +#' @param n_top_tissues The number of top tissues to include, +#' sorted by greatest number of rows +#' (i.e. the number of genomic ranges within the window). +#' @family ROADMAP +#' @importFrom IRanges overlapsAny +#' @importFrom dplyr %>% group_by tally n_distinct +ROADMAP.merge_and_process_grl <- function(grl.roadmap, + gr.snp, + n_top_tissues = 5, + sep = " ") { + grl.roadmap.merged <- unlist(grl.roadmap) + grl.roadmap.merged$Source <- names(grl.roadmap.merged) + grl.roadmap.merged$Source <- gsub("_", sep, grl.roadmap.merged$Source) + grl.roadmap.merged$ChromState <- + lapply( + grl.roadmap.merged$State, + function(ROW) { + base::strsplit(ROW, "_")[[1]][2] + } + ) %>% unlist() + grl.roadmap.filt <- grl.roadmap.merged[unlist(lapply( + grl.roadmap, function(e) { + IRanges::overlapsAny(e, gr.snp, minoverlap = 1) + } + ))] + if (!is.null(n_top_tissues)) { + top_tissues <- data.frame(grl.roadmap.filt) %>% + dplyr::group_by(Source) %>% + dplyr::tally(sort = TRUE) + grl.roadmap.filt <- subset( + grl.roadmap.filt, + Source %in% unique(top_tissues$Source[ + seq(1, min( + n_top_tissues, + dplyr::n_distinct(top_tissues$Source) + )) + ]) + ) + } + return(grl.roadmap.filt) +} diff --git a/R/ROADMAP.query.R b/R/ROADMAP.query.R new file mode 100644 index 0000000..7016efd --- /dev/null +++ b/R/ROADMAP.query.R @@ -0,0 +1,70 @@ +#' Query Roadmap by genomic coordinates +#' +#' @param gr.snp \code{\link[GenomicRanges]{GRanges}} object of +#' SNPs to query Roadmap with. +#' @param limit_files Limit the number of annotation files queried +#' (for faster testing). +#' @param nThread Number of threads to parallelise queries over. +#' @inheritParams ROADMAP.tabix +#' +#' @family ROADMAP +#' @examples +#' \dontrun{ +#' grl.roadmap <- ROADMAP.query( +#' gr.snp = echodata::BST1, +#' keyword_query = "placenta") +#' } +#' @export +#' @importFrom GenomicRanges seqnames GRanges start end +ROADMAP.query <- function(results_path = file.path(tempdir(), "Roadmap"), + gr.snp, + keyword_query = NULL, + limit_files = NULL, + nThread = 1, + verbose = TRUE) { + rm_start <- Sys.time() + gr.snp <- dt_to_granges(subset_DT = gr.snp, + verbose = verbose) + roadmap_ref <- ROADMAP.construct_reference(keyword_query = keyword_query) + if (!is.null(limit_files)) { + roadmap_ref <- roadmap_ref[seq(1,limit_files), ] + } + # Download via tabix (fast) + counter <- 1 + gr.roadmap <- parallel::mclapply(unique(roadmap_ref$EID), + function(eid, + gr.snp. = gr.snp, + results_path. = results_path) { + message_parallel("+ ROADMAP:: Querying subset from Roadmap API: ", + eid, " - ", counter, "/", length(unique(roadmap_ref$EID)) ) + counter <<- counter + 1 + dat <- GenomicRanges::GRanges() + try({ + dat <- ROADMAP.tabix( + results_path = results_path., + chrom = as.character(GenomicRanges::seqnames(gr.snp.)[1]), + min_pos = min(GenomicRanges::start(gr.snp.), na.rm = TRUE), + max_pos = max(GenomicRanges::end(gr.snp.), na.rm = TRUE), + eid = eid, + convert_to_granges = TRUE) + }) + if (length(GenomicRanges::seqnames(dat)) > 0) { + return(dat) + } else { + return(NULL) + } + }, + mc.cores = nThread + ) + remove(counter) + grl.roadmap <- GR.name_filter_convert( + GR.final = gr.roadmap, + GR.names = + roadmap_ref$`Epigenome name (from EDACC Release 9 directory)`, + min_hits = 1 + ) + rm_end <- Sys.time() + messager("ROADMAP:: All downloads complete") + print(round(rm_end - rm_start, 1)) + return(grl.roadmap) +} diff --git a/R/ROADMAP.query_and_plot.R b/R/ROADMAP.query_and_plot.R new file mode 100644 index 0000000..f1981ee --- /dev/null +++ b/R/ROADMAP.query_and_plot.R @@ -0,0 +1,102 @@ +#' Query and plot Roadmap epigenomic annotations +#' +#' @param subset_DT Data.frame with at least the following columns: +#' \describe{ +#' \item{SNP}{SNP RSID} +#' \item{CHR}{chromosome} +#' \item{POS}{position} +#' } +#' @param force_new_query Force a new query from the XGR database. +#' @inheritParams ROADMAP.construct_reference +#' @inheritParams ROADMAP.tabix +#' @inheritParams ROADMAP.merge_and_process_grl +#' +#' @return A named list containing: +#' \itemize{ +#' \item{\code{ggbio} plot} +#' \item{\code{GRanges} object within the queried coordinates} +#' } +#' +#' @family ROADMAP +#' @examples +#' \dontrun{ +#' roadmap_plot_query <- ROADMAP.query_and_plot( +#' subset_DT = echodata::BST1, +#' keyword_query = "monocytes") +#' } +#' @export +#' @importFrom GenomeInfoDb seqlevelsStyle +ROADMAP.query_and_plot <- function(subset_DT, + results_path = + file.path(tempdir(), "Roadmap"), + n_top_tissues = NULL, + keyword_query = NULL, + adjust = .2, + force_new_query = FALSE, + remove_tmps = TRUE, + verbose=TRUE) { + # Convert subset to GRanges + if (all(!is_granges(subset_DT))) { + messager("ROADMAP:: Converting data to GRanges...") + gr.snp <- GenomicRanges::makeGRangesFromDataFrame( + dplyr::mutate( subset_DT, + SEQnames = paste0("chr", CHR) + ), + seqnames.field = "SEQnames", + start.field = "POS", + end.field = "POS" + ) + GenomeInfoDb::seqlevelsStyle(gr.snp) <- "NCBI" + } else { + gr.snp <- subset_DT + } + # Roadmap query + lib <- "Roadmap_ChromatinMarks_CellTypes" + anno_path <- file.path( + results_path, "annotations", + paste0("GRanges_", lib, ".rds") + ) + if (file.exists(anno_path) & force_new_query == FALSE) { + messager("+ Saved annotation file detected. Loading...") + grl.roadmap <- readRDS(anno_path) + } else { + dir.create(dirname(anno_path), + showWarnings = FALSE, recursive = TRUE + ) + grl.roadmap <- ROADMAP.query( + results_path = results_path, + gr.snp = gr.snp, + keyword_query = keyword_query, + limit_files = NULL, + verbose = verbose + ) + save_annotations( + gr = grl.roadmap, + anno_path = anno_path, + libName = lib, + verbose = verbose + ) + } + grl.roadmap.filt <- ROADMAP.merge_and_process_grl( + grl.roadmap = grl.roadmap, + gr.snp = gr.snp, + n_top_tissues = n_top_tissues + ) + # Plot + track.roadmap <- ROADMAP.track_plot( + grl.roadmap.filt = grl.roadmap.filt, + gr.snp = gr.snp, + adjust = adjust + ) + if (remove_tmps) { + tbi <- list.files( + path = results_path, + pattern = ".tbi$", full.names = TRUE + ) + dummy <- suppressWarnings(file.remove(tbi)) + } + return(list( + Roadmap_plot = track.roadmap, + Roadmap_query = grl.roadmap.filt + )) +} diff --git a/R/ROADMAP.tabix.R b/R/ROADMAP.tabix.R new file mode 100644 index 0000000..7e74d5e --- /dev/null +++ b/R/ROADMAP.tabix.R @@ -0,0 +1,69 @@ +#' Query Roadmap API +#' +#' Query Roadmap epigenomic annotations (chromatin marks) +#' using a range of genomic coordinates. +#' +#' \href{https://egg2.wustl.edu/roadmap/data/byFileType/chromhmmSegmentations/ChmmModels/coreMarks/jointModel/final/}{ +#' ROADMAP file locations.} +#' +#' @param results_path Where to store query results. +#' @param chrom Chromosome to query +#' @param min_pos Minimum genomic position +#' @param max_pos Maximum genomic position +#' @param eid Roadmap annotation ID +#' @param convert_to_granges Whether to return query +#' as a \code{data.frame} or \code{\link[GenomicRanges]{GRanges}}. +#' +#' @examples +#' \dontrun{ +#' BST1 <- echodata::BST1 +#' dat <- ROADMAP.tabix(chrom=BST1$CHR[1], +#' min_pos = min(BST1$POS), +#' max_pos = max(BST1$POS), +#' eid = "E099") +#' } +#' +#' @family ROADMAP +#' @keywords internal +#' @importFrom GenomicRanges makeGRangesFromDataFrame +#' @importFrom GenomeInfoDb seqlevelsStyle +#' @importFrom data.table fread +#' @importFrom echotabix query_tabular +ROADMAP.tabix <- function(results_path=tempfile( + fileext = "ROADMAP_query.csv.gz"), + chrom, + min_pos, + max_pos, + eid, + convert_to_granges=TRUE, + verbose=TRUE){ + dir.create(results_path, showWarnings = FALSE, recursive = TRUE) + chrom <- paste0("chr",gsub("chr","",base::tolower(chrom))) + tbx_start = Sys.time() + messager("++ Downloading Roadmap Chromatin Marks:",eid, v=verbose) + fname <- paste0(eid,"_15_coreMarks_dense.bed.bgz") + URL <- file.path( + "https://egg2.wustl.edu/roadmap/data/byFileType", + "chromhmmSegmentations/ChmmModels/coreMarks/jointModel/final", + fname) # _15_coreMarks_stateno.bed.gz + #### Qiuery remote tabix file #### + dat <- echotabix::query_tabular(fullSS_tabix = URL, + chrom = chrom, + start_pos = min_pos, + end_pos = max_pos, + local = FALSE) + dat <- dat[,paste0("V",seq(1,4))] + colnames(dat) <- c("Chrom","Start","End","State") + dat$EID <- eid + dat$File <- fname + if(convert_to_granges){ + dat <- dt_to_granges(subset_DT = dat, + chrom_col = "Chrom", + start_col = "Start", + end_col = "End", + style = "NCBI") + } + tbx_end = Sys.time() + messager("BED subset downloaded in",round(tbx_end-tbx_start,3),"seconds") + return(dat) +} diff --git a/R/ROADMAP.track_plot.R b/R/ROADMAP.track_plot.R new file mode 100644 index 0000000..1ea7673 --- /dev/null +++ b/R/ROADMAP.track_plot.R @@ -0,0 +1,64 @@ +#' Plot Roadmap query +#' +#' @param grl.roadmap.filt Roadmap query results. +#' @param gr.snp Optionally, can include an extra \code{\link[GenomicRanges]{GRanges}} object +#' to ensure the plot does not extend beyond certain coordinates. +#' @param geom The type of plot to create. +#' Options include "density" and "histogram". +#' @param adjust The granularity of the peaks. +#' @param show_plot Whether to print the plot. +#' @examples +#' \dontrun{ +#' gr.snp <- dt_to_granges(echodata::BST1) +#' grl.roadmap <- ROADMAP.query( +#' gr.snp = gr.snp, +#' keyword_query = "monocyte" +#' ) +#' grl.roadmap.filt <- ROADMAP.merge_and_process_grl( +#' grl.roadmap = grl.roadmap, +#' gr.snp = gr.snp +#' ) +#' track.roadmap <- ROADMAP.track_plot(grl.roadmap.filt, +#' gr.snp = gr.snp +#' ) +#' } +#' @keywords internal +#' @importFrom ggbio autoplot +#' @importFrom ggplot2 aes theme_classic theme element_text +#' @importFrom ggplot2 guides guide_legend scale_y_continuous +ROADMAP.track_plot <- function(grl.roadmap.filt, + gr.snp = NULL, + geom = "density", + adjust = .2, + show_plot = TRUE, + as.ggplot = TRUE) { + track.roadmap <- ggbio::autoplot(grl.roadmap.filt, + which = gr.snp, + ggplot2::aes(fill = ChromState), + color = "white", + size = .1, + geom = geom, + adjust = adjust, + # bins=10, + position = "stack", # stack, fill, dodge + facets = Source ~ ., + alpha = 1 + ) + + ggplot2::theme_classic() + + ggplot2::theme( + strip.text.y = ggplot2::element_text(angle = 0), + strip.text = ggplot2::element_text(size = 9) + ) + + ggplot2::guides(fill = ggplot2::guide_legend(ncol = 2, + keyheight = .5, + keywidth = .5)) + + ggplot2::scale_y_continuous(n.breaks = 3) + if (show_plot) { + print(track.roadmap) + } + if (as.ggplot) { + return(track.roadmap@ggplot) + } else { + return(track.roadmap) + } +} diff --git a/R/XGR.download_and_standardize.R b/R/XGR.download_and_standardize.R new file mode 100644 index 0000000..e206ae8 --- /dev/null +++ b/R/XGR.download_and_standardize.R @@ -0,0 +1,87 @@ +#' Download, standardize, and merge XGR annotations +#' +#' Merges a list of XGR annotations into a single GRanges object +#' +#' @param lib.selections Which XGR annotations to check overlap with. +#' For full list of libraries see +#' \href{http://xgr.r-forge.r-project.org/#annotations-at-the-genomic-region-level}{ +#' here.} +#' @param as_grangesList Return as a \code{GRangesList}, +#' instead of a single merged \code{GRanges} object. +#' @param finemap_dat Fine-mapping results. +#' @param nThread Number of cores to parallelise across. +#' @return GRangesList +#' @family XGR +#' @examples +#' \dontrun{ +#' gr.lib <- XGR.download_and_standardize( +#' lib.selections = c("ENCODE_DNaseI_ClusteredV3_CellTypes"), +#' finemap_dat = echodata::BST1) +#' } +#' @export +#' @importFrom parallel mclapply +#' @importFrom XGR xRDataLoader +#' @importFrom dplyr %>% +#' @importFrom GenomicRanges GRangesList +#' @importFrom methods is +XGR.download_and_standardize <- function(lib.selections = c( + "ENCODE_TFBS_ClusteredV3_CellTypes", + "TFBS_Conserved", + "Uniform_TFBS" + ), + as_grangesList = FALSE, + finemap_dat, + nThread = 1) { + # Iterate over XGR libraries + gr.lib <- lapply(lib.selections, function(lib.name) { + GR.annotations <- XGR::xRDataLoader(RData.customised = lib.name) + # Iterate over lists within each library + all_GRL <- parallel::mclapply(names(GR.annotations), function(n1) { + grl <- GR.annotations[[n1]] + + # Handle both nested and unnested entries + if (methods::is(grl,"list")) { + # grl$name <- names(unlist(grl)) + GRL <- lapply(names(grl), function(n2) { + gr <- grl[[n2]] + gr$source <- n1 + gr$assay <- n2 + return(gr) + }) %>% unlist() + } else { + grl$name <- names(grl) + return(grl) + } + }, mc.cores = nThread) %>% unlist() # return all_GRL + # Rename GRanges after they've been unnested + names(all_GRL) <- names(unlist(GR.annotations)) + + # Merge lists together + if (!is.null(all_GRL)) { + ALL_GRL <- unlist(GenomicRanges::GRangesList(all_GRL)) + ALL_GRL <- granges_overlap( + dat1 = finemap_dat, + chrom_col.1 = "CHR", + start_col.1 = "POS", + end_col.1 = "POS", + dat2 = ALL_GRL + ) + # Parse metadata + ALL_GRL$library <- lib.name + ALL_GRL$fullname <- names(ALL_GRL) + ALL_GRL <- XGR.parse_metadata( + gr.lib = ALL_GRL, + lib.name = lib.name + ) + return(ALL_GRL) + } else { + return(NULL) + } + }) # return OVERLAP + # Merge + gr.lib <- GenomicRanges::GRangesList(unlist(gr.lib)) + if (as_grangesList == FALSE) { + gr.lib <- unlist(gr.lib) + } + return(gr.lib) +} diff --git a/R/XGR.enrichment.R b/R/XGR.enrichment.R new file mode 100644 index 0000000..2a4774b --- /dev/null +++ b/R/XGR.enrichment.R @@ -0,0 +1,123 @@ +#' XGR enrichment +#' +#' Run SNP-level enrichment test with \link[XGR]{xGRviaGenomicAnno}. +#' +#' @param gr Annotations to test for enrichment with. +#' @param merged_dat SNP-level fine-mapping results to test for enrichment with. +#' @param foreground_filter Filter to apply to foreground (target SNPs). +#' @param background_filter Filter to apply to background (non-target SNPs). +#' @param grouping_vars Columns in \code{merged_dat} to group by when conducting +#' enrichment tests. +#' @param fg_sample_size Foreground sample size. +#' @param bg_sample_size Background sample size. +#' @param background.annotatable.only For background SNPs, +#' only use SNPs that overlap with some annotation in \code{gr}. +#' This means that missing annotations (\code{NA}) will not be considered. +#' @param verbose Print messages. +#' +#' @family XGR +#' @examples +#' \dontrun{ +#' gr.merged <- echoannot::merge_celltype_specific_epigenomics() +#' enrich.lead <- XGR.enrichment( +#' gr = gr.merged, +#' merged_dat = echodata::Nalls2019_merged, +#' foreground_filter = "leadSNP==TRUE", +#' grouping_vars = c("Study", "Cell_type", "Assay") +#' ) +#' } +#' @export +#' @importFrom data.table rbindlist +#' @importFrom XGR xGRviaGenomicAnno +XGR.enrichment <- function(gr, + merged_dat, + foreground_filter = "Consensus_SNP==TRUE", + background_filter = NULL, + grouping_vars = c( + "Study", + "Assay", + "Cell_type" + ), + fg_sample_size = NULL, + bg_sample_size = NULL, + background.annotatable.only = FALSE, + verbose = TRUE) { + fg_bg <- XGR.prepare_foreground_background( + subset_DT = merged_dat, + foreground_filter = foreground_filter, + background_filter = background_filter, + fg_sample_size = fg_sample_size, + bg_sample_size = bg_sample_size + ) + # Create all combinations + # if(!is.null(grouping_vars)){ + # combos <- expand.grid(sapply( subset(data.frame(gr), + # select=grouping_vars), unique)) %>% + # `colnames<-`(grouping_vars) + # if(length(grouping_vars)<2) {combos$dummy1 <- 1; gr$dummy1 <- 1; } + # }else { + # combos <- data.frame(dummy1=1, dummy2=2); + # gr$dummy1 <- 1; gr$dummy2 <- 2; + # } + + combos <- unique(data.frame(gr)[, grouping_vars]) + combos[is.na(combos)] <- "NA" + + messager("+ XGR:: Conducting enrichment tests for", + nrow(combos), "combinations of `grouping_vars`.", + v = verbose + ) + RES <- lapply( + seq(1, nrow(combos)), + function(i, + .background.annotatable.only = + background.annotatable.only) { + ROW <- combos[i, ] + # messager("+ XGR::",ROW) + gr.sub <- gr + for (column in colnames(combos)) { + gr.sub <- subset( + gr.sub, + eval(parse(text = column)) == ROW[[column]] + ) + } + + res <- suppressMessages( + XGR::xGRviaGenomicAnno( + data.file = fg_bg$foreground, + background.file = fg_bg$background, + format.file = "data.frame", + GR.annotation = gr.sub, + background.annotatable.only = + .background.annotatable.only, + verbose = FALSE + ) + ) + for (column in colnames(combos)) { + res[[column]] <- ROW[[column]] + } + return(res) + } + ) %>% data.table::rbindlist() + RES$fg_filter <- if (is.null(foreground_filter)) { + NA + } else { + foreground_filter + } + RES$bg_filter <- if (is.null(background_filter)) { + NA + } else { + background_filter + } + RES$fg_sample_size <- if (is.null(fg_sample_size)) { + nrow(fg_bg$foreground) + } else { + fg_sample_size + } + RES$bg_sample_size <- if (is.null(bg_sample_size)) { + nrow(merged_dat) + } else { + bg_sample_size + } + return(RES) +} diff --git a/R/XGR.enrichment_bootstrap.R b/R/XGR.enrichment_bootstrap.R new file mode 100644 index 0000000..9f665ff --- /dev/null +++ b/R/XGR.enrichment_bootstrap.R @@ -0,0 +1,111 @@ +#' XGR enrichment (bootstrapped) +#' +#' Perform annotation enrichment tests using iterative bootstrapping procedure. +#' +#' @param snp_groups Which SNP groups to repeat enrichment tests for separately. +#' @param iterations Number of bootstrapping iterations. +#' @param bootstrap Whether to use bootstrapping. +#' @param save_path File path to save results to. +#' @param nThread Number of threads to parallelise bootstrapping over. +#' @inheritParams XGR.enrichment +#' +#' @family XGR +#' @examples +#' \dontrun{ +#' gr.merged <- echoannot::merge_celltype_specific_epigenomics() +#' enrich_res <- XGR.enrichment_bootstrap( +#' gr = gr.merged, +#' merged_dat = echodata::Nalls2019_merged +#' ) +#' } +#' @importFrom data.table rbindlist fwrite +#' @importFrom parallel mclapply +#' @importFrom dplyr %>% +#' @importFrom stats p.adjust +XGR.enrichment_bootstrap <- function(gr, + merged_dat, + snp_groups = c( + "Random", + "GWAS lead", + "UCS (-PolyFun)", + "UCS", "Consensus (-PolyFun)", + "Consensus" + ), + background_filter = NULL, + grouping_vars = c( + "Study", + "Assay", + "Cell_type" + ), + iterations = 1000, + fg_sample_size = 20, + bg_sample_size = NULL, + bootstrap = TRUE, + save_path = tempfile( + fileext = + "XGR_enrich_boot_res.csv.gz" + ), + nThread = 1, + verbose = TRUE) { + if (bootstrap) { + messager("XGR:: Initiating bootstrap enrichment procedure", v = verbose) + } else { + iterations <- 1 + bg_sample_size <- NULL + fg_sample_size <- NULL + } + sampling_df <- merged_dat + + RES_GROUPS <- lapply( + snp_groups, + function(snp_group, + .merged_dat = merged_dat, + .grouping_vars = grouping_vars, + .background_filter = background_filter, + .fg_sample_size = fg_sample_size, + .bg_sample_size = bg_sample_size) { + snp_filters <- snp_group_filters(random_sample_size = .fg_sample_size) + .foreground_filter <- snp_filters[snp_group] + message(snp_group, " :: ", .foreground_filter) + RES <- parallel::mclapply(seq(1, iterations), + function(i, + merged_dat = .merged_dat, + grouping_vars = .grouping_vars, + foreground_filter = .foreground_filter, + background_filter = .background_filter, + fg_sample_size = .fg_sample_size, + bg_sample_size = .bg_sample_size) { + try({ + XGR.enrichment( + gr = gr, + merged_dat = merged_dat, + foreground_filter = foreground_filter, + background_filter = background_filter, + grouping_vars = grouping_vars, + fg_sample_size = fg_sample_size, + bg_sample_size = bg_sample_size + ) + }) + }, + mc.cores = nThread + ) %>% data.table::rbindlist(fill = TRUE) + RES$SNP_group <- snp_group + return(RES) + } + ) %>% data.table::rbindlist(fill = T) + + # Post-process + RES_GROUPS <- RES_GROUPS %>% + dplyr::mutate( + SNP_group = factor(SNP_group, + levels = unique(SNP_group), + ordered = TRUE + ), + FDR = stats::p.adjust(p = pvalue, method = "fdr") + ) + if (save_path != FALSE) { + messager("XGR:: Saving enrichment results ==>", save_path, v = verbose) + data.table::fwrite(RES_GROUPS, save_path) + } + return(RES_GROUPS) +} diff --git a/R/XGR.enrichment_plot.R b/R/XGR.enrichment_plot.R new file mode 100644 index 0000000..795a10f --- /dev/null +++ b/R/XGR.enrichment_plot.R @@ -0,0 +1,167 @@ +#' Plot enrichment results +#' +#' @family XGR +#' @examples +#' \dontrun{ +#' root <- file.path( +#' "/sc/arion/projects/pd-omics/brian", +#' "Fine_Mapping/Data/GWAS/Nalls23andMe_2019/_genome_wide" +#' ) +#' ### merged enrichment results +#' enrich_res <- data.table::fread( +#' file.path( +#' root, +#' "XGR/celltypespecific_epigenomics.SNP_groups.csv.gz" +#' ) +#' ) +#' enrich_res <- data.table::fread( +#' file.path( +#' root, +#' "XGR/celltypespecific_epigenomics.snp_groups.csv.gz" +#' ) +#' ) +#' enrich_boot <- data.table::fread( +#' file.path( +#' root, +#' "XGR/celltypespecific_epigenomics.snp_groups.permute.csv.gz" +#' ) +#' ) +#' enrich_assay <- data.table::fread( +#' file.path( +#' root, +#' "XGR/celltypespecific_epigenomics.snp_groups.assay.csv.gz" +#' ) +#' ) +#' +#' # Merged volcano plot +#' enrich_res <- subset(enrich_res, SNP_Group != "Consensus (-PolyFun)") %>% +#' dplyr::rename(SNP_group = SNP_Group) +#' gp <- XGR.enrichment_plot( +#' enrich_res = subset(enrich_res, !Assay %in% c("HiChIP_FitHiChIP", "PLAC")), +#' title = "Enrichment: Cell-type-specific epigenomics", +#' plot_type = "point", +#' save_plot = file.path( +#' root, "XGR/celltypespecific_epigenomics.enrich_volcano.png" +#' ), +#' height = 6, width = 8, shape_var = "Assay" +#' ) +#' ## Merged bar plot +#' gp <- XGR.enrichment_plot( +#' enrich_res = enrich_res, +#' plot_type = "bar", +#' facet_formula = ".~Assay", +#' FDR_thresh = .05 +#' ) +#' # Merged volcano plot (permuted) +#' gp <- XGR.enrichment_plot( +#' enrich_res = enrich.scATAC.permute, +#' title = "Permuted enrichment: Cell-type-specific peaks and elements", +#' plot_type = "point" +#' ) +#' } +XGR.enrichment_plot <- function(enrich_res, + title = NULL, + subtitle = NULL, + facet_formula = NULL, + line_formula = "y ~ x", + line_method = "lm", + line_span = 1, + FDR_thresh = 1, + plot_type = "bar", + shape_var = "Cell_type", + facet_scales = "free", + show_plot = TRUE, + save_plot = FALSE, + height = 5, + width = 5) { + enrich_res <- dplyr::mutate( + enrich_res, + SNP_group = factor(SNP_group, + levels = unique(SNP_group), + ordered = TRUE + ), + ## Make Random size smaller (otherwise will + # make everything else relatively tiny) + nOverlap = ifelse(SNP_group == "Random", 10, nOverlap) + ) + sum(enrich_res$fc == -Inf) + colorDict <- snp_group_colorDict() + if (plot_type == "bar") { + gp <- ggplot( + data = subset(enrich_res, FDR <= FDR_thresh), + aes(x = SNP_group, y = fc, fill = SNP_group) + ) + + # geom_col(stat="identity", alpha=.5, show.legend = F) + + geom_boxplot() + + geom_jitter(height = 0, width = 0, alpha = .1, show.legend = F) + + scale_fill_manual(values = colorDict) + + # ggpubr::stat_compare_means(method = method, + # comparisons = comparisons, + # label = "p.signif", size=3, vjust = 1.5) + + facet_grid( + facets = if (is.null(facet_formula)) { + facet_formula + } else { + as.formula(facet_formula) + }, + scales = "free_y" + ) + + labs(x = "SNP Group", title = title, subtitle = subtitle) + + theme_bw() + + theme( + strip.background = element_rect(fill = "grey20"), + strip.text = element_text(color = "white"), + axis.text.x = element_text(angle = 45, hjust = 1) + ) + } + + if (plot_type == "point") { + gp <- ggplot( + data = subset(enrich_res, FDR <= FDR_thresh), + aes( + x = log1p(fc), y = -log10(pvalue), + size = nOverlap, color = SNP_group, group = SNP_group, + fill = SNP_group, + shape = eval(parse(text = shape_var)) + ) + ) + + geom_smooth( + alpha = 0.1, size = 0, span = line_span, + method = line_method, formula = line_formula + ) + + stat_smooth( + geom = "line", alpha = 0.3, size = 1, span = line_span, + method = line_method, formula = line_formula + ) + + geom_point(alpha = .5) + + scale_color_manual(values = colorDict) + + scale_fill_manual(values = colorDict) + + scale_shape_manual( + values = seq(12, (12 + dplyr::n_distinct( + enrich_res[[shape_var]] + ))) + ) + + geom_hline(yintercept = -log10(0.05), linetype = 2, alpha = .5) + + facet_grid( + facets = if (is.null(facet_formula)) { + facet_formula + } else { + as.formula(facet_formula) + }, + scales = facet_scales + ) + + labs(title = title, subtitle = subtitle, shape = shape_var) + + theme_bw() + + theme( + strip.background = element_rect(fill = "grey20"), + strip.text = element_text(color = "white") + ) + } + + if (show_plot) print(gp) + + if (save_plot != FALSE) { + ggsave(save_plot, gp, dpi = 400, height = height, width = width) + } + return(gp) +} diff --git a/R/XGR.filter_assays.R b/R/XGR.filter_assays.R new file mode 100644 index 0000000..e983627 --- /dev/null +++ b/R/XGR.filter_assays.R @@ -0,0 +1,26 @@ +#' Filter assays +#' +#' Identify the assays with the most annotations in the locus. +#' Then only keep these assays +#' @keywords internal +#' @family XGR +#' @importFrom dplyr %>% n_distinct group_by tally +XGR.filter_assays <- function(gr.lib, + n_top_assays = 5) { + top_assays <- data.frame(gr.lib) %>% + dplyr::group_by(library, Assay) %>% + dplyr::tally(sort = T) + if (!is.null(n_top_assays)) { + gr.filt <- subset( + gr.lib, + Assay %in% + unique(top_assays$Assay[ + seq(1, min( + n_top_assays, + dplyr::n_distinct(top_assays$Assay) + )) + ]) + ) + } + return(gr.filt) +} diff --git a/R/XGR.filter_sources.R b/R/XGR.filter_sources.R new file mode 100644 index 0000000..55faf1f --- /dev/null +++ b/R/XGR.filter_sources.R @@ -0,0 +1,26 @@ +#' Filter sources +#' +#' Identify the sources with the most annotations in the locus. +#' Then only keep these sources. +#' @keywords internal +#' @family XGR +#' @importFrom dplyr n_distinct +XGR.filter_sources <- function(gr.lib, + n_top_sources = 5) { + top_sources <- data.frame(gr.lib) %>% + dplyr::group_by(library, Source) %>% + dplyr::tally(sort = TRUE) + if (!is.null(n_top_sources)) { + gr.filt <- subset( + gr.lib, + Source %in% + unique(top_sources$Source[ + seq(1, min( + n_top_sources, + dplyr::n_distinct(top_sources$Source) + )) + ]) + ) + } + return(gr.filt) +} diff --git a/R/XGR.import_annotations.R b/R/XGR.import_annotations.R new file mode 100644 index 0000000..b6f2abc --- /dev/null +++ b/R/XGR.import_annotations.R @@ -0,0 +1,55 @@ +#' Download XGR annotations +#' +#' @family XGR +#' @keywords internal +#' @importFrom XGR xRDataLoader +XGR.import_annotations <- function(gr.snp, + anno_data_path = + file.path( + "annotations", + paste0( + "XGR_", + lib.name, ".rds" + ) + ), + lib.name, + save_xgr = TRUE, + annot_overlap_threshold = 5) { + if (file.exists(anno_data_path)) { + messager("") + messager("+ Saved annotation file detected. Loading...") + GR.annotations <- readRDS(anno_data_path) + } else { + messager("") + messager("+ XGR: Downloading...", lib.name) + GR.annotations <- XGR::xRDataLoader(RData.customised = lib.name) + if (save_xgr & !is.null(GR.annotations)) { + dir.create(dirname(anno_data_path), + showWarnings = FALSE, recursive = TRUE + ) + saveRDS(GR.annotations, file = anno_data_path) + } + } + GR.orig <- unlist(GR.annotations) + + gr.xgr <- lapply(names(GR.orig), function(g, gr.snp. = gr.snp) { + # messager("Finding overlap for:", g) + subsetByOverlaps <- get( + "subsetByOverlaps", + asNamespace("GenomicRanges") + ) + GR.overlap <- subsetByOverlaps(GR.orig[[g]], gr.snp.) + len <- length(seqnames(GR.overlap)) + # messager(" - Overlapping annotations = ",len) + if (len > 0) { + return(GR.overlap) + } else { + return(NULL) + } + }) + grl.xgr <- GR.name_filter_convert(gr.xgr, + names(GR.orig), + min_hits = annot_overlap_threshold + ) + return(grl.xgr) +} diff --git a/R/XGR.iterate_enrichment.R b/R/XGR.iterate_enrichment.R new file mode 100644 index 0000000..5aaccba --- /dev/null +++ b/R/XGR.iterate_enrichment.R @@ -0,0 +1,126 @@ +#' Conduct enrichment tests for each annotation +#' +#' XGR uses a binomial enrichment tests for each annotation. +#' +#' +#' \href{https://www.rdocumentation.org/packages/XGR/versions/1.1.5/topics/xDefineGenomicAnno}{ +#' Description of all datasets} +#' @inheritParams XGR.prepare_foreground_background +#' @examples +#' \dontrun{ +#' enrich_res <- XGR.iterate_enrichment( +#' subset_DT = echodata::Nalls2019_merged, +#' foreground_filter = "Consensus_SNP", +#' background_filter = "leadSNP", +#' lib.selections = c("ENCODE_TFBS_ClusteredV3_CellTypes") +#' ) +#' } +#' @family XGR +#' @keywords internal +#' @importFrom data.table rbindlist data.table fwrite +#' @importFrom parallel mclapply +#' @importFrom XGR xGRviaGenomicAnno xRDataLoader +#' @importFrom stats p.adjust +#' @importFrom dplyr %>% mutate arrange +XGR.iterate_enrichment <- function(subset_DT, + foreground_filter = "Consensus_SNP", + background_filter = "leadSNP", + lib.selections = + c( + "ENCODE_TFBS_ClusteredV3_CellTypes", + "ENCODE_DNaseI_ClusteredV3_CellTypes", + "Broad_Histone", + "FANTOM5_Enhancer", + "Segment_Combined_Gm12878", + "TFBS_Conserved", + "ReMap_PublicAndEncode_TFBS", + "Blueprint_VenousBlood_Histone", + "Blueprint_DNaseI", + # "Blueprint_Methylation_hyper", + # "Blueprint_Methylation_hypo", + # "Genic_anno", + "FANTOM5_CAT_Cell", + "FANTOM5_CAT_MESH", + "GWAScatalog_alltraits" + ), + save_path = FALSE, + nThread = 1) { + fg_bg <- XGR.prepare_foreground_background( + subset_DT, + foreground_filter = foreground_filter, + background_filter = background_filter + ) + + # lib.selections = c("ENCODE_TFBS_ClusteredV3_CellTypes", + # "ENCODE_DNaseI_ClusteredV3_CellTypes", + # "Broad_Histone", + # "UW_Histone", + # "SYDH_Histone", + # "FANTOM5_Enhancer", + # "TFBS_Conserved", + # "Uniform_TFBS", + # "Uniform_DNaseI_HS") + # roadmap_grl <- lapply(unique(subset_DT$Locus), function(locus){ + # locus_DT <- subset(subset_DT, Locus==locus) + # dat <- ROADMAP.tabix(results_path=results_path, + # chrom = locus_DT$CHR[1], + # min_pos = min(locus_DT$POS), + # max_pos = max(locus_DT$POS), + # eid=eid, + # convert_to_GRanges=T) + # return(dat) + # }) + database_results <- parallel::mclapply(lib.selections, function(lib.name) { + messager("XGR:: Testing enrichment: ", lib.name) + eTerm <- NULL + try({ + GR.annotations <- XGR::xRDataLoader(RData.customised = lib.name) + eTerm <- lapply(GR.annotations, function(grl) { + et <- XGR::xGRviaGenomicAnno( + data.file = fg_bg$foreground, + background.file = fg_bg$background, + format.file = "data.frame", + GR.annotation = grl + ) + return(et) + }) %>% data.table::rbindlist() + eTerm$lib <- lib.name + eTerm$fullname <- names(unlist(GR.annotations)) + eTerm$source <- lapply( + eTerm$fullname, + function(e) { + strsplit(e, "[.]")[[1]][1] + } + ) %>% + as.character() + eTerm$assay <- lapply( + eTerm$fullname, + function(e) { + strsplit(e, "[.]")[[1]][2] + } + ) %>% + as.character() + }) + return(eTerm) + }, mc.cores = nThread) + + # Re-calculate corrected p-val to account for multiple dbs tested + enrich_res <- data.table::rbindlist(database_results) %>% + dplyr::mutate( + FDR = stats::p.adjust( + p = pvalue, + method = "fdr" + ), + Bonf = stats::p.adjust( + p = pvalue, + method = "bonferroni" + ) + ) %>% + dplyr::arrange(FDR, -nOverlap, -fc) %>% + subset(adjp < 0.05) %>% + data.table::data.table() + if (save_path != FALSE) { + data.table::fwrite(enrich_res, save_path, quote = FALSE) + } + return(enrich_res) +} diff --git a/R/XGR.iterate_overlap.R b/R/XGR.iterate_overlap.R new file mode 100644 index 0000000..564dbac --- /dev/null +++ b/R/XGR.iterate_overlap.R @@ -0,0 +1,61 @@ +#' Check overlap with XGR annotations +#' +#' +#' Automatically handles different file formats provided by XGR +#' (e.g. varying kinds of nested/unnested \code{GRanges}). +#' Then returns a \code{Granges} object with only the XGR annotation ranges +#' that overlap with the SNPs in \code{subset_DT}. +#' The \code{GRanges} merges hits from \code{subset_DT}. +#' +#' @param nThread Multi-thread across libraries. +#' @param save_path Save the results as a \code{data.frame}. +#' @inheritParams XGR.prepare_foreground_background +#' @inheritParams XGR.download_and_standardize +#' @family XGR +#' @keywords internal +#' @examples +#' \dontrun{ +#' gr.hits <- XGR.iterate_overlap( +#' lib.selections = c("ENCODE_TFBS_ClusteredV3_CellTypes"), +#' subset_DT = echodata::BST1 +#' ) +#' } +#' @importFrom data.table fwrite +XGR.iterate_overlap <- function(lib.selections = + c( + "ENCODE_TFBS_ClusteredV3_CellTypes", + "TFBS_Conserved", + "ReMap_PublicAndEncode_TFBS", + "Uniform_TFBS" + ), + subset_DT, + save_path = FALSE, + nThread = 1) { + gr.lib <- XGR.download_and_standardize( + lib.selections = lib.selections, + finemap_dat = subset_DT, + nThread = nThread + ) + gr.hits <- granges_overlap( + dat1 = subset_DT, + chrom_col.1 = "CHR", + start_col.1 = "POS", + end_col.1 = "POS", + dat2 = gr.lib + ) + + ucs.hits <- subset(gr.hits, Consensus_SNP) + length(unique(subset(subset_DT, Consensus_SNP)$SNP)) + length(unique(subset(subset_DT, Consensus_SNP)$Locus)) + + length(unique(ucs.hits$SNP)) + length(unique(ucs.hits$Locus)) + + if (save_path != FALSE) { + dir.create(dirname(save_path), + showWarnings = FALSE, recursive = TRUE + ) + data.table::fwrite(data.frame(ucs.hits), save_path) + } + return(gr.hits) +} diff --git a/R/XGR.merge_and_process.R b/R/XGR.merge_and_process.R new file mode 100644 index 0000000..14f7b7d --- /dev/null +++ b/R/XGR.merge_and_process.R @@ -0,0 +1,56 @@ +#' Standardize XGR annotations +#' +#' Parses the metadata and adds it as columns, +#' and then merges the results into a single +#' \code{\link[GenomicRanges]{GenomicRangesList}} +#' +#' @param grl.xgr \link[GenomicRanges]{GenomicRangesList} of XGR queries. +#' @family XGR +#' @keywords internal +#' @importFrom GenomicRanges start end +#' @importFrom dplyr %>% group_by tally +XGR.merge_and_process <- function(grl.xgr, + lib, + n_top_sources = 10) { + # grl.xgr <- check_saved_XGR(results_path, lib) + ## Make track + ## Add and modify columns + grl.xgr.merged <- unlist(grl.xgr) + names(grl.xgr.merged) <- gsub("Broad_Histone_", "", names(grl.xgr.merged)) + sep <- XGR.sep_handler(lib.name = lib) + grl.xgr.merged$Source <- lapply( + names(grl.xgr.merged), + function(e) { + strsplit(e, sep)[[1]][1] + } + ) %>% + unlist() + # grl.xgr.merged$Source <- gsub("_","\n", grl.xgr.merged$Source) + grl.xgr.merged$Assay <- lapply( + names(grl.xgr.merged), + function(e) { + strsplit(e, sep)[[1]][2] + } + ) %>% + unlist() + grl.xgr.merged$Start <- GenomicRanges::start(grl.xgr.merged) + grl.xgr.merged$End <- GenomicRanges::end(grl.xgr.merged) + # Filter + top_sources <- grl.xgr.merged %>% + data.frame() %>% + dplyr::group_by(Source) %>% + dplyr::tally(sort = T) + grl.xgr.merged.filt <- subset( + grl.xgr.merged, + Source %in% unique(top_sources$Source[seq(1, n_top_sources)]) + ) + # Count + # snp.pos <- subset(gr.snp, SNP %in% c("rs7294619"))$POS + # snp.sub <- subset(grl.xgr.merged, + # Start<=snp.pos & End>=snp.pos) %>% data.frame() + grl.xgr.merged.filt$Source_Assay <- paste0( + grl.xgr.merged.filt$Source, + "_", grl.xgr.merged.filt$Assay + ) + return(grl.xgr.merged.filt) +} diff --git a/R/XGR.parse_metadata.R b/R/XGR.parse_metadata.R new file mode 100644 index 0000000..b88eb62 --- /dev/null +++ b/R/XGR.parse_metadata.R @@ -0,0 +1,17 @@ +#' XGR.parse_metadata +#' +#' @keywords internal +#' @family XGR +XGR.parse_metadata <- function(gr.lib, + lib.name = NA) { + # https://stackoverflow.com/questions/50518137/separate-a-column-into-2-columns-at-the-last-underscore-in-r + sep <- XGR.sep_handler(lib.name = lib.name) + GenomicRanges::mcols(gr.lib) <- + tidyr::separate(data.frame(GenomicRanges::mcols(gr.lib)), + sep = sep, + col = "fullname", + into = c("Source", "Assay"), + extra = "merge" + ) + return(gr.lib) +} diff --git a/R/XGR.plot_enrichment.R b/R/XGR.plot_enrichment.R new file mode 100644 index 0000000..5434fb1 --- /dev/null +++ b/R/XGR.plot_enrichment.R @@ -0,0 +1,65 @@ +#' Plot XGR enrichment +#' +#' @family XGR +#' @keywords internal +#' @examples +#' \dontrun{ +#' enrich_res <- XGR.iterate_enrichment( +#' subset_DT = echodata::Nalls2019_merged, +#' foreground_filter = "Consensus_SNP", +#' background_filter = "leadSNP", +#' lib.selections = c("ENCODE_TFBS_ClusteredV3_CellTypes") +#' ) +#' XGR.plot_enrichment(enrich_res) +#' } +XGR.plot_enrichment <- function(enrich_res, + adjp_thresh = 0.05, + top_annotations = NULL, + show_plot = TRUE) { + enrich_res <- dplyr::arrange(enrich_res, desc(fc)) + enrich_res$source <- factor(enrich_res$source, + unique(enrich_res$source), + ordered = TRUE + ) + enrich_res$assay <- factor(enrich_res$assay, + unique(enrich_res$assay), + ordered = TRUE + ) + if (is.null(top_annotations)) { + top_annotations <- nrow(enrich_res) + } + + gp <- ggplot( + data = subset(enrich_res, adjp < adjp_thresh)[ + seq(1, top_annotations), + ], + aes(y = fc, x = assay, fill = fc) + ) + + geom_col() + + labs( + title = paste0( + "Epigenomic annotation enrichment (FDR < ", + FDR_thresh, ")" + ), + subtitle = + "Foreground = Consensus SNPs\nBackground = Lead GWAS SNPs", + y = "Fold-change" + ) + + facet_grid( + facets = Cell_type ~ Assay, + scales = "free", + space = "free" + ) + + theme_bw() + + theme( + strip.placement = "outside", + strip.text.y.left = element_text(angle = 0), + strip.background = element_rect(color = "black", fill = "white"), + plot.title = element_text(hjust = .5), + plot.subtitle = element_text(hjust = .5) + ) + if (show_plot) { + print(gp) + } + return(gp) +} diff --git a/R/XGR.plot_peaks.R b/R/XGR.plot_peaks.R new file mode 100644 index 0000000..61258a3 --- /dev/null +++ b/R/XGR.plot_peaks.R @@ -0,0 +1,77 @@ +#' Plot XGR peaks +#' +#' Plots the distribution of annotations across a genomic region (x-axis). +#' +#' @family XGR +#' @keywords internal +#' @param gr.lib \code{GRanges} object of annotations. +#' @param geom Plot type ("density", or "histogram"). +#' @param locus Locus name (\emph{optional}). +#' @param adjust The granularity of the peaks. +#' @param show_plot Print the plot. +#' @return \code{ggbio} track plot. +#' @inheritParams XGR.prepare_foreground_background +#' @examples +#' \dontrun{ +#' gr.lib <- XGR.download_and_standardize( +#' c("ENCODE_DNaseI_ClusteredV3_CellTypes"), +#' finemap_dat = echodata::BST1 +#' ) +#' gr.filt <- XGR.filter_sources(gr.lib = gr.lib, n_top_sources = 5) +#' gr.filt <- XGR.filter_assays(gr.lib = gr.filt, n_top_assays = 5) +#' xgr.track <- XGR.plot_peaks( +#' gr.lib = gr.filt, +#' subset_DT = echodata::BST1, +#' fill_var = "Assay", +#' facet_var = "Source" +#' ) +#' } +#' @importFrom GenomicRanges mcols +XGR.plot_peaks <- function(gr.lib, + subset_DT, + fill_var = "Assay", + facet_var = "Source", + geom = "density", + locus = NULL, + adjust = .2, + show_plot = TRUE, + show.legend = TRUE, + as.ggplot = TRUE, + trim_xlims = FALSE) { + # data("BST1"); subset_DT <- BST1; show.legend=T; + # fill_var="Assay"; facet_var="Source"; geom="density"; adjust=.2; + gr.lib$facet_label <- gsub( + "_", "\n", + GenomicRanges::mcols(gr.lib)[, facet_var] + ) + xgr.track <- ggbio::autoplot(gr.lib, + # which = gr.snp, + ggplot2::aes(fill = eval(parse(text = fill_var))), + # formula(paste0(facet_var," ~ .")), + facets = formula("facet_label ~ ."), + # fill = "magenta", + color = "white", # NA + geom = geom, + adjust = adjust, + position = "stack", + # bins=50, + size = .1, + alpha = .7, + show.legend = show.legend + ) + + ggplot2::theme_bw() + + ggplot2::labs(fill = fill_var) + if (trim_xlims) { + xgr.track <- suppressMessages( + xgr.track + + xlim(min(subset_DT$POS), max(subset_DT$POS)) + ) + } + # ggbio::tracks(list("XGR"=xgr.track)) + if (show_plot) print(xgr.track) + if (as.ggplot) { + return(xgr.track@ggplot) + } else { + return(xgr.track) + } +} diff --git a/R/XGR.prepare_foreground_background.R b/R/XGR.prepare_foreground_background.R new file mode 100644 index 0000000..2ab3d1b --- /dev/null +++ b/R/XGR.prepare_foreground_background.R @@ -0,0 +1,86 @@ +#' Prepare SNP sets for enrichment +#' +#' Prepare custom foreground and background SNPs sets for enrichment +#' tests with XGR annotations. +#' +#' @param subset_DT Data.frame with at least the following columns: +#' \describe{ +#' \item{SNP}{SNP RSID} +#' \item{CHR}{chromosome} +#' \item{POS}{position} +#' } +#' @param foreground_filter Specify foreground by filtering SNPs +#' in \code{subset_DT}. +#' Write filter as a string (or \code{NULL} to include all SNPs). +#' @param background_filter Specify background by filtering SNPs +#' in \code{subset_DT}. +#' Write filter as a string (or \code{NULL} to include all SNPs). +#' @family XGR +#' @keywords internal +#' @examples +#' \dontrun{ +#' fg_bg <- XGR.prepare_foreground_background( +#' subset_DT = echodata::Nalls2019_merged, +#' foreground_filter = "Consensus_SNP==TRUE", +#' background_filter = "leadSNP==TRUE" +#' ) +#' } +#' @importFrom dplyr %>% mutate select sample_n +XGR.prepare_foreground_background <- function(subset_DT, + foreground_filter = "Support>0", + background_filter = NULL, + fg_sample_size = NULL, + bg_sample_size = NULL, + verbose = TRUE) { + if (!exists("sampling_df")) sampling_df <- subset_DT + messager("XGR:: Preparing foreground/background for enrichment test", + v = verbose + ) + #### Foreground #### + fg <- subset(subset_DT, eval(parse(text = foreground_filter))) %>% + dplyr::mutate( + chrom = paste0(gsub("chr", "", CHR)), + chromStart = POS, + chromEnd = POS, + name = SNP + ) %>% + dplyr::select(chrom, chromStart, chromEnd, name) + + #### Background #### + if (any(is.na(background_filter))) { + ## Optionally, can supply no background at all to XGR + bg <- NULL + } else { + if (!is.null(background_filter)) { + bg_DT <- subset(subset_DT, eval(parse(text = background_filter))) + } else { + bg_DT <- subset_DT + } + bg <- bg_DT %>% + dplyr::mutate( + chrom = paste0(gsub("chr", "", CHR)), + chromStart = POS, + chromEnd = POS, + name = SNP + ) %>% + dplyr::select(chrom, chromStart, chromEnd, name) + } + + + #### Sample fg/bg (for bootstrapping) #### + if (!is.null(fg_sample_size)) { + messager("XGR:: Sampling", fg_sample_size, "foreground SNPs", v = verbose) + fg <- fg %>% dplyr::sample_n(size = fg_sample_size) + } + if (!is.null(bg_sample_size)) { + messager("XGR:: Sampling", bg_sample_size, "background SNPs", v = verbose) + bg <- bg %>% dplyr::sample_n(size = bg_sample_size) + } + + messager("XGR::", nrow(fg), "SNPs in foreground.") + messager("XGR::", nrow(bg), "SNPs in background") + return(list( + "foreground" = fg, + "background" = bg + )) +} diff --git a/R/XGR.sep_handler.R b/R/XGR.sep_handler.R new file mode 100644 index 0000000..de29894 --- /dev/null +++ b/R/XGR.sep_handler.R @@ -0,0 +1,20 @@ +#' XGR.sep_handler +#' +#' @keywords internal +#' @family XGR +XGR.sep_handler <- function(lib.name) { + # "_(?=[^_]+$)" : Split by the last "_" + sepDict <- list( + "ENCODE_TFBS_ClusteredV3_CellTypes" = "[.]", + "ENCODE_DNaseI_ClusteredV3_CellTypes" = "_(?=[^_]+$)", + "Broad_Histone" = "_(?=[^_]+$)", + "FANTOM5_Enhancer" = "_(?=[^_]+$)", + "TFBS_Conserved" = "[$]" + ) + if (lib.name %in% names(sepDict)) { + sep <- sepDict[[lib.name]] + } else { + sep <- "_(?=[^_]+$)" + } + return(sep) +} diff --git a/R/cell_type_specificity.R b/R/cell_type_specificity.R index d26eb8b..a110a26 100644 --- a/R/cell_type_specificity.R +++ b/R/cell_type_specificity.R @@ -4,7 +4,7 @@ #' and then identify the number of SNPs overlapping by each cell type #' #' @keywords internal -#' @import ggplot2 +#' @rawNamespace import(ggplot2, except = c(geom_rect, ggsave)) #' @importFrom dplyr %>% top_n cell_type_specificity <- function(plot_dat, merged_DT, diff --git a/R/coloc_nominated_eGenes.R b/R/coloc_nominated_eGenes.R index 7f98a3c..8b9c31b 100644 --- a/R/coloc_nominated_eGenes.R +++ b/R/coloc_nominated_eGenes.R @@ -37,7 +37,7 @@ #' ) #' } #' @keywords internal -#' @import ggplot2 +#' @rawNamespace import(ggplot2, except = c(geom_rect, ggsave)) #' @importFrom dplyr %>% group_by top_n slice mutate desc arrange #' @importFrom data.table fread data.table coloc_nominated_eGenes <- function(coloc_results, diff --git a/R/dt_to_granges.R b/R/dt_to_granges.R new file mode 100644 index 0000000..12db2ba --- /dev/null +++ b/R/dt_to_granges.R @@ -0,0 +1,29 @@ +#' Convert data.table to GRanges object +#' +#' @family utils +#' @keywords internal +#' @importFrom GenomicRanges makeGRangesFromDataFrame +#' @importFrom GenomeInfoDb seqlevelsStyle +dt_to_granges <- function(subset_DT, + chrom_col="CHR", + start_col="POS", + end_col=start_col, + style="NCBI", + verbose=TRUE){ + if (is_granges(subset_DT)) { + messager("subset_DT is already a GRanges object.",v=verbose) + gr.snp <- subset_DT + } else { + messager("Converting subset_DT to GRanges object.",v=verbose) + subset_DT[["SEQnames"]] <- subset_DT[[chrom_col]] + gr.snp <- GenomicRanges::makeGRangesFromDataFrame( + subset_DT, + seqnames.field = "SEQnames", + start.field = start_col, + end.field = end_col, + keep.extra.columns = TRUE) + } + suppressMessages(suppressWarnings( + GenomeInfoDb::seqlevelsStyle(gr.snp) <- style)) + return(gr.snp) +} diff --git a/R/granges_overlap.R b/R/granges_overlap.R index 8300f2f..a1baa86 100644 --- a/R/granges_overlap.R +++ b/R/granges_overlap.R @@ -17,7 +17,7 @@ granges_overlap <- function(dat1, chr_format = "NCBI", verbose = FALSE) { # dat1 - if (class(dat1)[1] == "GRanges") { + if (is_granges(dat1)) { messager("+ dat1 already in GRanges format", v = verbose) gr.dat1 <- dat1 } else { @@ -31,7 +31,7 @@ granges_overlap <- function(dat1, ) } # dat2 - if (class(dat2)[1] == "GRanges") { + if (is_granges(dat2)) { messager("+ dat2 already in GRanges format", v = verbose) gr.dat2 <- dat2 } else { @@ -64,7 +64,7 @@ granges_overlap <- function(dat1, # gr.hits <- cbind(mcols(gr.regions[ S4Vectors::subjectHits(hits), ] ), # mcols(gr.consensus[S4Vectors::queryHits(hits),]) ) message( - "", nrow(GenomicRanges::mcols(gr.hits)), + "", formatC(nrow(GenomicRanges::mcols(gr.hits)), big.mark = ","), " query SNP(s) detected with reference overlap." ) # print(data.frame(mcols(gr.hits[,c("Name","SNP")])) ) diff --git a/R/granges_to_bed.R b/R/granges_to_bed.R new file mode 100644 index 0000000..d167797 --- /dev/null +++ b/R/granges_to_bed.R @@ -0,0 +1,43 @@ +#' Convert GRanges object to BED format and save +#' +#' @family XGR +#' @keywords internal +#' @importFrom data.table as.data.table fwrite +#' @importFrom parallel mclapply +#' @importFrom dplyr %>% select +#' @importFrom R.utils gzip +granges_to_bed <- function(GR.annotations, + output_path, + sep = "\t", + nThread = 1, + gzip = FALSE) { + BED_paths <- parallel::mclapply(names(GR.annotations), + function(name, + .gzip = gzip) { + GR <- GR.annotations[[name]] + BED <- data.table::as.data.table(GR) %>% + dplyr::select( + chrom = seqnames, + chromStart = start, + chromEnd = end, + strand + ) + BED_path <- file.path(output_path, paste0( + gsub(":", "-", name), + ".bed.txt" + )) + dir.create(dirname(BED_path), recursive = TRUE, showWarnings = FALSE) + data.table::fwrite(BED, BED_path, + sep = sep, + col.names = FALSE, quote = FALSE + ) + if (.gzip) { + R.utils::gzip(BED_path, overwrite = TRUE) + BED_path <- paste0(BED_path, ".gz") + } + return(BED_path) + }, + mc.cores = nThread + ) %>% unlist() + return(BED_paths) +} diff --git a/R/is_granges.R b/R/is_granges.R new file mode 100644 index 0000000..8a035d6 --- /dev/null +++ b/R/is_granges.R @@ -0,0 +1,7 @@ +#' is_granges +#' +#' @keywords internal +#' @importFrom methods is +is_granges <- function(obj){ + methods::is(obj,"GRanges") +} \ No newline at end of file diff --git a/R/merge_celltype_specific_epigenomics.R b/R/merge_celltype_specific_epigenomics.R index fa6e16c..ae12f76 100644 --- a/R/merge_celltype_specific_epigenomics.R +++ b/R/merge_celltype_specific_epigenomics.R @@ -2,9 +2,12 @@ #' #' Merges multiple cell-type-specific epigenomic datasets #' (Nott 2019, Corces 2020) into a single \link[GenomicRanges]{GRanges} object. +#' @param keep_extra_cols Keep extra columns +#' that are not shared across all annotations. #' #' @examples -#' gr.merged <- merge_celltype_specific_epigenomics() +#' gr.merged <- echoannot::merge_celltype_specific_epigenomics() +#' @export #' @importFrom tidyr separate #' @importFrom dplyr %>% mutate select #' @importFrom data.table rbindlist data.table diff --git a/R/peak_overlap_plot.R b/R/peak_overlap_plot.R index 15ace29..299e05a 100644 --- a/R/peak_overlap_plot.R +++ b/R/peak_overlap_plot.R @@ -29,7 +29,7 @@ #' fill_title = "UCS SNPs in epigenomic peaks" #' ) #' @export -#' @import ggplot2 +#' @rawNamespace import(ggplot2, except = c(geom_rect, ggsave)) #' @importFrom patchwork plot_layout #' @importFrom scales alpha #' @importFrom stats formula @@ -41,7 +41,8 @@ peak_overlap_plot <- function(merged_DT, include.CORCES_2020_scATACpeaks = TRUE, include.CORCES_2020_Cicero_coaccess = TRUE, include.CORCES_2020_bulkATACpeaks = TRUE, - include.CORCES_2020_HiChIP_FitHiChIP_coaccess = TRUE, + include.CORCES_2020_HiChIP_FitHiChIP_coaccess = + TRUE, include.CORCES_2020_gene_annotations = TRUE, plot_celltype_specificity = TRUE, plot_celltype_specificity_genes = FALSE, diff --git a/R/save_annotations.R b/R/save_annotations.R new file mode 100644 index 0000000..fa74989 --- /dev/null +++ b/R/save_annotations.R @@ -0,0 +1,8 @@ +save_annotations <- function(gr, + anno_path=tempfile(fileext = ".rds"), + libName, + verbose=TRUE){ + messager("Saving annotations ==>", anno_path, v=verbose) + dir.create(dirname(anno_path), showWarnings = FALSE, recursive = TRUE) + saveRDS(gr, file.path(anno_path)) +} \ No newline at end of file diff --git a/README.Rmd b/README.Rmd index 3994289..962cc5e 100644 --- a/README.Rmd +++ b/README.Rmd @@ -29,7 +29,8 @@ knitr::opts_chunk$set(echo = TRUE) ## Fine-mapping results data -Provides both built-in fine-mapping results and API access to the [**echolocatoR Fine-mapping Portal**](https://rajlab.shinyapps.io/Fine_Mapping_Shiny/). +Provides both built-in, and API accessible genomic annotations +and epigenomic data. ```{r, eval=FALSE} if(!"remotes" %in% rownames(installed.packages())){install.packages("remotes")} diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..62ad943 --- /dev/null +++ b/docs/404.html @@ -0,0 +1,148 @@ + + + + + + + + +Page not found (404) • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +Content not found. Please use links in the navbar. + +
+ + + +
+ + + + +
+ + + + + + + + diff --git a/docs/articles/echoannot.html b/docs/articles/echoannot.html new file mode 100644 index 0000000..d66cc3d --- /dev/null +++ b/docs/articles/echoannot.html @@ -0,0 +1,1796 @@ + + + + + + + +echoannot: Getting Started • echoannot + + + + + + + + + + +
+
+ + + + +
+
+ + + + + +
## Warning: replacing previous import 'ggplot2::geom_rect' by 'ggbio::geom_rect'
+## when loading 'echoannot'
+
## Warning: replacing previous import 'ggplot2::ggsave' by 'ggbio::ggsave' when
+## loading 'echoannot'
+ +
+

+Merge and annotate

+
+

+Import results

+

Import pre-calculated fine-mapping results from the echolocatoR Fine-mapping Portal.

+
+local_files <- echodata::portal_query(phenotypes = "parkinson",
+                                      LD_panels = "UKB", 
+                                      loci = c("BST1","LRRK2","MEX3C"),
+                                      file_types = "multi_finemap")
+

Merge (and annotate) SNP-wise fine-mapping results.

+
+dataset <- dirname(dirname(dirname(local_files)))
+merged_DT <- echoannot::merge_finemapping_results(dataset = dataset[1], 
+                                                  minimum_support = 1,
+                                                  haploreg_annotation = TRUE)
+knitr::kable(merged_DT)
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SNPDatasetLocusCHRPOSPEffectStdErrA1A2FreqMAFN_casesN_controlsproportion_casesNt_statleadSNPABF.CSABF.PPSUSIE.CSSUSIE.PPPOLYFUN_SUSIE.CSPOLYFUN_SUSIE.PPFINEMAP.CSFINEMAP.PPSupportConsensus_SNPmean.PPmean.CSMbchrpos_hg38r2D’is_query_snprefaltAFRAMRASNEURGERP_consSiPhy_consChromatin_StatesChromatin_States_ImputedChromatin_MarksDNAseProteinseQTLgwasgraspMotifsGENCODE_idGENCODE_nameGENCODE_directionGENCODE_distanceRefSeq_idRefSeq_nameRefSeq_directionRefSeq_distancedbSNP_functional_annotationquery_snp_rsidPromoter_histone_marksEnhancer_histone_marks
rs10853605Nalls23andMe_2019MEX3C18487833420.00000390.04660.0101TC0.55690.44314905314110060.03361896204.6138614FALSENANA0000.000000011.0000001FALSE0.2500000048.783341851256972000TC0.340.490.600.4511E011,H3K4me1_Enh;E013,H3K4me1_Enh;E061,H3K4me1_Enh;E080,H3K4me1_Enh;E083,H3K4me1_Enh;E092,H3K4me1_Enh;E095,H3K4me1_Enh;E097,H3K4me1_Enh;E083,H3K9ac_Pro;E113,H3K4me3_Pro.GTEx2015_v6,Cells_Transformed_fibroblasts,MEX3C,4.62396778876924e-08.22233810,Gene expression of MEX3C (ENSG00000176624) in dendritic cells treated with Mycobacterium tuberculosis,0.001893471Hand1_1;Mef2_disc1;Mef2_known3;Mef2_known5ENSG00000207154.1U1326760NM_016626MEX3C559290.rs10853605
rs11175620Nalls23andMe_2019LRRK212406108640.00000000.13070.0142CG0.12000.12005630614177910.03822166219.2042254FALSENANA3131.0000000NANA2TRUE0.5000000040.610861240217062000GC0.110.060.000.1100E023,7_Enh;E024,7_Enh;E028,7_Enh;E029,7_Enh;E030,2_TssAFlnk;E031,2_TssAFlnk;E032,7_Enh;E035,1_TssA;E052,7_Enh;E080,7_Enh;E114,7_Enh;E117,7_Enh;E119,7_Enh;E124,2_TssAFlnkE023,16_EnhW1;E025,19_DNase;E028,19_DNase;E029,14_EnhA2;E030,13_EnhA1;E031,14_EnhA2;E032,22_PromP;E033,16_EnhW1;E035,16_EnhW1;E036,14_EnhA2;E037,22_PromP;E038,22_PromP;E039,22_PromP;E040,22_PromP;E041,22_PromP;E042,22_PromP;E043,22_PromP;E044,22_PromP;E045,22_PromP;E046,22_PromP;E048,22_PromP;E050,22_PromP;E051,16_EnhW1;E057,22_PromP;E062,16_EnhW1;E071,22_PromP;E080,22_PromP;E086,19_DNase;E088,22_PromP;E112,17_EnhW2;E113,16_EnhW1;E114,19_DNase;E117,19_DNase;E124,13_EnhA1E011,H3K4me1_Enh;E018,H3K4me1_Enh;E023,H3K4me1_Enh;E024,H3K4me1_Enh;E025,H3K4me1_Enh;E028,H3K4me1_Enh;E029,H3K4me1_Enh;E030,H3K4me1_Enh;E031,H3K4me1_Enh;E032,H3K4me1_Enh;E036,H3K4me1_Enh;E049,H3K4me1_Enh;E050,H3K4me1_Enh;E052,H3K4me1_Enh;E056,H3K4me1_Enh;E057,H3K4me1_Enh;E080,H3K4me1_Enh;E086,H3K4me1_Enh;E088,H3K4me1_Enh;E113,H3K4me1_Enh;E114,H3K4me1_Enh;E117,H3K4me1_Enh;E119,H3K4me1_Enh;E124,H3K4me1_Enh;E023,H3K4me3_Pro;E030,H3K4me3_Pro;E031,H3K4me3_Pro;E035,H3K4me3_Pro;E109,H3K4me3_Pro;E124,H3K4me3_Pro;E025,H3K9ac_Pro;E029,H3K27ac_Enh;E032,H3K27ac_Enh;E080,H3K27ac_Enh;E113,H3K27ac_Enh;E124,H3K27ac_EnhE006;E021;E029;E046;E080;E086;E088;E117;E120;E124.GTEx2015_v6,Adipose_Subcutaneous,LRRK2,3.29211855956645e-07;GTEx2015_v6,Artery_Tibial,LRRK2,1.08781866153343e-11;GTEx2015_v6,Cells_Transformed_fibroblasts,LRRK2,1.72128347769633e-05;GTEx2015_v6,Nerve_Tibial,LRRK2,5.31856078341246e-10;GTEx2015_v6,Skin_Not_Sun_Exposed_Suprapubic,LRRK2,1.00796507632068e-05;GTEx2015_v6,Skin_Sun_Exposed_Lower_leg,LRRK2,1.06318553434241e-05;Westra2013,Whole_Blood,-,1.3808392059010189E-31;Westra2013,Whole_Blood,LRRK2,2.116806823753094E-5..BCL_disc5;HDAC2_disc3ENSG00000225342.1AC079630.400NM_198578LRRK257947.rs11175620BLDFAT, ESC, BRST, BLD, MUS, ADRL, LNG, CRVX
rs113505952Nalls23andMe_2019MEX3C18486878840.6645000-0.00810.0186TC0.07930.07934905314110060.0336189620-0.4354839FALSENANA0000.000000011.0000001FALSE0.2500000048.687881851161514000CT0.250.090.090.0900E046,7_EnhE034,17_EnhW2;E046,18_EnhAcE011,H3K4me1_Enh;E031,H3K4me1_Enh;E044,H3K4me1_Enh;E046,H3K4me1_Enh;E047,H3K4me1_Enh;E113,H3K4me1_Enh;E014,H3K9ac_Pro;E020,H3K27ac_Enh....Foxa_disc3;Pax-5_disc1;TCF12_disc6ENSG00000176624.8MEX3C313035NM_016626MEX3C313034.rs113505952BLD
rs11564209Nalls23andMe_2019LRRK212406508750.0000000-0.18680.0292AT0.97420.02585630614177910.0382216621-6.3972603FALSENANA00NANA11.0000001FALSE0.2500000040.650871240257073000AT0.010.170.030.0200E124,H3K27ac_Enh.GTEx2015_v6,Nerve_Tibial,LRRK2,2.57325753962331e-07..BATF_disc3;BCL_disc4;Mrg_2;Myc_known9;Nanog_known1;Pou2f2_known11;p300_disc5ENSG00000188906.9LRRK200NM_198578LRRK200INTrs11564209
rs117929583Nalls23andMe_2019LRRK212407914070.00000000.21980.0285AG0.02630.02635630614177910.03822166217.7122807FALSENANA00NANA11.0000001FALSE0.2500000040.791411240397605000GA0.010.150.030.0200.GTEx2015_v6,Nerve_Tibial,LRRK2,1.98632825918171e-07..CEBPB_known6;Cphx;HNF1_7;Mef2_disc2;Myc_disc5;Pax-3_2;Pou1f1_2;Pou3f2_2;Pou3f4;p300_disc2ENSG00000258167.1RP11-115F18.100NM_198578LRRK2328320INTrs117929583
rs1893379Nalls23andMe_2019MEX3C18487185360.00000000.05580.0100AG0.45420.45424905314110060.03361896205.5800000FALSENANA1111.0000000NANA2TRUE0.5000000048.718541851192166000GA0.150.380.230.4400E002,7_Enh;E011,3_TxFlnk;E013,6_EnhG;E014,6_EnhG;E015,6_EnhG;E016,6_EnhG;E018,7_Enh;E019,6_EnhG;E020,3_TxFlnk;E023,7_Enh;E025,7_Enh;E026,7_Enh;E027,1_TssA;E028,7_Enh;E031,7_Enh;E032,7_Enh;E033,7_Enh;E035,6_EnhG;E037,7_Enh;E038,7_Enh;E039,7_Enh;E040,7_Enh;E041,2_TssAFlnk;E042,7_Enh;E043,7_Enh;E044,2_TssAFlnk;E045,7_Enh;E047,7_Enh;E048,7_Enh;E049,7_Enh;E050,7_Enh;E051,7_Enh;E052,7_Enh;E053,7_Enh;E054,7_Enh;E055,7_Enh;E057,7_Enh;E058,7_Enh;E061,7_Enh;E062,7_Enh;E068,7_Enh;E076,7_Enh;E078,7_Enh;E081,7_Enh;E082,7_Enh;E083,7_Enh;E086,7_Enh;E087,7_Enh;E088,7_Enh;E099,7_Enh;E103,7_Enh;E107,7_Enh;E115,6_EnhG;E116,1_TssA;E117,7_Enh;E119,2_TssAFlnk;E122,7_Enh;E123,7_Enh;E126,7_Enh;E127,7_EnhE001,12_TxEnhW;E002,12_TxEnhW;E003,12_TxEnhW;E004,12_TxEnhW;E008,12_TxEnhW;E009,12_TxEnhW;E010,12_TxEnhW;E011,10_TxEnh5;E012,12_TxEnhW;E013,12_TxEnhW;E014,12_TxEnhW;E015,12_TxEnhW;E016,12_TxEnhW;E018,12_TxEnhW;E019,10_TxEnh5;E020,12_TxEnhW;E023,12_TxEnhW;E024,12_TxEnhW;E025,12_TxEnhW;E026,12_TxEnhW;E027,10_TxEnh5;E028,10_TxEnh5;E030,12_TxEnhW;E031,10_TxEnh5;E032,10_TxEnh5;E033,10_TxEnh5;E034,10_TxEnh5;E035,12_TxEnhW;E036,12_TxEnhW;E037,9_TxReg;E038,10_TxEnh5;E039,10_TxEnh5;E040,9_TxReg;E041,9_TxReg;E042,9_TxReg;E043,4_PromD2;E044,9_TxReg;E045,4_PromD2;E046,12_TxEnhW;E047,10_TxEnh5;E048,9_TxReg;E049,12_TxEnhW;E050,10_TxEnh5;E051,10_TxEnh5;E052,12_TxEnhW;E053,12_TxEnhW;E054,12_TxEnhW;E055,12_TxEnhW;E057,12_TxEnhW;E058,10_TxEnh5;E061,12_TxEnhW;E062,12_TxEnhW;E063,12_TxEnhW;E066,12_TxEnhW;E067,12_TxEnhW;E070,12_TxEnhW;E072,12_TxEnhW;E073,12_TxEnhW;E078,12_TxEnhW;E081,12_TxEnhW;E082,12_TxEnhW;E083,10_TxEnh5;E086,12_TxEnhW;E087,12_TxEnhW;E088,12_TxEnhW;E093,12_TxEnhW;E099,12_TxEnhW;E103,12_TxEnhW;E104,12_TxEnhW;E108,12_TxEnhW;E112,12_TxEnhW;E114,12_TxEnhW;E115,10_TxEnh5;E116,9_TxReg;E117,12_TxEnhW;E119,9_TxReg;E120,12_TxEnhW;E121,12_TxEnhW;E122,12_TxEnhW;E123,12_TxEnhW;E124,12_TxEnhW;E125,12_TxEnhW;E126,12_TxEnhW;E127,10_TxEnh5;E129,12_TxEnhWE001,H3K4me1_Enh;E003,H3K4me1_Enh;E004,H3K4me1_Enh;E008,H3K4me1_Enh;E009,H3K4me1_Enh;E010,H3K4me1_Enh;E011,H3K4me1_Enh;E012,H3K4me1_Enh;E013,H3K4me1_Enh;E014,H3K4me1_Enh;E015,H3K4me1_Enh;E016,H3K4me1_Enh;E018,H3K4me1_Enh;E019,H3K4me1_Enh;E020,H3K4me1_Enh;E023,H3K4me1_Enh;E024,H3K4me1_Enh;E025,H3K4me1_Enh;E026,H3K4me1_Enh;E027,H3K4me1_Enh;E028,H3K4me1_Enh;E029,H3K4me1_Enh;E031,H3K4me1_Enh;E032,H3K4me1_Enh;E033,H3K4me1_Enh;E034,H3K4me1_Enh;E035,H3K4me1_Enh;E036,H3K4me1_Enh;E037,H3K4me1_Enh;E038,H3K4me1_Enh;E039,H3K4me1_Enh;E040,H3K4me1_Enh;E041,H3K4me1_Enh;E042,H3K4me1_Enh;E043,H3K4me1_Enh;E044,H3K4me1_Enh;E045,H3K4me1_Enh;E046,H3K4me1_Enh;E047,H3K4me1_Enh;E048,H3K4me1_Enh;E049,H3K4me1_Enh;E050,H3K4me1_Enh;E051,H3K4me1_Enh;E052,H3K4me1_Enh;E053,H3K4me1_Enh;E054,H3K4me1_Enh;E055,H3K4me1_Enh;E056,H3K4me1_Enh;E057,H3K4me1_Enh;E058,H3K4me1_Enh;E061,H3K4me1_Enh;E062,H3K4me1_Enh;E063,H3K4me1_Enh;E066,H3K4me1_Enh;E067,H3K4me1_Enh;E068,H3K4me1_Enh;E069,H3K4me1_Enh;E070,H3K4me1_Enh;E071,H3K4me1_Enh;E072,H3K4me1_Enh;E073,H3K4me1_Enh;E074,H3K4me1_Enh;E075,H3K4me1_Enh;E076,H3K4me1_Enh;E077,H3K4me1_Enh;E078,H3K4me1_Enh;E080,H3K4me1_Enh;E081,H3K4me1_Enh;E082,H3K4me1_Enh;E083,H3K4me1_Enh;E084,H3K4me1_Enh;E085,H3K4me1_Enh;E086,H3K4me1_Enh;E087,H3K4me1_Enh;E088,H3K4me1_Enh;E092,H3K4me1_Enh;E095,H3K4me1_Enh;E099,H3K4me1_Enh;E100,H3K4me1_Enh;E101,H3K4me1_Enh;E102,H3K4me1_Enh;E103,H3K4me1_Enh;E105,H3K4me1_Enh;E106,H3K4me1_Enh;E107,H3K4me1_Enh;E108,H3K4me1_Enh;E109,H3K4me1_Enh;E110,H3K4me1_Enh;E114,H3K4me1_Enh;E115,H3K4me1_Enh;E116,H3K4me1_Enh;E117,H3K4me1_Enh;E118,H3K4me1_Enh;E119,H3K4me1_Enh;E120,H3K4me1_Enh;E121,H3K4me1_Enh;E122,H3K4me1_Enh;E123,H3K4me1_Enh;E124,H3K4me1_Enh;E125,H3K4me1_Enh;E126,H3K4me1_Enh;E127,H3K4me1_Enh;E128,H3K4me1_Enh;E129,H3K4me1_Enh;E003,H3K4me3_Pro;E010,H3K4me3_Pro;E011,H3K4me3_Pro;E012,H3K4me3_Pro;E013,H3K4me3_Pro;E015,H3K4me3_Pro;E016,H3K4me3_Pro;E018,H3K4me3_Pro;E019,H3K4me3_Pro;E020,H3K4me3_Pro;E025,H3K4me3_Pro;E026,H3K4me3_Pro;E027,H3K4me3_Pro;E028,H3K4me3_Pro;E033,H3K4me3_Pro;E034,H3K4me3_Pro;E035,H3K4me3_Pro;E037,H3K4me3_Pro;E038,H3K4me3_Pro;E040,H3K4me3_Pro;E041,H3K4me3_Pro;E042,H3K4me3_Pro;E043,H3K4me3_Pro;E044,H3K4me3_Pro;E045,H3K4me3_Pro;E046,H3K4me3_Pro;E050,H3K4me3_Pro;E051,H3K4me3_Pro;E052,H3K4me3_Pro;E053,H3K4me3_Pro;E054,H3K4me3_Pro;E058,H3K4me3_Pro;E062,H3K4me3_Pro;E063,H3K4me3_Pro;E067,H3K4me3_Pro;E072,H3K4me3_Pro;E073,H3K4me3_Pro;E078,H3K4me3_Pro;E082,H3K4me3_Pro;E083,H3K4me3_Pro;E088,H3K4me3_Pro;E101,H3K4me3_Pro;E103,H3K4me3_Pro;E105,H3K4me3_Pro;E111,H3K4me3_Pro;E112,H3K4me3_Pro;E114,H3K4me3_Pro;E115,H3K4me3_Pro;E116,H3K4me3_Pro;E119,H3K4me3_Pro;E121,H3K4me3_Pro;E122,H3K4me3_Pro;E123,H3K4me3_Pro;E125,H3K4me3_Pro;E127,H3K4me3_Pro;E004,H3K9ac_Pro;E008,H3K9ac_Pro;E011,H3K9ac_Pro;E014,H3K9ac_Pro;E016,H3K9ac_Pro;E018,H3K9ac_Pro;E019,H3K9ac_Pro;E020,H3K9ac_Pro;E023,H3K9ac_Pro;E025,H3K9ac_Pro;E026,H3K9ac_Pro;E052,H3K9ac_Pro;E062,H3K9ac_Pro;E063,H3K9ac_Pro;E066,H3K9ac_Pro;E067,H3K9ac_Pro;E072,H3K9ac_Pro;E077,H3K9ac_Pro;E083,H3K9ac_Pro;E086,H3K9ac_Pro;E088,H3K9ac_Pro;E110,H3K9ac_Pro;E114,H3K9ac_Pro;E115,H3K9ac_Pro;E116,H3K9ac_Pro;E119,H3K9ac_Pro;E120,H3K9ac_Pro;E121,H3K9ac_Pro;E122,H3K9ac_Pro;E123,H3K9ac_Pro;E125,H3K9ac_Pro;E008,H3K27ac_Enh;E012,H3K27ac_Enh;E013,H3K27ac_Enh;E014,H3K27ac_Enh;E020,H3K27ac_Enh;E026,H3K27ac_Enh;E034,H3K27ac_Enh;E037,H3K27ac_Enh;E038,H3K27ac_Enh;E039,H3K27ac_Enh;E040,H3K27ac_Enh;E041,H3K27ac_Enh;E042,H3K27ac_Enh;E043,H3K27ac_Enh;E044,H3K27ac_Enh;E045,H3K27ac_Enh;E046,H3K27ac_Enh;E048,H3K27ac_Enh;E049,H3K27ac_Enh;E050,H3K27ac_Enh;E056,H3K27ac_Enh;E058,H3K27ac_Enh;E062,H3K27ac_Enh;E063,H3K27ac_Enh;E066,H3K27ac_Enh;E076,H3K27ac_Enh;E078,H3K27ac_Enh;E080,H3K27ac_Enh;E087,H3K27ac_Enh;E089,H3K27ac_Enh;E090,H3K27ac_Enh;E093,H3K27ac_Enh;E101,H3K27ac_Enh;E103,H3K27ac_Enh;E108,H3K27ac_Enh;E109,H3K27ac_Enh;E112,H3K27ac_Enh;E113,H3K27ac_Enh;E115,H3K27ac_Enh;E116,H3K27ac_Enh;E117,H3K27ac_Enh;E119,H3K27ac_Enh;E121,H3K27ac_Enh;E122,H3K27ac_Enh;E123,H3K27ac_Enh;E124,H3K27ac_Enh;E127,H3K27ac_EnhE028;E082;E090.GTEx2015_v6,Breast_Mammary_Tissue,MEX3C,6.43632475579646e-06;GTEx2015_v6,Cells_Transformed_fibroblasts,MEX3C,5.10420348099408e-12;GTEx2015_v6,Thyroid,MEX3C,1.85337713345071e-06;Lappalainen2013,Lymphoblastoid_EUR_exonlevel,ENSG00000176624.8_48700920_48703946,6.84711512731581e-07;Lappalainen2013,Lymphoblastoid_EUR_genelevel,MEX3C,1.94053610430114e-07;Westra2013,Whole_Blood,ME2,1.268991877789626E-4...ENSG00000176624.8MEX3C00NM_016626MEX3C00INTrs1893379BRST, BLDESC, ESDR, IPSC, FAT, STRM, BRST, BLD, MUS, BRN, SKIN, GI, HRT, KID, PANC, LNG, PLCNT, CRVX, VAS
rs34559912Nalls23andMe_2019BST14157301460.00000000.10300.0095TG0.55260.44745630614177910.038221662110.8421053FALSENANA3131.0000000NANA2TRUE0.5000000015.73015415728523000GT0.170.520.370.5700E093,7_EnhE014,H3K9ac_Pro;E047,H3K9ac_Pro;E068,H3K9ac_Pro;E072,H3K9ac_Pro;E023,H3K4me1_Enh;E093,H3K4me1_Enh;E124,H3K27ac_Enh.GTEx2015_v6,Adipose_Visceral_Omentum,RP11-115L11.1,4.90492322683713e-06;GTEx2015_v6,Brain_Caudate_basal_ganglia,CD38,1.25017558750329e-08;GTEx2015_v6,Brain_Cortex,CD38,1.71117192134186e-06;GTEx2015_v6,Brain_Nucleus_accumbens_basal_ganglia,CD38,1.08915972859775e-06;GTEx2015_v6,Cells_Transformed_fibroblasts,RP11-115L11.1,3.20069844767782e-15;GTEx2015_v6,Nerve_Tibial,RP11-115L11.1,6.59512086449678e-08..Mrg1::Hoxa9_2ENSG00000109743.6BST100NM_004334BST100INTrs34559912THYM
rs35519415Nalls23andMe_2019BST14157103300.00000000.08430.0095AC0.56550.43455630614177910.03822166218.8736842FALSENANA0000.000000010.9999591FALSE0.2499898015.71033415708707000AC0.590.440.560.4300E030,6_EnhGE007,H3K4me1_Enh;E009,H3K4me1_Enh;E010,H3K4me1_Enh;E012,H3K4me1_Enh;E029,H3K4me1_Enh;E030,H3K4me1_Enh;E055,H3K4me1_Enh;E088,H3K4me1_Enh;E111,H3K4me1_Enh;E117,H3K4me1_Enh;E124,H3K4me1_Enh;E013,H3K27ac_Enh;E067,H3K27ac_Enh;E069,H3K27ac_Enh;E124,H3K27ac_Enh;E027,H3K9ac_Pro;E083,H3K9ac_Pro;E111,H3K9ac_Pro.GTEx2015_v6,Brain_Nucleus_accumbens_basal_ganglia,FAM200B,1.43240818019526e-08;GTEx2015_v6,Cells_Transformed_fibroblasts,RP11-115L11.1,2.8464859168388e-11..Ik-2_1;Irf_known3;PLZF;STAT_disc3ENSG00000109743.6BST100NM_004334BST100INTrs35519415BLD
rs3756246Nalls23andMe_2019BST14157067900.0000000-0.06610.0095AT0.40340.40345630614177910.0382216621-6.9578947FALSENANA0000.000000011.0000001FALSE0.2500000015.70679415705167000TA0.580.410.330.4000E029,6_EnhG;E030,3_TxFlnk;E053,7_Enh;E074,7_Enh;E118,7_Enh;E124,3_TxFlnkE029,10_TxEnh5;E030,9_TxReg;E031,12_TxEnhW;E035,17_EnhW2;E124,13_EnhA1E002,H3K4me1_Enh;E005,H3K4me1_Enh;E006,H3K4me1_Enh;E007,H3K4me1_Enh;E009,H3K4me1_Enh;E010,H3K4me1_Enh;E012,H3K4me1_Enh;E013,H3K4me1_Enh;E016,H3K4me1_Enh;E025,H3K4me1_Enh;E029,H3K4me1_Enh;E030,H3K4me1_Enh;E031,H3K4me1_Enh;E038,H3K4me1_Enh;E053,H3K4me1_Enh;E063,H3K4me1_Enh;E066,H3K4me1_Enh;E067,H3K4me1_Enh;E069,H3K4me1_Enh;E071,H3K4me1_Enh;E072,H3K4me1_Enh;E074,H3K4me1_Enh;E078,H3K4me1_Enh;E079,H3K4me1_Enh;E082,H3K4me1_Enh;E083,H3K4me1_Enh;E084,H3K4me1_Enh;E085,H3K4me1_Enh;E094,H3K4me1_Enh;E097,H3K4me1_Enh;E099,H3K4me1_Enh;E104,H3K4me1_Enh;E121,H3K4me1_Enh;E124,H3K4me1_Enh;E125,H3K4me1_Enh;E002,H3K4me3_Pro;E030,H3K4me3_Pro;E077,H3K4me3_Pro;E110,H3K4me3_Pro;E111,H3K4me3_Pro;E124,H3K4me3_Pro;E007,H3K9ac_Pro;E063,H3K9ac_Pro;E067,H3K9ac_Pro;E072,H3K9ac_Pro;E073,H3K9ac_Pro;E074,H3K9ac_Pro;E077,H3K9ac_Pro;E083,H3K9ac_Pro;E101,H3K9ac_Pro;E111,H3K9ac_Pro;E124,H3K9ac_Pro;E012,H3K27ac_Enh;E029,H3K27ac_Enh;E059,H3K27ac_Enh;E063,H3K27ac_Enh;E066,H3K27ac_Enh;E067,H3K27ac_Enh;E068,H3K27ac_Enh;E069,H3K27ac_Enh;E071,H3K27ac_Enh;E072,H3K27ac_Enh;E073,H3K27ac_Enh;E074,H3K27ac_Enh;E076,H3K27ac_Enh;E078,H3K27ac_Enh;E084,H3K27ac_Enh;E085,H3K27ac_Enh;E092,H3K27ac_Enh;E096,H3K27ac_Enh;E097,H3K27ac_Enh;E101,H3K27ac_Enh;E106,H3K27ac_Enh;E111,H3K27ac_Enh;E113,H3K27ac_Enh;E115,H3K27ac_Enh;E124,H3K27ac_Enh.GTEx2015_v6,Artery_Tibial,FAM200B,2.99871044171767e-06;GTEx2015_v6,Brain_Nucleus_accumbens_basal_ganglia,FAM200B,9.80660669297648e-08;GTEx2015_v6,Cells_Transformed_fibroblasts,RP11-115L11.1,4.75076314728826e-08;Westra2013,Whole_Blood,-,6.795346249460126E-6;Westra2013,Whole_Blood,BST1,5.187033440697593E-116;Westra2013,Whole_Blood,FBXL5,2.4479224150185407E-14;Westra2013,Whole_Blood,FBXL5,3.0810590020329485E-28..Sox_16;Sox_17ENSG00000237765.2FAM200B00NM_004334BST100INTrs3756246BLD, BRN, LIV
rs4389574Nalls23andMe_2019BST14157303980.0000000-0.09770.0116AG0.44430.44434259813225090.0312165075-8.4224138FALSENANA1111.0000000NANA2TRUE0.5000000015.73040415728775000AG0.170.520.370.5700E093,7_EnhE014,H3K9ac_Pro;E047,H3K9ac_Pro;E068,H3K9ac_Pro;E072,H3K9ac_Pro;E093,H3K4me1_Enh;E124,H3K27ac_Enh.GTEx2015_v6,Adipose_Visceral_Omentum,RP11-115L11.1,7.96707696325135e-06;GTEx2015_v6,Brain_Caudate_basal_ganglia,CD38,1.2467177895689e-08;GTEx2015_v6,Brain_Cortex,CD38,1.70977511189002e-06;GTEx2015_v6,Brain_Nucleus_accumbens_basal_ganglia,CD38,1.08358888563218e-06;GTEx2015_v6,Cells_Transformed_fibroblasts,RP11-115L11.1,3.21205053848606e-15;GTEx2015_v6,Nerve_Tibial,RP11-115L11.1,6.74374690500463e-08;Ramasamy2014,Brain_OCTX,FBXL5,8.47E-08..Myc_known6;YY1_disc4ENSG00000109743.6BST100NM_004334BST100INTrs4389574THYM
rs4541502Nalls23andMe_2019BST14157127870.0000000-0.08970.0093TG0.47490.47495630614177910.0382216621-9.6451613FALSENANA2121.000000011.0000003TRUE0.7500000015.71279415711164000TG0.390.550.450.5400E124,H3K27ac_Enh.GTEx2015_v6,Brain_Caudate_basal_ganglia,CD38,2.1906795246105e-06;GTEx2015_v6,Brain_Nucleus_accumbens_basal_ganglia,FAM200B,8.16827868804762e-10;GTEx2015_v6,Brain_Putamen_basal_ganglia,CD38,1.11682671421168e-06;GTEx2015_v6,Cells_Transformed_fibroblasts,RP11-115L11.1,2.70302919332058e-10;GTEx2015_v6,Nerve_Tibial,RP11-115L11.1,5.06599980966537e-08;Westra2013,Whole_Blood,-,2.0272206900010006E-4;Westra2013,Whole_Blood,BST1,9.813427854297537E-198;Westra2013,Whole_Blood,FBXL5,1.47934426698415E-9;Westra2013,Whole_Blood,FBXL5,7.286931933820059E-15..Hoxa10;Hoxa9;Hoxb8;Hoxc9;Hoxd8;Isl2;Mef2_known2;Nkx6-1_1;Nkx6-1_3ENSG00000109743.6BST100NM_004334BST100INTrs4541502
rs4698412Nalls23andMe_2019BST14157373480.00000000.10350.0094AG0.55290.44715630614177910.038221662111.0106383TRUENANA0000.000000011.0000001FALSE0.2500000015.73735415735725000GA0.120.510.370.5600E010,7_Enh;E093,7_EnhE009,17_EnhW2E005,H3K4me3_Pro;E068,H3K4me3_Pro;E096,H3K4me3_Pro;E098,H3K4me3_Pro;E009,H3K4me1_Enh;E010,H3K4me1_Enh;E032,H3K4me1_Enh;E039,H3K4me1_Enh;E042,H3K4me1_Enh;E068,H3K4me1_Enh;E069,H3K4me1_Enh;E071,H3K4me1_Enh;E073,H3K4me1_Enh;E074,H3K4me1_Enh;E093,H3K4me1_Enh;E113,H3K4me1_Enh;E115,H3K4me1_Enh;E011,H3K27ac_Enh;E068,H3K27ac_Enh;E093,H3K27ac_Enh;E115,H3K27ac_Enh;E124,H3K27ac_EnhE081;E082.GTEx2015_v6,Adipose_Visceral_Omentum,RP11-115L11.1,4.90492322683713e-06;GTEx2015_v6,Brain_Caudate_basal_ganglia,CD38,1.04569060365368e-08;GTEx2015_v6,Brain_Cortex,CD38,7.9258927156503e-07;GTEx2015_v6,Brain_Nucleus_accumbens_basal_ganglia,CD38,1.48737436798319e-06;GTEx2015_v6,Brain_Putamen_basal_ganglia,CD38,1.654496840313e-06;GTEx2015_v6,Cells_Transformed_fibroblasts,RP11-115L11.1,4.41873234452936e-15;GTEx2015_v6,Nerve_Tibial,RP11-115L11.1,1.71815210274496e-07;Westra2013,Whole_Blood,-,2.834212197516388E-4;Westra2013,Whole_Blood,BST1,9.813427854297537E-198;Westra2013,Whole_Blood,FBXL5,2.0449986736598613E-7;Westra2013,Whole_Blood,FBXL5,2.2421033720911498E-821084426,Parkinson’s disease,2E-6;22451204,Parkinson’s disease,3E-721886157,Serum ratio of (guanosine)/(inosine),7.10E-04CACD_1;KAP1_disc2;SP2_disc3;ZBTB7A_disc2ENSG00000109743.6BST100NM_004334BST133551.rs4698412ESDR, THYM
rs6852450Nalls23andMe_2019BST14157429860.0000000-0.08460.0094TC0.43590.43595630614177910.0382216621-9.0000000FALSENANA0000.000000011.0000001FALSE0.2500000015.74299415741363000TC0.230.580.350.5900E066,7_Enh;E115,2_TssAFlnk;E118,7_EnhE066,16_EnhW1;E115,13_EnhA1E030,H3K4me1_Enh;E063,H3K4me1_Enh;E066,H3K4me1_Enh;E095,H3K4me1_Enh;E115,H3K4me1_Enh;E118,H3K4me1_Enh;E066,H3K27ac_Enh;E096,H3K27ac_Enh;E115,H3K27ac_Enh;E115,H3K4me3_Pro;E115,H3K9ac_Pro.GTEx2015_v6,Brain_Caudate_basal_ganglia,CD38,1.5255834739153e-07;GTEx2015_v6,Cells_Transformed_fibroblasts,RP11-115L11.1,1.93332338517896e-11;Ramasamy2014,Brain_HIPP,CD38,2.74E-08;Ramasamy2014,Brain_HIPP,CD38,2.85E-07;Ramasamy2014,Brain_HIPP,CD38,4.51E-08;Ramasamy2014,Brain_HIPP,CD38,5.25E-07;Westra2013,Whole_Blood,BST1,1.1060585197180966E-187;Westra2013,Whole_Blood,FBXL5,1.9688073249254627E-6..GZF1;Nkx2_3ENSG00000109743.6BST133049NM_004334BST139189.rs6852450BLDLIV
rs7294619Nalls23andMe_2019LRRK212406172020.0000000-0.12760.0140TC0.87830.12175630614177910.0382216621-9.1142857FALSENANA2121.000000011.0000003TRUE0.7500000040.617201240223400000TC0.110.060.000.1100E023,7_Enh;E025,7_Enh;E029,1_TssA;E030,2_TssAFlnk;E031,2_TssAFlnk;E032,1_TssA;E033,1_TssA;E035,1_TssA;E046,1_TssA;E050,7_Enh;E051,1_TssA;E062,1_TssA;E063,7_Enh;E066,7_Enh;E068,7_Enh;E074,7_Enh;E076,7_Enh;E078,1_TssA;E086,1_TssA;E103,7_Enh;E116,10_TssBiv;E124,1_TssAE009,23_PromBiv;E023,22_PromP;E025,22_PromP;E029,4_PromD2;E030,3_PromD1;E031,4_PromD2;E032,4_PromD2;E033,4_PromD2;E034,22_PromP;E035,4_PromD2;E036,4_PromD2;E037,22_PromP;E038,4_PromD2;E039,12_TxEnhW;E040,12_TxEnhW;E041,12_TxEnhW;E042,22_PromP;E043,4_PromD2;E044,4_PromD2;E045,12_TxEnhW;E046,4_PromD2;E047,4_PromD2;E048,22_PromP;E050,4_PromD2;E051,4_PromD2;E052,19_DNase;E053,22_PromP;E055,22_PromP;E057,22_PromP;E061,22_PromP;E062,4_PromD2;E063,22_PromP;E066,4_PromD2;E067,22_PromP;E068,22_PromP;E069,22_PromP;E070,22_PromP;E071,12_TxEnhW;E072,22_PromP;E073,22_PromP;E074,19_DNase;E075,22_PromP;E076,4_PromD2;E077,4_PromD2;E078,4_PromD2;E080,22_PromP;E081,22_PromP;E084,22_PromP;E085,22_PromP;E086,22_PromP;E088,22_PromP;E091,22_PromP;E092,22_PromP;E093,22_PromP;E100,22_PromP;E101,4_PromD2;E102,4_PromD2;E103,22_PromP;E106,22_PromP;E108,22_PromP;E109,22_PromP;E110,22_PromP;E111,16_EnhW1;E112,4_PromD2;E113,4_PromD2;E114,22_PromP;E115,23_PromBiv;E116,4_PromD2;E118,22_PromP;E119,22_PromP;E122,22_PromP;E124,3_PromD1E023,H3K4me1_Enh;E025,H3K4me1_Enh;E026,H3K4me1_Enh;E027,H3K4me1_Enh;E028,H3K4me1_Enh;E030,H3K4me1_Enh;E031,H3K4me1_Enh;E032,H3K4me1_Enh;E035,H3K4me1_Enh;E036,H3K4me1_Enh;E038,H3K4me1_Enh;E041,H3K4me1_Enh;E043,H3K4me1_Enh;E047,H3K4me1_Enh;E048,H3K4me1_Enh;E049,H3K4me1_Enh;E050,H3K4me1_Enh;E051,H3K4me1_Enh;E052,H3K4me1_Enh;E061,H3K4me1_Enh;E062,H3K4me1_Enh;E063,H3K4me1_Enh;E066,H3K4me1_Enh;E067,H3K4me1_Enh;E068,H3K4me1_Enh;E069,H3K4me1_Enh;E071,H3K4me1_Enh;E072,H3K4me1_Enh;E073,H3K4me1_Enh;E074,H3K4me1_Enh;E076,H3K4me1_Enh;E077,H3K4me1_Enh;E078,H3K4me1_Enh;E080,H3K4me1_Enh;E087,H3K4me1_Enh;E102,H3K4me1_Enh;E103,H3K4me1_Enh;E108,H3K4me1_Enh;E109,H3K4me1_Enh;E111,H3K4me1_Enh;E114,H3K4me1_Enh;E124,H3K4me1_Enh;E129,H3K4me1_Enh;E023,H3K4me3_Pro;E024,H3K4me3_Pro;E025,H3K4me3_Pro;E029,H3K4me3_Pro;E030,H3K4me3_Pro;E031,H3K4me3_Pro;E032,H3K4me3_Pro;E033,H3K4me3_Pro;E035,H3K4me3_Pro;E036,H3K4me3_Pro;E039,H3K4me3_Pro;E041,H3K4me3_Pro;E043,H3K4me3_Pro;E045,H3K4me3_Pro;E046,H3K4me3_Pro;E047,H3K4me3_Pro;E049,H3K4me3_Pro;E051,H3K4me3_Pro;E052,H3K4me3_Pro;E062,H3K4me3_Pro;E063,H3K4me3_Pro;E065,H3K4me3_Pro;E066,H3K4me3_Pro;E067,H3K4me3_Pro;E068,H3K4me3_Pro;E071,H3K4me3_Pro;E072,H3K4me3_Pro;E073,H3K4me3_Pro;E074,H3K4me3_Pro;E076,H3K4me3_Pro;E077,H3K4me3_Pro;E078,H3K4me3_Pro;E084,H3K4me3_Pro;E086,H3K4me3_Pro;E088,H3K4me3_Pro;E091,H3K4me3_Pro;E093,H3K4me3_Pro;E101,H3K4me3_Pro;E102,H3K4me3_Pro;E103,H3K4me3_Pro;E104,H3K4me3_Pro;E105,H3K4me3_Pro;E108,H3K4me3_Pro;E111,H3K4me3_Pro;E112,H3K4me3_Pro;E114,H3K4me3_Pro;E116,H3K4me3_Pro;E124,H3K4me3_Pro;E126,H3K4me3_Pro;E023,H3K9ac_Pro;E025,H3K9ac_Pro;E026,H3K9ac_Pro;E052,H3K9ac_Pro;E062,H3K9ac_Pro;E063,H3K9ac_Pro;E066,H3K9ac_Pro;E068,H3K9ac_Pro;E076,H3K9ac_Pro;E077,H3K9ac_Pro;E086,H3K9ac_Pro;E101,H3K9ac_Pro;E102,H3K9ac_Pro;E116,H3K9ac_Pro;E124,H3K9ac_Pro;E029,H3K27ac_Enh;E032,H3K27ac_Enh;E046,H3K27ac_Enh;E062,H3K27ac_Enh;E063,H3K27ac_Enh;E066,H3K27ac_Enh;E067,H3K27ac_Enh;E068,H3K27ac_Enh;E069,H3K27ac_Enh;E072,H3K27ac_Enh;E073,H3K27ac_Enh;E074,H3K27ac_Enh;E075,H3K27ac_Enh;E076,H3K27ac_Enh;E078,H3K27ac_Enh;E084,H3K27ac_Enh;E093,H3K27ac_Enh;E101,H3K27ac_Enh;E102,H3K27ac_Enh;E103,H3K27ac_Enh;E116,H3K27ac_Enh;E124,H3K27ac_Enh;E126,H3K27ac_Enh.GTEx2015_v6,Adipose_Subcutaneous,LRRK2,4.21086496303076e-07;GTEx2015_v6,Artery_Tibial,LRRK2,7.12887180198536e-12;GTEx2015_v6,Cells_Transformed_fibroblasts,LRRK2,1.24729820163706e-05;GTEx2015_v6,Nerve_Tibial,LRRK2,5.97959499940652e-10;GTEx2015_v6,Skin_Not_Sun_Exposed_Suprapubic,LRRK2,1.00796507632068e-05;GTEx2015_v6,Skin_Sun_Exposed_Lower_leg,LRRK2,1.08361107066017e-05;Westra2013,Whole_Blood,-,1.9330946764156724E-31;Westra2013,Whole_Blood,LRRK2,1.807765948958669E-5..Barx1;Barx2;CDP_2;En-1_1;Hoxb6;Irf_known7;Ncx_1;Pou5f1_known2;Sox_18;Sox_3;Sox_9ENSG00000225342.1AC079630.400NM_198578LRRK251609.rs7294619BLD, GI, KIDFAT, BLD, LIV, BRN, GI
rs74324737Nalls23andMe_2019LRRK212406250810.00000000.12460.0141AG0.12160.12165630614177910.03822166218.8368794FALSENANA4141.0000000NANA2TRUE0.5000000040.625081240231279000GA0.090.060.000.1100E029,6_EnhG;E030,6_EnhG;E031,7_Enh;E032,6_EnhG;E080,7_Enh;E124,6_EnhGE029,10_TxEnh5;E030,10_TxEnh5;E031,10_TxEnh5;E032,10_TxEnh5;E124,10_TxEnh5E029,H3K27ac_Enh;E032,H3K27ac_Enh;E046,H3K27ac_Enh;E068,H3K27ac_Enh;E080,H3K27ac_Enh;E124,H3K27ac_Enh;E029,H3K4me1_Enh;E030,H3K4me1_Enh;E031,H3K4me1_Enh;E032,H3K4me1_Enh;E067,H3K4me1_Enh;E073,H3K4me1_Enh;E078,H3K4me1_Enh;E116,H3K4me1_Enh;E124,H3K4me1_Enh;E031,H3K4me3_Pro;E067,H3K4me3_Pro;E116,H3K4me3_Pro;E124,H3K4me3_Pro;E124,H3K9ac_Pro.GTEx2015_v6,Adipose_Subcutaneous,LRRK2,7.71727072375557e-07;GTEx2015_v6,Artery_Tibial,LRRK2,3.79436480774191e-12;GTEx2015_v6,Cells_Transformed_fibroblasts,LRRK2,6.94075809560474e-06;GTEx2015_v6,Nerve_Tibial,LRRK2,8.74398504351068e-10;GTEx2015_v6,Skin_Not_Sun_Exposed_Suprapubic,LRRK2,9.31129758632871e-06;GTEx2015_v6,Skin_Sun_Exposed_Lower_leg,LRRK2,1.18501232307152e-05..E2A_3;E2A_5;Lmo2-complex_1;Mtf1_1;Myf_1;Myf_3;NF-E2_disc3;TCF12_disc1;ZEB1_known3ENSG00000188906.9LRRK200NM_198578LRRK200INTrs74324737BLD, ADRL
rs75143074Nalls23andMe_2019LRRK212406233240.0000000-0.19280.0316AC0.97730.02275630614177910.0382216621-6.1012658FALSENANA00NANA11.0000001FALSE0.2500000040.623321240229522000AC0.000.010.010.0200E029,1_TssA;E030,6_EnhG;E031,2_TssAFlnk;E066,7_Enh;E114,7_Enh;E116,1_TssA;E124,2_TssAFlnkE029,4_PromD2;E030,9_TxReg;E031,9_TxReg;E032,12_TxEnhW;E034,22_PromP;E035,12_TxEnhW;E040,12_TxEnhW;E047,12_TxEnhW;E077,22_PromP;E124,4_PromD2E029,H3K4me1_Enh;E030,H3K4me1_Enh;E031,H3K4me1_Enh;E032,H3K4me1_Enh;E066,H3K4me1_Enh;E067,H3K4me1_Enh;E069,H3K4me1_Enh;E071,H3K4me1_Enh;E073,H3K4me1_Enh;E074,H3K4me1_Enh;E076,H3K4me1_Enh;E078,H3K4me1_Enh;E086,H3K4me1_Enh;E087,H3K4me1_Enh;E101,H3K4me1_Enh;E114,H3K4me1_Enh;E124,H3K4me1_Enh;E029,H3K4me3_Pro;E030,H3K4me3_Pro;E031,H3K4me3_Pro;E035,H3K4me3_Pro;E062,H3K4me3_Pro;E067,H3K4me3_Pro;E068,H3K4me3_Pro;E069,H3K4me3_Pro;E072,H3K4me3_Pro;E073,H3K4me3_Pro;E078,H3K4me3_Pro;E087,H3K4me3_Pro;E103,H3K4me3_Pro;E104,H3K4me3_Pro;E108,H3K4me3_Pro;E114,H3K4me3_Pro;E116,H3K4me3_Pro;E124,H3K4me3_Pro;E032,H3K27ac_Enh;E046,H3K27ac_Enh;E066,H3K27ac_Enh;E067,H3K27ac_Enh;E068,H3K27ac_Enh;E069,H3K27ac_Enh;E072,H3K27ac_Enh;E080,H3K27ac_Enh;E114,H3K27ac_Enh;E124,H3K27ac_Enh;E066,H3K9ac_Pro;E068,H3K9ac_Pro;E076,H3K9ac_Pro;E110,H3K9ac_Pro;E114,H3K9ac_Pro;E124,H3K9ac_Pro....Pou2f2_known2;Zfp691ENSG00000188906.9LRRK200NM_198578LRRK200INTrs75143074BLDBLD, LIV, LNG
rs76904798Nalls23andMe_2019LRRK212406144340.00000000.14390.0130TC0.14440.14445630614177910.038221662111.0692308TRUENANA1111.000000011.0000003TRUE0.7500000040.614431240220632000CT0.110.210.030.1300E029,7_Enh;E030,7_Enh;E124,7_EnhE029,H3K4me1_Enh;E030,H3K4me1_Enh;E031,H3K4me1_Enh;E124,H3K4me1_Enh;E124,H3K27ac_Enh.GTEx2015_v6,Adipose_Subcutaneous,LRRK2,2.6136557196757e-09;GTEx2015_v6,Artery_Coronary,LRRK2,8.10828434519411e-08;GTEx2015_v6,Artery_Tibial,LRRK2,1.29589062525083e-14;GTEx2015_v6,Cells_Transformed_fibroblasts,LRRK2,2.01546552400868e-05;GTEx2015_v6,Esophagus_Muscularis,LRRK2,1.17034509288903e-05;GTEx2015_v6,Nerve_Tibial,LRRK2,1.17833931025132e-15;GTEx2015_v6,Skin_Not_Sun_Exposed_Suprapubic,LRRK2,3.02678179339592e-06;GTEx2015_v6,Skin_Sun_Exposed_Lower_leg,LRRK2,1.21658440247309e-0725064009,Parkinson’s disease,5E-14.Dbx1;Hmx_2;Hoxb8;Hoxd8;Ncx_2;Nkx6-1_3;Pou2f2_known2;Sox_14;Sox_15;Sox_16;Sox_18;Sox_19;Sox_2;Sox_5;Sox_7;Sox_9ENSG00000225342.1AC079630.400NM_198578LRRK254377.rs76904798BLD
rs8087969Nalls23andMe_2019MEX3C18486835890.0000000-0.05780.0102TG0.54960.45044905314110060.0336189620-5.6666667TRUENANA0030.996222611.0000002TRUE0.4990556048.683591851157219000TG0.160.380.250.4400E046,7_EnhE036,H3K4me1_Enh;E046,H3K4me1_Enh;E038,H3K4me3_Pro;E075,H3K27ac_Enh;E098,H3K27ac_Enh;E124,H3K9ac_Pro.GTEx2015_v6,Cells_Transformed_fibroblasts,MEX3C,2.55824097994295e-12;GTEx2015_v6,Thyroid,MEX3C,1.5051282263434e-06;Lappalainen2013,Lymphoblastoid_EUR_exonlevel,ENSG00000176624.8_48700920_48703946,6.5678636014336e-07;Lappalainen2013,Lymphoblastoid_EUR_genelevel,MEX3C,1.80647222987676e-07..CEBPB_known2;CEBPB_known4;RFX5_known1ENSG00000176624.8MEX3C317330NM_016626MEX3C317329.rs8087969BLD
rs8099086Nalls23andMe_2019MEX3C18487173630.00000020.05300.0101TC0.53500.46504905314110060.03361896205.2475248FALSENANA0000.000000011.0000001FALSE0.2500000048.717361851190993000CT0.510.480.420.5300E011,6_EnhG;E014,6_EnhG;E015,6_EnhG;E016,6_EnhG;E019,6_EnhG;E020,6_EnhG;E023,7_Enh;E025,7_Enh;E026,7_Enh;E027,7_Enh;E028,7_Enh;E032,6_EnhG;E033,7_Enh;E035,6_EnhG;E037,7_Enh;E038,7_Enh;E039,7_Enh;E040,2_TssAFlnk;E041,2_TssAFlnk;E042,7_Enh;E043,7_Enh;E044,7_Enh;E045,7_Enh;E046,6_EnhG;E047,7_Enh;E048,7_Enh;E050,7_Enh;E051,7_Enh;E052,7_Enh;E053,7_Enh;E062,7_Enh;E070,7_Enh;E076,7_Enh;E077,7_Enh;E078,7_Enh;E080,7_Enh;E081,7_Enh;E083,7_Enh;E087,7_Enh;E088,7_Enh;E107,7_Enh;E116,2_TssAFlnk;E117,7_Enh;E118,7_EnhE001,12_TxEnhW;E003,12_TxEnhW;E004,12_TxEnhW;E008,12_TxEnhW;E011,12_TxEnhW;E012,12_TxEnhW;E013,12_TxEnhW;E014,12_TxEnhW;E015,12_TxEnhW;E016,12_TxEnhW;E018,12_TxEnhW;E019,12_TxEnhW;E020,12_TxEnhW;E023,12_TxEnhW;E024,12_TxEnhW;E025,12_TxEnhW;E026,12_TxEnhW;E027,12_TxEnhW;E028,12_TxEnhW;E031,12_TxEnhW;E032,10_TxEnh5;E033,10_TxEnh5;E034,10_TxEnh5;E035,12_TxEnhW;E036,12_TxEnhW;E037,9_TxReg;E038,10_TxEnh5;E039,10_TxEnh5;E040,9_TxReg;E041,9_TxReg;E042,10_TxEnh5;E043,10_TxEnh5;E044,10_TxEnh5;E045,10_TxEnh5;E046,10_TxEnh5;E047,10_TxEnh5;E048,10_TxEnh5;E049,12_TxEnhW;E050,10_TxEnh5;E051,10_TxEnh5;E054,12_TxEnhW;E062,10_TxEnh5;E063,12_TxEnhW;E078,12_TxEnhW;E081,12_TxEnhW;E083,12_TxEnhW;E088,12_TxEnhW;E093,10_TxEnh5;E101,12_TxEnhW;E109,12_TxEnhW;E110,12_TxEnhW;E112,12_TxEnhW;E115,12_TxEnhW;E116,10_TxEnh5;E119,12_TxEnhW;E123,12_TxEnhW;E127,12_TxEnhWE001,H3K4me1_Enh;E003,H3K4me1_Enh;E008,H3K4me1_Enh;E009,H3K4me1_Enh;E010,H3K4me1_Enh;E011,H3K4me1_Enh;E012,H3K4me1_Enh;E014,H3K4me1_Enh;E015,H3K4me1_Enh;E016,H3K4me1_Enh;E017,H3K4me1_Enh;E018,H3K4me1_Enh;E019,H3K4me1_Enh;E020,H3K4me1_Enh;E023,H3K4me1_Enh;E024,H3K4me1_Enh;E025,H3K4me1_Enh;E026,H3K4me1_Enh;E027,H3K4me1_Enh;E028,H3K4me1_Enh;E031,H3K4me1_Enh;E032,H3K4me1_Enh;E033,H3K4me1_Enh;E034,H3K4me1_Enh;E035,H3K4me1_Enh;E036,H3K4me1_Enh;E037,H3K4me1_Enh;E038,H3K4me1_Enh;E039,H3K4me1_Enh;E040,H3K4me1_Enh;E041,H3K4me1_Enh;E042,H3K4me1_Enh;E043,H3K4me1_Enh;E044,H3K4me1_Enh;E045,H3K4me1_Enh;E046,H3K4me1_Enh;E047,H3K4me1_Enh;E048,H3K4me1_Enh;E049,H3K4me1_Enh;E050,H3K4me1_Enh;E051,H3K4me1_Enh;E052,H3K4me1_Enh;E053,H3K4me1_Enh;E054,H3K4me1_Enh;E055,H3K4me1_Enh;E056,H3K4me1_Enh;E058,H3K4me1_Enh;E061,H3K4me1_Enh;E062,H3K4me1_Enh;E063,H3K4me1_Enh;E066,H3K4me1_Enh;E067,H3K4me1_Enh;E068,H3K4me1_Enh;E069,H3K4me1_Enh;E070,H3K4me1_Enh;E071,H3K4me1_Enh;E072,H3K4me1_Enh;E073,H3K4me1_Enh;E074,H3K4me1_Enh;E075,H3K4me1_Enh;E076,H3K4me1_Enh;E077,H3K4me1_Enh;E078,H3K4me1_Enh;E080,H3K4me1_Enh;E081,H3K4me1_Enh;E082,H3K4me1_Enh;E083,H3K4me1_Enh;E084,H3K4me1_Enh;E085,H3K4me1_Enh;E086,H3K4me1_Enh;E087,H3K4me1_Enh;E088,H3K4me1_Enh;E092,H3K4me1_Enh;E093,H3K4me1_Enh;E099,H3K4me1_Enh;E101,H3K4me1_Enh;E103,H3K4me1_Enh;E105,H3K4me1_Enh;E106,H3K4me1_Enh;E107,H3K4me1_Enh;E108,H3K4me1_Enh;E109,H3K4me1_Enh;E110,H3K4me1_Enh;E112,H3K4me1_Enh;E113,H3K4me1_Enh;E114,H3K4me1_Enh;E115,H3K4me1_Enh;E116,H3K4me1_Enh;E117,H3K4me1_Enh;E118,H3K4me1_Enh;E119,H3K4me1_Enh;E120,H3K4me1_Enh;E121,H3K4me1_Enh;E122,H3K4me1_Enh;E123,H3K4me1_Enh;E125,H3K4me1_Enh;E127,H3K4me1_Enh;E129,H3K4me1_Enh;E003,H3K4me3_Pro;E011,H3K4me3_Pro;E015,H3K4me3_Pro;E016,H3K4me3_Pro;E019,H3K4me3_Pro;E020,H3K4me3_Pro;E026,H3K4me3_Pro;E037,H3K4me3_Pro;E038,H3K4me3_Pro;E040,H3K4me3_Pro;E041,H3K4me3_Pro;E042,H3K4me3_Pro;E044,H3K4me3_Pro;E045,H3K4me3_Pro;E046,H3K4me3_Pro;E051,H3K4me3_Pro;E053,H3K4me3_Pro;E054,H3K4me3_Pro;E058,H3K4me3_Pro;E062,H3K4me3_Pro;E067,H3K4me3_Pro;E078,H3K4me3_Pro;E083,H3K4me3_Pro;E088,H3K4me3_Pro;E101,H3K4me3_Pro;E103,H3K4me3_Pro;E112,H3K4me3_Pro;E115,H3K4me3_Pro;E116,H3K4me3_Pro;E012,H3K27ac_Enh;E014,H3K27ac_Enh;E020,H3K27ac_Enh;E034,H3K27ac_Enh;E037,H3K27ac_Enh;E038,H3K27ac_Enh;E039,H3K27ac_Enh;E040,H3K27ac_Enh;E041,H3K27ac_Enh;E042,H3K27ac_Enh;E043,H3K27ac_Enh;E044,H3K27ac_Enh;E045,H3K27ac_Enh;E046,H3K27ac_Enh;E048,H3K27ac_Enh;E049,H3K27ac_Enh;E050,H3K27ac_Enh;E058,H3K27ac_Enh;E062,H3K27ac_Enh;E063,H3K27ac_Enh;E076,H3K27ac_Enh;E080,H3K27ac_Enh;E087,H3K27ac_Enh;E093,H3K27ac_Enh;E101,H3K27ac_Enh;E102,H3K27ac_Enh;E103,H3K27ac_Enh;E113,H3K27ac_Enh;E116,H3K27ac_Enh;E117,H3K27ac_Enh;E119,H3K27ac_Enh;E124,H3K27ac_Enh;E127,H3K27ac_Enh;E014,H3K9ac_Pro;E018,H3K9ac_Pro;E019,H3K9ac_Pro;E020,H3K9ac_Pro;E025,H3K9ac_Pro;E052,H3K9ac_Pro;E062,H3K9ac_Pro;E063,H3K9ac_Pro;E067,H3K9ac_Pro;E068,H3K9ac_Pro;E083,H3K9ac_Pro;E086,H3K9ac_Pro;E115,H3K9ac_Pro;E116,H3K9ac_Pro;E119,H3K9ac_ProE034;E046;E127.GTEx2015_v6,Cells_Transformed_fibroblasts,MEX3C,4.58872527039341e-08..Dlx3;Evi-1_4;Lhx4;Mef2_known6;Pou1f1_1;Pou2f2_known2;Pou2f2_known3;Pou6f1_2;Prrx2_1ENSG00000176624.8MEX3C00NM_016626MEX3C00INTrs8099086BLDESDR, ESC, IPSC, FAT, STRM, BRST, BLD, MUS, BRN, GI, ADRL, HRT, PANC, LNG, CRVX, LIV
rs9956987Nalls23andMe_2019MEX3C18487740880.0000000-0.05570.0102TG0.54720.45284905314110060.0336189620-5.4607843FALSENANA0000.000000011.0000001FALSE0.2500000048.774091851247718000GT0.660.660.710.5600E021,H3K27ac_Enh.GTEx2015_v6,Cells_Transformed_fibroblasts,MEX3C,6.69428550606873e-09;GTEx2015_v6,Thyroid,MEX3C,1.96900615796465e-06;Lappalainen2013,Lymphoblastoid_EUR_exonlevel,ENSG00000176624.8_48700920_48703946,1.81243932746836e-05;Lappalainen2013,Lymphoblastoid_EUR_genelevel,MEX3C,4.47533865893179e-06..Pax-6_1;THAP1_disc1;YY1_known5ENSG00000207154.1U1336014NM_016626MEX3C550036.rs9956987
+
+
+
+

+Summary plots

+
+

+Credible Set bin plot

+
+gg_cs_bin <- echoannot::CS_bin_plot(merged_DT = echodata::Nalls2019_merged)
+

## Credible Set counts plot

+
+gg_cs_counts <- echoannot::CS_counts_plot(merged_DT = echodata::Nalls2019_merged)
+
## Warning: Removed 83 rows containing missing values (position_stack).
+
+## Warning: Removed 83 rows containing missing values (position_stack).
+
## Warning: Removed 375 rows containing missing values (position_stack).
+

+
+
+

+Credible Set counts plot

+
+gg_cs_counts <- echoannot::CS_counts_plot(merged_DT = echodata::Nalls2019_merged)
+
## Warning: Removed 83 rows containing missing values (position_stack).
+
+## Warning: Removed 83 rows containing missing values (position_stack).
+
## Warning: Removed 375 rows containing missing values (position_stack).
+

+
+
+

+Epigenomic data

+
+gg_epi <- echoannot::peak_overlap_plot(merged_DT =  echodata::Nalls2019_merged, 
+                                       include.NOTT_2019_enhancers_promoters = TRUE,
+                                       include.NOTT_2019_PLACseq = TRUE,
+                                       #### Omit many annot to save time ####
+                                       include.NOTT_2019_peaks = FALSE,
+                                       include.CORCES_2020_scATACpeaks = FALSE, 
+                                       include.CORCES_2020_Cicero_coaccess = FALSE, 
+                                       include.CORCES_2020_bulkATACpeaks = FALSE, 
+                                       include.CORCES_2020_HiChIP_FitHiChIP_coaccess = FALSE,
+                                       include.CORCES_2020_gene_annotations = FALSE)
+
## Warning: The `.dots` argument of `group_by()` is deprecated as of dplyr 1.0.0.
+## This warning is displayed once every 8 hours.
+## Call `lifecycle::last_warnings()` to see where this warning was generated.
+

+
+
+

+Super summary plot

+

Creates one big merged plot using the subfunctions above.

+
+super_plot <- echoannot::super_summary_plot(merged_DT = echodata::Nalls2019_merged, 
+                                            plot_missense = FALSE)
+
+
+
+

+Session Info

+
+utils::sessionInfo()
+
## R version 4.1.0 (2021-05-18)
+## Platform: x86_64-apple-darwin17.0 (64-bit)
+## Running under: macOS Big Sur 10.16
+## 
+## Matrix products: default
+## BLAS:   /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.dylib
+## LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
+## 
+## locale:
+## [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
+## 
+## attached base packages:
+## [1] stats     graphics  grDevices utils     datasets  methods   base     
+## 
+## other attached packages:
+## [1] echodata_0.99.1  echoannot_0.99.1 BiocStyle_2.20.2
+## 
+## loaded via a namespace (and not attached):
+##   [1] backports_1.2.1             Hmisc_4.5-0                
+##   [3] BiocFileCache_2.0.0         systemfonts_1.0.2          
+##   [5] plyr_1.8.6                  lazyeval_0.2.2             
+##   [7] splines_4.1.0               BiocParallel_1.26.2        
+##   [9] GenomeInfoDb_1.28.4         ggplot2_3.3.5              
+##  [11] digest_0.6.27               ensembldb_2.16.4           
+##  [13] htmltools_0.5.2             fansi_0.5.0                
+##  [15] magrittr_2.0.1              checkmate_2.0.0            
+##  [17] memoise_2.0.0               BSgenome_1.60.0            
+##  [19] cluster_2.1.2               Biostrings_2.60.2          
+##  [21] matrixStats_0.60.1          R.utils_2.10.1             
+##  [23] ggbio_1.40.0                pkgdown_1.6.1              
+##  [25] prettyunits_1.1.1           jpeg_0.1-9                 
+##  [27] colorspace_2.0-2            blob_1.2.2                 
+##  [29] rappdirs_0.3.3              textshaping_0.3.5          
+##  [31] xfun_0.26                   dplyr_1.0.7                
+##  [33] crayon_1.4.1                RCurl_1.98-1.4             
+##  [35] jsonlite_1.7.2              graph_1.70.0               
+##  [37] Exact_3.0                   VariantAnnotation_1.38.0   
+##  [39] survival_3.2-13             glue_1.4.2                 
+##  [41] gtable_0.3.0                zlibbioc_1.38.0            
+##  [43] XVector_0.32.0              DelayedArray_0.18.0        
+##  [45] BiocGenerics_0.38.0         scales_1.1.1               
+##  [47] pheatmap_1.0.12             mvtnorm_1.1-2              
+##  [49] DBI_1.1.1                   GGally_2.1.2               
+##  [51] Rcpp_1.0.7                  viridisLite_0.4.0          
+##  [53] progress_1.2.2              htmlTable_2.2.1            
+##  [55] foreign_0.8-81              bit_4.0.4                  
+##  [57] proxy_0.4-26                OrganismDbi_1.34.0         
+##  [59] Formula_1.2-4               DT_0.19                    
+##  [61] stats4_4.1.0                htmlwidgets_1.5.4          
+##  [63] httr_1.4.2                  RColorBrewer_1.1-2         
+##  [65] ellipsis_0.3.2              haploR_4.0.4               
+##  [67] farver_2.1.0                R.methodsS3_1.8.1          
+##  [69] pkgconfig_2.0.3             reshape_0.8.8              
+##  [71] XML_3.99-0.7                nnet_7.3-16                
+##  [73] sass_0.4.0                  dbplyr_2.1.1               
+##  [75] RJSONIO_1.3-1.5             utf8_1.2.2                 
+##  [77] labeling_0.4.2              tidyselect_1.1.1           
+##  [79] rlang_0.4.11                reshape2_1.4.4             
+##  [81] AnnotationDbi_1.54.1        munsell_0.5.0              
+##  [83] tools_4.1.0                 cachem_1.0.6               
+##  [85] generics_0.1.0              RSQLite_2.2.8              
+##  [87] evaluate_0.14               stringr_1.4.0              
+##  [89] fastmap_1.1.0               yaml_2.2.1                 
+##  [91] ragg_1.1.3                  knitr_1.34                 
+##  [93] bit64_4.0.5                 fs_1.5.0                   
+##  [95] purrr_0.3.4                 KEGGREST_1.32.0            
+##  [97] AnnotationFilter_1.16.0     rootSolve_1.8.2.2          
+##  [99] RBGL_1.68.0                 R.oo_1.24.0                
+## [101] xml2_1.3.2                  biomaRt_2.48.3             
+## [103] compiler_4.1.0              rstudioapi_0.13            
+## [105] filelock_1.0.2              curl_4.3.2                 
+## [107] png_0.1-7                   e1071_1.7-8                
+## [109] tibble_3.1.4                bslib_0.3.0                
+## [111] DescTools_0.99.43           stringi_1.7.4              
+## [113] highr_0.9                   GenomicFeatures_1.44.2     
+## [115] desc_1.3.0                  lattice_0.20-44            
+## [117] ProtGenerics_1.24.0         Matrix_1.3-4               
+## [119] vctrs_0.3.8                 pillar_1.6.2               
+## [121] lifecycle_1.0.0             RUnit_0.4.32               
+## [123] BiocManager_1.30.16         jquerylib_0.1.4            
+## [125] data.table_1.14.0           bitops_1.0-7               
+## [127] lmom_2.8                    patchwork_1.1.1            
+## [129] rtracklayer_1.52.1          GenomicRanges_1.44.0       
+## [131] R6_2.5.1                    BiocIO_1.2.0               
+## [133] latticeExtra_0.6-29         bookdown_0.24              
+## [135] gridExtra_2.3               IRanges_2.26.0             
+## [137] gld_2.6.2                   dichromat_2.0-0            
+## [139] boot_1.3-28                 MASS_7.3-54                
+## [141] assertthat_0.2.1            SummarizedExperiment_1.22.0
+## [143] rprojroot_2.0.2             rjson_0.2.20               
+## [145] GenomicAlignments_1.28.0    Rsamtools_2.8.0            
+## [147] S4Vectors_0.30.0            GenomeInfoDbData_1.2.6     
+## [149] expm_0.999-6                parallel_4.1.0             
+## [151] hms_1.1.0                   grid_4.1.0                 
+## [153] rpart_4.1-15                tidyr_1.1.3                
+## [155] class_7.3-19                rmarkdown_2.11             
+## [157] MatrixGenerics_1.4.3        biovizBase_1.40.0          
+## [159] Biobase_2.52.0              base64enc_0.1-3            
+## [161] restfulr_0.0.13
+
+
+
+ + + +
+ + + + +
+ + + + + + diff --git a/docs/articles/echoannot_files/figure-html/unnamed-chunk-3-1.png b/docs/articles/echoannot_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 0000000..e1080bf Binary files /dev/null and b/docs/articles/echoannot_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/docs/articles/echoannot_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/echoannot_files/figure-html/unnamed-chunk-4-1.png new file mode 100644 index 0000000..28b6b8b Binary files /dev/null and b/docs/articles/echoannot_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/docs/articles/echoannot_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/echoannot_files/figure-html/unnamed-chunk-5-1.png new file mode 100644 index 0000000..28b6b8b Binary files /dev/null and b/docs/articles/echoannot_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/docs/articles/echoannot_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/echoannot_files/figure-html/unnamed-chunk-6-1.png new file mode 100644 index 0000000..f4c7b66 Binary files /dev/null and b/docs/articles/echoannot_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/docs/articles/echoannot_files/header-attrs-2.11/header-attrs.js b/docs/articles/echoannot_files/header-attrs-2.11/header-attrs.js new file mode 100644 index 0000000..dd57d92 --- /dev/null +++ b/docs/articles/echoannot_files/header-attrs-2.11/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/index.html b/docs/articles/index.html new file mode 100644 index 0000000..24bf7fa --- /dev/null +++ b/docs/articles/index.html @@ -0,0 +1,147 @@ + + + + + + + + +Articles • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
+

All vignettes

+

+ +
+
echoannot: Getting Started
+
+
+
+
+
+ + + +
+ + + + + + + + diff --git a/docs/authors.html b/docs/authors.html new file mode 100644 index 0000000..ec4249c --- /dev/null +++ b/docs/authors.html @@ -0,0 +1,155 @@ + + + + + + + + +Authors • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
    +
  • +

    Brian Schilder. Maintainer. +

    +
  • +
  • +

    Jack Humphrey. Author. +

    +
  • +
  • +

    Towfique Raj. Author. +

    +
  • +
+ +
+ +
+ + + + +
+ + + + + + + + diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css new file mode 100644 index 0000000..5a85941 --- /dev/null +++ b/docs/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 28px; + font-weight: 500; +} + +/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ +nav[data-toggle='toc'] .nav > .active > ul { + display: block; +} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js new file mode 100644 index 0000000..1cdd573 --- /dev/null +++ b/docs/bootstrap-toc.js @@ -0,0 +1,159 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function() { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function(el) { + var text = $(el).text(); + var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function(el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function(el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function() { + return $(''); + }, + + createChildNavList: function($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function(anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function(headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + }, + + getNavLevel: function(el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function(i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function(arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + } + }, + + // accepts a jQuery object, or an options object + init: function(opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + } + }; + + $(function() { + $('nav[data-toggle="toc"]').each(function(i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(); diff --git a/docs/docsearch.css b/docs/docsearch.css new file mode 100644 index 0000000..e5f1fe1 --- /dev/null +++ b/docs/docsearch.css @@ -0,0 +1,148 @@ +/* Docsearch -------------------------------------------------------------- */ +/* + Source: https://github.com/algolia/docsearch/ + License: MIT +*/ + +.algolia-autocomplete { + display: block; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1 +} + +.algolia-autocomplete .ds-dropdown-menu { + width: 100%; + min-width: none; + max-width: none; + padding: .75rem 0; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, .1); + box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); +} + +@media (min-width:768px) { + .algolia-autocomplete .ds-dropdown-menu { + width: 175% + } +} + +.algolia-autocomplete .ds-dropdown-menu::before { + display: none +} + +.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { + padding: 0; + background-color: rgb(255,255,255); + border: 0; + max-height: 80vh; +} + +.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { + margin-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion { + padding: 0; + overflow: visible +} + +.algolia-autocomplete .algolia-docsearch-suggestion--category-header { + padding: .125rem 1rem; + margin-top: 0; + font-size: 1.3em; + font-weight: 500; + color: #00008B; + border-bottom: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { + float: none; + padding-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { + float: none; + width: auto; + padding: 0; + text-align: left +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content { + float: none; + width: auto; + padding: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content::before { + display: none +} + +.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { + padding-top: .75rem; + margin-top: .75rem; + border-top: 1px solid rgba(0, 0, 0, .1) +} + +.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { + display: block; + padding: .1rem 1rem; + margin-bottom: 0.1; + font-size: 1.0em; + font-weight: 400 + /* display: none */ +} + +.algolia-autocomplete .algolia-docsearch-suggestion--title { + display: block; + padding: .25rem 1rem; + margin-bottom: 0; + font-size: 0.9em; + font-weight: 400 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--text { + padding: 0 1rem .5rem; + margin-top: -.25rem; + font-size: 0.8em; + font-weight: 400; + line-height: 1.25 +} + +.algolia-autocomplete .algolia-docsearch-footer { + width: 110px; + height: 20px; + z-index: 3; + margin-top: 10.66667px; + float: right; + font-size: 0; + line-height: 0; +} + +.algolia-autocomplete .algolia-docsearch-footer--logo { + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; + overflow: hidden; + text-indent: -9000px; + width: 100%; + height: 100%; + display: block; + transform: translate(-8px); +} + +.algolia-autocomplete .algolia-docsearch-suggestion--highlight { + color: #FF8C00; + background: rgba(232, 189, 54, 0.1) +} + + +.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { + box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) +} + +.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { + background-color: rgba(192, 192, 192, .15) +} diff --git a/docs/docsearch.js b/docs/docsearch.js new file mode 100644 index 0000000..b35504c --- /dev/null +++ b/docs/docsearch.js @@ -0,0 +1,85 @@ +$(function() { + + // register a handler to move the focus to the search bar + // upon pressing shift + "/" (i.e. "?") + $(document).on('keydown', function(e) { + if (e.shiftKey && e.keyCode == 191) { + e.preventDefault(); + $("#search-input").focus(); + } + }); + + $(document).ready(function() { + // do keyword highlighting + /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ + var mark = function() { + + var referrer = document.URL ; + var paramKey = "q" ; + + if (referrer.indexOf("?") !== -1) { + var qs = referrer.substr(referrer.indexOf('?') + 1); + var qs_noanchor = qs.split('#')[0]; + var qsa = qs_noanchor.split('&'); + var keyword = ""; + + for (var i = 0; i < qsa.length; i++) { + var currentParam = qsa[i].split('='); + + if (currentParam.length !== 2) { + continue; + } + + if (currentParam[0] == paramKey) { + keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); + } + } + + if (keyword !== "") { + $(".contents").unmark({ + done: function() { + $(".contents").mark(keyword); + } + }); + } + } + }; + + mark(); + }); +}); + +/* Search term highlighting ------------------------------*/ + +function matchedWords(hit) { + var words = []; + + var hierarchy = hit._highlightResult.hierarchy; + // loop to fetch from lvl0, lvl1, etc. + for (var idx in hierarchy) { + words = words.concat(hierarchy[idx].matchedWords); + } + + var content = hit._highlightResult.content; + if (content) { + words = words.concat(content.matchedWords); + } + + // return unique words + var words_uniq = [...new Set(words)]; + return words_uniq; +} + +function updateHitURL(hit) { + + var words = matchedWords(hit); + var url = ""; + + if (hit.anchor) { + url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; + } else { + url = hit.url + '?q=' + escape(words.join(" ")); + } + + return url; +} diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..74e7136 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,262 @@ + + + + + + + +echoverse module: Annotate fine-mapping results • echoannot + + + + + + + + + + +
    +
    + + + + +
    +
    + + +
    + +
    +

    +Fine-mapping results data

    +

    Provides both built-in fine-mapping results and API access to the echolocatoR Fine-mapping Portal.

    +
    +if(!"remotes" %in% rownames(installed.packages())){install.packages("remotes")}
    +
    +remotes::install_github("RajLabMSSM/echoannot")
    +library(echoannot)
    +
    + +
    +

    +Vignette +

    +
    +
    +
    +

    +Datasets

    +

    For more detailed information about each dataset, use ?:
    R library(echolocatoR) ?NOTT_2019.interactome # example dataset

    +
    +

    +Epigenomic & genome-wide annotations

    +
    +

    +Nott et al. (2019) +

    +
      +
    • Data from this publication contains results from cell type-specific (neurons, oligodendrocytes, astrocytes, microglia, & peripheral myeloid cells) epigenomic assays (H3K27ac, ATAC, H3K4me3) from human brain tissue.

    • +
    • +

      For detailed metadata, see:

      +
      +data("NOTT_2019.bigwig_metadata")
      +
    • +
    • +

      Built-in datasets:

      +
        +
      • Enhancer/promoter coordinates (as GenomicRanges)
      • +
      +
      +data("NOTT_2019.interactome")
      +# Examples of the data nested in "NOTT_2019.interactome" object:
      +NOTT_2019.interactome$`Neuronal promoters`
      +NOTT_2019.interactome$`Neuronal enhancers`
      +NOTT_2019.interactome$`Microglia promoters`
      +NOTT_2019.interactome$`Microglia enhancers`
      +...
      +...
      +
        +
      • PLAC-seq enhancer-promoter interactome coordinates
      • +
      +
      +NOTT_2019.interactome$H3K4me3_around_TSS_annotated_pe
      +NOTT_2019.interactome$`Microglia interactome`
      +NOTT_2019.interactome$`Neuronal interactome`
      +NOTT_2019.interactome$`Oligo interactome`
      +...
      +...
      +
    • +
    • +

      API access to full bigWig files on UCSC Genome Browser, which includes

      +
        +
      • Epigenomic reads (as GenomicRanges)
        +
      • +
      • Aggregate epigenomic score for each cell type - assay combination
      • +
      +
    • +
    +
    +
    +

    +Corces et al. (2020) +

    +
      +
    • +

      Data from this preprint contains results from bulk and single-cell chromatin accessibility epigenomic assays in 39 human brains.

      +
      +data("CORCES_2020.bulkATACseq_peaks")
      +data("CORCES_2020.cicero_coaccessibility")
      +data("CORCES_2020.HiChIP_FitHiChIP_loop_calls")
      +data("CORCES_2020.scATACseq_celltype_peaks")
      +data("CORCES_2020.scATACseq_peaks")
      +
    • +
    +
    +
    +

    +XGR +

    +
      +
    • API access to a diverse library of cell type/line-specific epigenomic (e.g. ENCODE) and other genome-wide annotations.
    • +
    +
    +
    +

    +Roadmap +

    +
      +
    • API access to cell type-specific epigenomic data.
    • +
    +
    +
    +

    +biomaRt +

    +
      +
    • API access to various genome-wide SNP annotations (e.g. missense, nonsynonmous, intronic, enhancer).
    • +
    +
    +
    +

    +HaploR +

    +
      +
    • API access to known per-SNP QTL and epigenomic data hits.
    • +
    +
    +
    +
    + +
    + +
    + + +
    + + +
    + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + diff --git a/docs/link.svg b/docs/link.svg new file mode 100644 index 0000000..88ad827 --- /dev/null +++ b/docs/link.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/docs/pkgdown.css b/docs/pkgdown.css new file mode 100644 index 0000000..1273238 --- /dev/null +++ b/docs/pkgdown.css @@ -0,0 +1,367 @@ +/* Sticky footer */ + +/** + * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ + * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css + * + * .Site -> body > .container + * .Site-content -> body > .container .row + * .footer -> footer + * + * Key idea seems to be to ensure that .container and __all its parents__ + * have height set to 100% + * + */ + +html, body { + height: 100%; +} + +body { + position: relative; +} + +body > .container { + display: flex; + height: 100%; + flex-direction: column; +} + +body > .container .row { + flex: 1 0 auto; +} + +footer { + margin-top: 45px; + padding: 35px 0 36px; + border-top: 1px solid #e5e5e5; + color: #666; + display: flex; + flex-shrink: 0; +} +footer p { + margin-bottom: 0; +} +footer div { + flex: 1; +} +footer .pkgdown { + text-align: right; +} +footer p { + margin-bottom: 0; +} + +img.icon { + float: right; +} + +img { + max-width: 100%; +} + +/* Fix bug in bootstrap (only seen in firefox) */ +summary { + display: list-item; +} + +/* Typographic tweaking ---------------------------------*/ + +.contents .page-header { + margin-top: calc(-60px + 1em); +} + +dd { + margin-left: 3em; +} + +/* Section anchors ---------------------------------*/ + +a.anchor { + margin-left: -30px; + display:inline-block; + width: 30px; + height: 30px; + visibility: hidden; + + background-image: url(./link.svg); + background-repeat: no-repeat; + background-size: 20px 20px; + background-position: center center; +} + +.hasAnchor:hover a.anchor { + visibility: visible; +} + +@media (max-width: 767px) { + .hasAnchor:hover a.anchor { + visibility: hidden; + } +} + + +/* Fixes for fixed navbar --------------------------*/ + +.contents h1, .contents h2, .contents h3, .contents h4 { + padding-top: 60px; + margin-top: -40px; +} + +/* Navbar submenu --------------------------*/ + +.dropdown-submenu { + position: relative; +} + +.dropdown-submenu>.dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover>.dropdown-menu { + display: block; +} + +.dropdown-submenu>a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #cccccc; + margin-top: 5px; + margin-right: -10px; +} + +.dropdown-submenu:hover>a:after { + border-left-color: #ffffff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left>.dropdown-menu { + left: -100%; + margin-left: 10px; + border-radius: 6px 0 6px 6px; +} + +/* Sidebar --------------------------*/ + +#pkgdown-sidebar { + margin-top: 30px; + position: -webkit-sticky; + position: sticky; + top: 70px; +} + +#pkgdown-sidebar h2 { + font-size: 1.5em; + margin-top: 1em; +} + +#pkgdown-sidebar h2:first-child { + margin-top: 0; +} + +#pkgdown-sidebar .list-unstyled li { + margin-bottom: 0.5em; +} + +/* bootstrap-toc tweaks ------------------------------------------------------*/ + +/* All levels of nav */ + +nav[data-toggle='toc'] .nav > li > a { + padding: 4px 20px 4px 6px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; +} + +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 5px; + color: inherit; + border-left: 1px solid #878787; +} + +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 5px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; + border-left: 2px solid #878787; +} + +/* Nav: second level (shown on .active) */ + +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} + +nav[data-toggle='toc'] .nav .nav > li > a { + padding-left: 16px; + font-size: 1.35rem; +} + +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 15px; +} + +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 15px; + font-weight: 500; + font-size: 1.35rem; +} + +/* orcid ------------------------------------------------------------------- */ + +.orcid { + font-size: 16px; + color: #A6CE39; + /* margins are required by official ORCID trademark and display guidelines */ + margin-left:4px; + margin-right:4px; + vertical-align: middle; +} + +/* Reference index & topics ----------------------------------------------- */ + +.ref-index th {font-weight: normal;} + +.ref-index td {vertical-align: top; min-width: 100px} +.ref-index .icon {width: 40px;} +.ref-index .alias {width: 40%;} +.ref-index-icons .alias {width: calc(40% - 40px);} +.ref-index .title {width: 60%;} + +.ref-arguments th {text-align: right; padding-right: 10px;} +.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} +.ref-arguments .name {width: 20%;} +.ref-arguments .desc {width: 80%;} + +/* Nice scrolling for wide elements --------------------------------------- */ + +table { + display: block; + overflow: auto; +} + +/* Syntax highlighting ---------------------------------------------------- */ + +pre { + word-wrap: normal; + word-break: normal; + border: 1px solid #eee; +} + +pre, code { + background-color: #f8f8f8; + color: #333; +} + +pre code { + overflow: auto; + word-wrap: normal; + white-space: pre; +} + +pre .img { + margin: 5px 0; +} + +pre .img img { + background-color: #fff; + display: block; + height: auto; +} + +code a, pre a { + color: #375f84; +} + +a.sourceLine:hover { + text-decoration: none; +} + +.fl {color: #1514b5;} +.fu {color: #000000;} /* function */ +.ch,.st {color: #036a07;} /* string */ +.kw {color: #264D66;} /* keyword */ +.co {color: #888888;} /* comment */ + +.message { color: black; font-weight: bolder;} +.error { color: orange; font-weight: bolder;} +.warning { color: #6A0366; font-weight: bolder;} + +/* Clipboard --------------------------*/ + +.hasCopyButton { + position: relative; +} + +.btn-copy-ex { + position: absolute; + right: 0; + top: 0; + visibility: hidden; +} + +.hasCopyButton:hover button.btn-copy-ex { + visibility: visible; +} + +/* headroom.js ------------------------ */ + +.headroom { + will-change: transform; + transition: transform 200ms linear; +} +.headroom--pinned { + transform: translateY(0%); +} +.headroom--unpinned { + transform: translateY(-100%); +} + +/* mark.js ----------------------------*/ + +mark { + background-color: rgba(255, 255, 51, 0.5); + border-bottom: 2px solid rgba(255, 153, 51, 0.3); + padding: 1px; +} + +/* vertical spacing after htmlwidgets */ +.html-widget { + margin-bottom: 10px; +} + +/* fontawesome ------------------------ */ + +.fab { + font-family: "Font Awesome 5 Brands" !important; +} + +/* don't display links in code chunks when printing */ +/* source: https://stackoverflow.com/a/10781533 */ +@media print { + code a:link:after, code a:visited:after { + content: ""; + } +} diff --git a/docs/pkgdown.js b/docs/pkgdown.js new file mode 100644 index 0000000..7e7048f --- /dev/null +++ b/docs/pkgdown.js @@ -0,0 +1,108 @@ +/* http://gregfranko.com/blog/jquery-best-practices/ */ +(function($) { + $(function() { + + $('.navbar-fixed-top').headroom(); + + $('body').css('padding-top', $('.navbar').height() + 10); + $(window).resize(function(){ + $('body').css('padding-top', $('.navbar').height() + 10); + }); + + $('[data-toggle="tooltip"]').tooltip(); + + var cur_path = paths(location.pathname); + var links = $("#navbar ul li a"); + var max_length = -1; + var pos = -1; + for (var i = 0; i < links.length; i++) { + if (links[i].getAttribute("href") === "#") + continue; + // Ignore external links + if (links[i].host !== location.host) + continue; + + var nav_path = paths(links[i].pathname); + + var length = prefix_length(nav_path, cur_path); + if (length > max_length) { + max_length = length; + pos = i; + } + } + + // Add class to parent
  • , and enclosing
  • if in dropdown + if (pos >= 0) { + var menu_anchor = $(links[pos]); + menu_anchor.parent().addClass("active"); + menu_anchor.closest("li.dropdown").addClass("active"); + } + }); + + function paths(pathname) { + var pieces = pathname.split("/"); + pieces.shift(); // always starts with / + + var end = pieces[pieces.length - 1]; + if (end === "index.html" || end === "") + pieces.pop(); + return(pieces); + } + + // Returns -1 if not found + function prefix_length(needle, haystack) { + if (needle.length > haystack.length) + return(-1); + + // Special case for length-0 haystack, since for loop won't run + if (haystack.length === 0) { + return(needle.length === 0 ? 0 : -1); + } + + for (var i = 0; i < haystack.length; i++) { + if (needle[i] != haystack[i]) + return(i); + } + + return(haystack.length); + } + + /* Clipboard --------------------------*/ + + function changeTooltipMessage(element, msg) { + var tooltipOriginalTitle=element.getAttribute('data-original-title'); + element.setAttribute('data-original-title', msg); + $(element).tooltip('show'); + element.setAttribute('data-original-title', tooltipOriginalTitle); + } + + if(ClipboardJS.isSupported()) { + $(document).ready(function() { + var copyButton = ""; + + $(".examples, div.sourceCode").addClass("hasCopyButton"); + + // Insert copy buttons: + $(copyButton).prependTo(".hasCopyButton"); + + // Initialize tooltips: + $('.btn-copy-ex').tooltip({container: 'body'}); + + // Initialize clipboard: + var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { + text: function(trigger) { + return trigger.parentNode.textContent; + } + }); + + clipboardBtnCopies.on('success', function(e) { + changeTooltipMessage(e.trigger, 'Copied!'); + e.clearSelection(); + }); + + clipboardBtnCopies.on('error', function() { + changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); + }); + }); + } +})(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml new file mode 100644 index 0000000..e3ae3ea --- /dev/null +++ b/docs/pkgdown.yml @@ -0,0 +1,7 @@ +pandoc: 2.11.4 +pkgdown: 1.6.1 +pkgdown_sha: ~ +articles: + echoannot: echoannot.html +last_built: 2021-09-18T21:24Z + diff --git a/docs/reference/CORCES_2020.HiChIP_FitHiChIP_loop_calls.html b/docs/reference/CORCES_2020.HiChIP_FitHiChIP_loop_calls.html new file mode 100644 index 0000000..af7ddca --- /dev/null +++ b/docs/reference/CORCES_2020.HiChIP_FitHiChIP_loop_calls.html @@ -0,0 +1,213 @@ + + + + + + + + +FitHiChIP loop calls from human brain tissue — CORCES_2020.HiChIP_FitHiChIP_loop_calls • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    FitHiChIP loop calls that overlap SNPs derived from analysis + of H3K27ac HiChIP data. +Each row represents an individual peak identified from the feature +binarization analysis (see methods).

    +
    + +
    CORCES_2020.HiChIP_FitHiChIP_loop_calls
    + + +

    Format

    + +

    An object of class data.table (inherits from data.frame) with 11542 rows and 11 columns.

    +

    Source

    + +

    https://doi.org/10.1038/s41588-020-00721-x

    +

    Details

    + +

    Data originally from +Corces et al. (bioRxiv), as of May 2020. +Specifically: STable10_Coacessibility_Peak_loop_connection, +HiChIP FitHiChIP Loop Calls sheet.

    +

    Column dictionary

    +
    hg38_Chromosome_Anchor1

    The hg38 chromosome of the first loop Anchor.

    +
    hg38_Start_Anchor1

    The hg38 start position of the first loop Anchor.

    +
    hg38_Stop_Anchor1

    The hg38 stop position of the first loop Anchor.

    +
    Width_Anchor1

    The width of the first loop Anchor.

    +
    hg38_Chromosome_Anchor2

    The hg38 chromosome of the second loop Anchor.

    +
    hg38_Start_Anchor2

    The hg38 start position of the second loop Anchor.

    +
    hg38_Stop_Anchor2

    The hg38 stop position of the second loop Anchor.

    +
    Width_Anchor2

    The width of the second loop Anchor.

    +
    Score

    The -log10(q-value) of the loop call from FitHiChIP.

    +
    Anchor1_hasSNP

    A boolean variable determining whether the first +anchor overlaps a SNP from our AD/PD GWAS analyses.

    +
    Anchor2_hasSNP

    A boolean variable determining whether the second +anchor overlaps a SNP from our AD/PD GWAS analyses.

    + +
    + +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +dat <- readxl::read_excel( + file.path( + "~/Desktop/Fine_Mapping/echolocatoR/annotations", + "Coceres_2020/STable10_Coacessibility_Peak_loop_connection.xlsx" + ), + skip = 19, sheet = 1 +) +CORCES_2020.HiChIP_FitHiChIP_loop_calls <- data.table::data.table(dat) +usethis::use_data(CORCES_2020.HiChIP_FitHiChIP_loop_calls) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/CORCES_2020.bulkATACseq_peaks.html b/docs/reference/CORCES_2020.bulkATACseq_peaks.html new file mode 100644 index 0000000..5da95da --- /dev/null +++ b/docs/reference/CORCES_2020.bulkATACseq_peaks.html @@ -0,0 +1,190 @@ + + + + + + + + +bulkATACseq peaks from human brain tissue — CORCES_2020.bulkATACseq_peaks • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Each row represents an individual peak identified in the bulk ATAC-seq data.

    +
    + +
    CORCES_2020.bulkATACseq_peaks
    + + +

    Format

    + +

    An object of class data.table (inherits from data.frame) with 186559 rows and 10 columns.

    +

    Source

    + +

    https://doi.org/10.1038/s41588-020-00721-x

    +

    Details

    + +

    Data originally from +Corces et al. (bioRxiv), as of May 2020. +Specifically: STable2_Features_bulkATAC-seq_Peaks

    +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +dat <- readxl::read_excel( + file.path( + "~/Desktop/Fine_Mapping/echolocatoR", + "annotations/Coceres_2020", + "STable2_Features_bulkATAC-seq_Peaks.xlsx" + ), + skip = 18 +) +CORCES_2020.bulkATACseq_peaks <- data.table::data.table(dat) +usethis::use_data(CORCES_2020.bulkATACseq_peaks, overwrite = TRUE) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/CORCES_2020.cicero_coaccessibility.html b/docs/reference/CORCES_2020.cicero_coaccessibility.html new file mode 100644 index 0000000..6b95d60 --- /dev/null +++ b/docs/reference/CORCES_2020.cicero_coaccessibility.html @@ -0,0 +1,218 @@ + + + + + + + + +Cicero_coaccessibility from human brain tissue — CORCES_2020.cicero_coaccessibility • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Cicero coaccessibility analysis for peaks that overlap SNPs derived +from analysis of scATAC-seq data. +Each row represents an individual peak identified from the feature +binarization analysis (see methods).

    +
    + +
    CORCES_2020.cicero_coaccessibility
    + + +

    Format

    + +

    An object of class data.table (inherits from data.frame) with 9795 rows and 14 columns.

    +

    Source

    + +

    https://doi.org/10.1038/s41588-020-00721-x

    +

    Details

    + +

    Data originally from +Corces et al. (bioRxiv), as of May 2020. +Specifically: STable10_Coacessibility_Peak_loop_connection, +Cicero Coaccessibility sheet. +Peak_ID_Peak1 - A unique number that identifies the peak across +supplementary tables.

    +

    Column dictionary:

    +
    hg38_Chromosome_Peak1

    The hg38 chromosome of the first loop Peak.

    +
    hg38_Start_Peak1

    The hg38 start position of the first loop Peak.

    +
    hg38_Stop_Peak1

    The hg38 stop position of the first loop Peak.

    +
    Width_Peak1

    The width of the first loop Peak.

    +
    Peak_ID_Peak2

    A unique number that identifies the peak +across supplementary tables.

    +
    hg38_Chromosome_Peak2

    The hg38 chromosome of the second loop Peak.

    +
    hg38_Start_Peak2

    The hg38 start position of the second loop Peak.

    +
    hg38_Stop_Peak2

    The hg38 stop position of the second loop Peak.

    +
    Width_Peak2

    The width of the second loop Peak.

    +
    Coaccessibility

    The coaccessibility correlation +for the given peak pair.

    +
    Peak1_hasSNP

    A boolean variable determining whether +the first peak overlaps a SNP from our AD/PD GWAS analyses.

    +
    Peak2_hasSNP

    A boolean variable determining whether +the second peak overlaps a SNP from our AD/PD GWAS analyses.

    + +
    + +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +dat <- readxl::read_excel( + file.path( + "~/Desktop/Fine_Mapping/echolocatoR/annotations", + "Coceres_2020/STable10_Coacessibility_Peak_loop_connection.xlsx" + ), + skip = 21, sheet = 2 +) +CORCES_2020.cicero_coaccessibility <- data.table::data.table(dat) +usethis::use_data(CORCES_2020.cicero_coaccessibility) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/CORCES_2020.get_ATAC_peak_overlap.html b/docs/reference/CORCES_2020.get_ATAC_peak_overlap.html new file mode 100644 index 0000000..bbe7a77 --- /dev/null +++ b/docs/reference/CORCES_2020.get_ATAC_peak_overlap.html @@ -0,0 +1,176 @@ + + + + + + + + +Get overlap between datatable of SNPs and scATAC peaks — CORCES_2020.get_ATAC_peak_overlap • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Can optionally add Cicero coaccessibility scores, +which are also derived from scATAC-seq data.

    +
    + +
    CORCES_2020.get_ATAC_peak_overlap(
    +  finemap_dat,
    +  FDR_filter = NULL,
    +  add_cicero = TRUE,
    +  cell_type_specific = TRUE,
    +  verbose = TRUE
    +)
    + + +

    Source

    + +

    https://doi.org/10.1038/s41588-020-00721-x

    +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/CORCES_2020.get_HiChIP_FitHiChIP_overlap.html b/docs/reference/CORCES_2020.get_HiChIP_FitHiChIP_overlap.html new file mode 100644 index 0000000..f39f615 --- /dev/null +++ b/docs/reference/CORCES_2020.get_HiChIP_FitHiChIP_overlap.html @@ -0,0 +1,187 @@ + + + + + + + + +Get overlap between data table of SNPs and HiChIP_FitHiChIP +coaccessibility anchors — CORCES_2020.get_HiChIP_FitHiChIP_overlap • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Anchors are the genomic regions that have evidence of being +functionally connected to one another (coaccessible), + e.g. enhancer-promoter interactions.

    +
    + +
    CORCES_2020.get_HiChIP_FitHiChIP_overlap(finemap_dat, verbose = TRUE)
    + +

    Arguments

    + + + + + + + + + + +
    finemap_dat

    Fine-mapping results.

    verbose

    Print messages.

    + +

    Source

    + +

    https://doi.org/10.1038/s41588-020-00721-x

    +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/CORCES_2020.prepare_bulkATAC_peak_overlap.html b/docs/reference/CORCES_2020.prepare_bulkATAC_peak_overlap.html new file mode 100644 index 0000000..0a94295 --- /dev/null +++ b/docs/reference/CORCES_2020.prepare_bulkATAC_peak_overlap.html @@ -0,0 +1,186 @@ + + + + + + + + +Prepare data to plot overlap between datatable of SNPs and +cell-type-specific epigenomic peaks and coaccessibility data. — CORCES_2020.prepare_bulkATAC_peak_overlap • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Prepare data to plot overlap between datatable of SNPs and +cell-type-specific epigenomic peaks and coaccessibility data.

    +
    + +
    CORCES_2020.prepare_bulkATAC_peak_overlap(
    +  merged_DT,
    +  FDR_filter = NULL,
    +  snp_filter = "Consensus_SNP==TRUE",
    +  add_HiChIP_FitHiChIP = TRUE,
    +  annotate_genes = FALSE,
    +  return_counts = TRUE,
    +  verbose = TRUE
    +)
    + + +

    Source

    + +

    https://doi.org/10.1038/s41588-020-00721-x

    +

    See also

    + + + +

    Examples

    +
    dat_melt <- CORCES_2020.prepare_bulkATAC_peak_overlap( + merged_DT = echodata::Nalls2019_merged +) +
    #> Error in CORCES_2020.prepare_bulkATAC_peak_overlap(merged_DT = echodata::Nalls2019_merged): could not find function "CORCES_2020.prepare_bulkATAC_peak_overlap"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/CORCES_2020.prepare_scATAC_peak_overlap.html b/docs/reference/CORCES_2020.prepare_scATAC_peak_overlap.html new file mode 100644 index 0000000..3d20feb --- /dev/null +++ b/docs/reference/CORCES_2020.prepare_scATAC_peak_overlap.html @@ -0,0 +1,188 @@ + + + + + + + + +Prepare data to plot overlap between datatable of SNPs and +cell-type-specific epigenomic peaks and coaccessibility data. — CORCES_2020.prepare_scATAC_peak_overlap • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Prepare data to plot overlap between datatable of SNPs and +cell-type-specific epigenomic peaks and coaccessibility data.

    +
    + +
    CORCES_2020.prepare_scATAC_peak_overlap(
    +  merged_DT,
    +  FDR_filter = NULL,
    +  snp_filter = "Consensus_SNP==TRUE",
    +  add_cicero = TRUE,
    +  annotate_genes = TRUE,
    +  return_counts = TRUE,
    +  verbose = TRUE
    +)
    + + +

    Source

    + +

    https://doi.org/10.1038/s41588-020-00721-x

    +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +dat_melt <- CORCES_2020.prepare_scATAC_peak_overlap( + merged_DT = echodata::Nalls2019_merged +) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/CORCES_2020.scATACseq_celltype_peaks.html b/docs/reference/CORCES_2020.scATACseq_celltype_peaks.html new file mode 100644 index 0000000..b5c72d7 --- /dev/null +++ b/docs/reference/CORCES_2020.scATACseq_celltype_peaks.html @@ -0,0 +1,191 @@ + + + + + + + + +scATACseq cell type-specific peaks from human brain tissue — CORCES_2020.scATACseq_celltype_peaks • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Each row represents an individual peak identified from the feature + binarization analysis (see methods).

    +
    + +
    CORCES_2020.scATACseq_celltype_peaks
    + + +

    Format

    + +

    An object of class data.table (inherits from data.frame) with 221062 rows and 13 columns.

    +

    Source

    + +

    https://doi.org/10.1038/s41588-020-00721-x

    +

    Details

    + +

    Data originally from +Corces et al. (bioRxiv), as of May 2020. +Specifically: STable6_Features_scATAC-seq_celltype_Peaks

    +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +dat <- readxl::read_excel( + file.path( + "~/Desktop/Fine_Mapping/echolocatoR/annotations", + "Coceres_2020/STable6_Features_scATAC-seq_celltype_Peaks.xlsx" + ), + skip = 15 +) +CORCES_2020.scATACseq_celltype_peaks <- data.table::data.table(dat) +usethis::use_data(CORCES_2020.scATACseq_celltype_peaks, overwrite = TRUE) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/CORCES_2020.scATACseq_peaks.html b/docs/reference/CORCES_2020.scATACseq_peaks.html new file mode 100644 index 0000000..ba7011e --- /dev/null +++ b/docs/reference/CORCES_2020.scATACseq_peaks.html @@ -0,0 +1,191 @@ + + + + + + + + +scATACseq peaks from human brain tissue — CORCES_2020.scATACseq_peaks • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Each row represents an individual peak identified in +the single-cell ATAC-seq data.

    +
    + +
    CORCES_2020.scATACseq_peaks
    + + +

    Format

    + +

    An object of class data.table (inherits from data.frame) with 359022 rows and 10 columns.

    +

    Source

    + +

    https://doi.org/10.1038/s41588-020-00721-x

    +

    Details

    + +

    Data originally from +Corces et al. (bioRxiv), as of May 2020. +Specifically: STable5_Features_scATAC-seq_Peaks_all

    +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +dat <- readxl::read_excel( + file.path( + "~/Desktop/Fine_Mapping/echolocatoR/annotations", + "Coceres_2020/STable5_Features_scATAC-seq_Peaks_all.xlsx" + ), + skip = 18 +) +CORCES_2020.scATACseq_peaks <- data.table::data.table(dat) +usethis::use_data(CORCES_2020.scATACseq_peaks, overwrite = TRUE) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/CS_bin_plot-1.png b/docs/reference/CS_bin_plot-1.png new file mode 100644 index 0000000..7b6466d Binary files /dev/null and b/docs/reference/CS_bin_plot-1.png differ diff --git a/docs/reference/CS_bin_plot.html b/docs/reference/CS_bin_plot.html new file mode 100644 index 0000000..e2edcb8 --- /dev/null +++ b/docs/reference/CS_bin_plot.html @@ -0,0 +1,168 @@ + + + + + + + + +Plot CS bin counts — CS_bin_plot • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Plot CS bin counts

    +
    + +
    CS_bin_plot(merged_DT, show_plot = TRUE)
    + + +

    See also

    + + + +

    Examples

    +
    bin_plot <- CS_bin_plot(merged_DT = echodata::Nalls2019_merged) +
    #> Error in loadNamespace(x): there is no package called 'gggplot2'
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/CS_counts_plot-1.png b/docs/reference/CS_counts_plot-1.png new file mode 100644 index 0000000..e97bf43 Binary files /dev/null and b/docs/reference/CS_counts_plot-1.png differ diff --git a/docs/reference/CS_counts_plot.html b/docs/reference/CS_counts_plot.html new file mode 100644 index 0000000..3e67f7b --- /dev/null +++ b/docs/reference/CS_counts_plot.html @@ -0,0 +1,176 @@ + + + + + + + + +Bar plot of tool-specific CS sizes — CS_counts_plot • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Loci ordered by UCS size (smallest to largest).

    +
    + +
    CS_counts_plot(
    +  merged_DT,
    +  show_numbers = TRUE,
    +  ylabel = "Locus",
    +  legend_nrow = 3,
    +  label_yaxis = TRUE,
    +  top_CS_only = FALSE,
    +  show_plot = TRUE
    +)
    + + +

    See also

    + + + +

    Examples

    +
    gg_CS <- CS_counts_plot(merged_DT = echodata::Nalls2019_merged) +
    #> Warning: Removed 83 rows containing missing values (position_stack).
    #> Warning: Removed 83 rows containing missing values (position_stack).
    #> Warning: Removed 375 rows containing missing values (position_stack).
    #> Found more than one class "simpleUnit" in cache; using the first, from namespace 'hexbin'
    #> Also defined by 'ggbio'
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/GR.name_filter_convert.html b/docs/reference/GR.name_filter_convert.html new file mode 100644 index 0000000..5ee9dc2 --- /dev/null +++ b/docs/reference/GR.name_filter_convert.html @@ -0,0 +1,158 @@ + + + + + + + + +GR.name_filter_convert — GR.name_filter_convert • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    GR.name_filter_convert

    +
    + +
    GR.name_filter_convert(GR.final, GR.names, min_hits = 1)
    + + +

    See also

    + +

    Other plot: +PLOT.get_window_limits()

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/NOTT_2019.bigwig_metadata.html b/docs/reference/NOTT_2019.bigwig_metadata.html new file mode 100644 index 0000000..5e3afd5 --- /dev/null +++ b/docs/reference/NOTT_2019.bigwig_metadata.html @@ -0,0 +1,193 @@ + + + + + + + + +Metadata and links to data — NOTT_2019.bigwig_metadata • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Metadata for cell type-specific epigenomic bigWig files hosted + on UCSC Genome Browser. +bigWig files contain the genomic ranges from each epigenomic assay, +as well as a Score column which describes the peaks of the aggregate reads.

    +
    + +
    NOTT_2019.bigwig_metadata
    + + +

    Format

    + +

    An object of class data.table (inherits from data.frame) with 18 rows and 14 columns.

    +

    Source

    + +

    https://science.sciencemag.org/content/366/6469/1134

    +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +NOTT_2019.bigwig_metadata <- data.table::data.table( + readxl::read_excel( + file.path( + "~/Desktop/Fine_Mapping/echolocatoR/annotations", + "Nott_2019/Nott_2019.snEpigenomics.xlsx" + ) + ) +) +usethis::use_data(NOTT_2019.bigwig_metadata, overwrite = TRUE) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/NOTT_2019.epigenomic_histograms.html b/docs/reference/NOTT_2019.epigenomic_histograms.html new file mode 100644 index 0000000..6bc8af6 --- /dev/null +++ b/docs/reference/NOTT_2019.epigenomic_histograms.html @@ -0,0 +1,202 @@ + + + + + + + + +Plot brain cell-specific epigenomic data — NOTT_2019.epigenomic_histograms • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Brain cell-specific epigenomic data from Nott et al. (2019).

    +
    + +
    NOTT_2019.epigenomic_histograms(
    +  finemap_dat,
    +  locus_dir,
    +  show_plot = TRUE,
    +  save_plot = TRUE,
    +  full_data = TRUE,
    +  return_assay_track = FALSE,
    +  binwidth = 200,
    +  density_adjust = 0.2,
    +  plot.zoom = "1x",
    +  strip.text.y.angle = 90,
    +  xtext = TRUE,
    +  geom = "density",
    +  plot_formula = "Cell_type ~.",
    +  fill_var = "Assay",
    +  bigwig_dir = NULL,
    +  genomic_units = "Mb",
    +  as_ggplot = TRUE,
    +  nThread = 1,
    +  save_annot = FALSE,
    +  verbose = TRUE
    +)
    + + +

    Source

    + +

    Nott et al. (2019) +https://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&lastVirtModeType=default&lastVirtModeExtraState=&virtModeType=default&virtMode=0&nonVirtPosition=&position=chr2:127770344-127983251&hgsid=778249165_ySowqECRKNxURRn6bafH0yewAiuf

    +

    See also

    + + + +

    Examples

    +
    track.Nott_histo <- NOTT_2019.epigenomic_histograms( + finemap_dat = echodata::BST1, + locus_dir = echodata::locus_dir, + save_plot = FALSE, + return_assay_track = TRUE, + save_annot = FALSE +) +
    #> Error in NOTT_2019.epigenomic_histograms(finemap_dat = echodata::BST1, locus_dir = echodata::locus_dir, save_plot = FALSE, return_assay_track = TRUE, save_annot = FALSE): could not find function "NOTT_2019.epigenomic_histograms"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/NOTT_2019.get_epigenomic_peaks.html b/docs/reference/NOTT_2019.get_epigenomic_peaks.html new file mode 100644 index 0000000..f6d10f1 --- /dev/null +++ b/docs/reference/NOTT_2019.get_epigenomic_peaks.html @@ -0,0 +1,183 @@ + + + + + + + + +Download cell type-specific epigenomic peaks — NOTT_2019.get_epigenomic_peaks • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    API access to brain cell type-specific epigenomic peaks (bed format) +from Nott et al. (2019).

    +
    + +
    NOTT_2019.get_epigenomic_peaks(
    +  assays = c("ATAC", "H3K27ac", "H3K4me3"),
    +  cell_types = c("neurons", "microglia", "oligo", "astrocytes"),
    +  convert_to_GRanges = TRUE,
    +  nThread = 1,
    +  verbose = TRUE
    +)
    + + +

    Source

    + +

    Nott et al. (2019) +https://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&lastVirtModeType=default&lastVirtModeExtraState=&virtModeType=default&virtMode=0&nonVirtPosition=&position=chr2:127770344-127983251&hgsid=778249165_ySowqECRKNxURRn6bafH0yewAiuf

    +

    See also

    + + + +

    Examples

    +
    PEAKS <- NOTT_2019.get_epigenomic_peaks(nThread = 1) +
    #> Error in NOTT_2019.get_epigenomic_peaks(nThread = 1): could not find function "NOTT_2019.get_epigenomic_peaks"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/NOTT_2019.get_interactions.html b/docs/reference/NOTT_2019.get_interactions.html new file mode 100644 index 0000000..01c54c8 --- /dev/null +++ b/docs/reference/NOTT_2019.get_interactions.html @@ -0,0 +1,172 @@ + + + + + + + + +Import cell type-specific interactomes — NOTT_2019.get_interactions • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + + + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/NOTT_2019.get_interactome.html b/docs/reference/NOTT_2019.get_interactome.html new file mode 100644 index 0000000..bd48588 --- /dev/null +++ b/docs/reference/NOTT_2019.get_interactome.html @@ -0,0 +1,177 @@ + + + + + + + + +Import cell type-specific interactomes — NOTT_2019.get_interactome • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + + + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/NOTT_2019.get_promoter_celltypes.html b/docs/reference/NOTT_2019.get_promoter_celltypes.html new file mode 100644 index 0000000..f6eb4b6 --- /dev/null +++ b/docs/reference/NOTT_2019.get_promoter_celltypes.html @@ -0,0 +1,168 @@ + + + + + + + + +Get promoter cell types — NOTT_2019.get_promoter_celltypes • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Brain cell-specific epigenomic data from Nott et al. (2019).

    +
    + +
    NOTT_2019.get_promoter_celltypes(annot_sub, marker_key)
    + + +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/NOTT_2019.get_promoter_interactome_data.html b/docs/reference/NOTT_2019.get_promoter_interactome_data.html new file mode 100644 index 0000000..fcc4eff --- /dev/null +++ b/docs/reference/NOTT_2019.get_promoter_interactome_data.html @@ -0,0 +1,172 @@ + + + + + + + + +Get cell type-specific promoter/emhancer/interactome data — NOTT_2019.get_promoter_interactome_data • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + + + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/NOTT_2019.get_regulatory_regions.html b/docs/reference/NOTT_2019.get_regulatory_regions.html new file mode 100644 index 0000000..f7cc1e4 --- /dev/null +++ b/docs/reference/NOTT_2019.get_regulatory_regions.html @@ -0,0 +1,176 @@ + + + + + + + + +Plot brain cell-specific epigenomic data — NOTT_2019.get_regulatory_regions • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + + + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/NOTT_2019.interactome.html b/docs/reference/NOTT_2019.interactome.html new file mode 100644 index 0000000..af4e2d2 --- /dev/null +++ b/docs/reference/NOTT_2019.interactome.html @@ -0,0 +1,206 @@ + + + + + + + + +Brain cell type-specific enhancers, promoters, and interactomes — NOTT_2019.interactome • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Originally from +Nott et al. (2019). +Specifically: aay0793-Nott-Table-S5.xlsx.

    +
    + +
    NOTT_2019.interactome
    + + +

    Format

    + +

    An object of class list of length 12.

    +

    Source

    + +

    https://science.sciencemag.org/content/366/6469/1134

    +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +file <- file.path( + "~/Desktop/Fine_Mapping/echolocatoR/annotations", + "Nott_2019/aay0793-Nott-Table-S5.xlsx" +) +sheets <- readxl::excel_sheets(file) +enh_prom_sheets <- grep("enhancers|promoters", sheets, value = TRUE) +other_sheets <- grep("enhancers|promoters", sheets, + value = TRUE, + invert = TRUE +) +NOTT_2019.interactome <- lapply(other_sheets, function(s) { + readxl::read_excel(file, sheet = s, skip = 2) +}) +NOTT_2019.interactome <- append( + NOTT_2019.interactome, + lapply(enh_prom_sheets, function(s) { + readxl::read_excel(file, + sheet = s, skip = 2, + col_names = c("chr", "start", "end") + ) + }) +) +names(NOTT_2019.interactome) <- c(other_sheets, enh_prom_sheets) +usethis::use_data(NOTT_2019.interactome, overwrite = TRUE) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/NOTT_2019.plac_seq_plot.html b/docs/reference/NOTT_2019.plac_seq_plot.html new file mode 100644 index 0000000..804057b --- /dev/null +++ b/docs/reference/NOTT_2019.plac_seq_plot.html @@ -0,0 +1,208 @@ + + + + + + + + +Plot brain cell-specific interactome data — NOTT_2019.plac_seq_plot • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Plot brain cell-specific interactome data

    +
    + +
    NOTT_2019.plac_seq_plot(
    +  finemap_dat = NULL,
    +  locus_dir = NULL,
    +  title = NULL,
    +  print_plot = TRUE,
    +  save_plot = TRUE,
    +  return_interaction_track = FALSE,
    +  xlims = NULL,
    +  zoom_window = NULL,
    +  index_SNP = NULL,
    +  genomic_units = "Mb",
    +  color_dict = c(enhancers = "springgreen2", promoters = "purple", anchors = "black"),
    +  return_consensus_overlap = TRUE,
    +  show_arches = TRUE,
    +  highlight_plac = FALSE,
    +  show_regulatory_rects = TRUE,
    +  show_anchors = TRUE,
    +  strip.text.y.angle = 0,
    +  xtext = TRUE,
    +  save_annot = FALSE,
    +  point_size = 2,
    +  height = 7,
    +  width = 7,
    +  dpi = 300,
    +  as_ggplot = TRUE,
    +  nThread = 1,
    +  verbose = TRUE
    +)
    + + +

    Source

    + +

    Nott et al. (2019) +https://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&lastVirtModeType=default&lastVirtModeExtraState=&virtModeType=default&virtMode=0&nonVirtPosition=&position=chr2:127770344-127983251&hgsid=778249165_ySowqECRKNxURRn6bafH0yewAiuf

    +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +data("BST1") +data("locus_dir") +trks_plus_lines <- NOTT_2019.plac_seq_plot(finemap_dat = BST1, locus_dir = file.path("~/Desktop", locus_dir), highlight_plac = TRUE) +# Zoom in +trks_plus_lines <- NOTT_2019.plac_seq_plot(finemap_dat = BST1, locus_dir = file.path("~/Desktop", locus_dir), zoom_window = 500000, highlight_plac = TRUE) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/NOTT_2019.superenhancer_interactome.html b/docs/reference/NOTT_2019.superenhancer_interactome.html new file mode 100644 index 0000000..c25d042 --- /dev/null +++ b/docs/reference/NOTT_2019.superenhancer_interactome.html @@ -0,0 +1,192 @@ + + + + + + + + +Brain cell type-specific interactomes with superenhancers — NOTT_2019.superenhancer_interactome • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Originally from +Nott et al. (2019). +Specifically: aay0793-Nott-Table-S6.xlsx.

    +
    + +
    NOTT_2019.superenhancer_interactome
    + + +

    Format

    + +

    An object of class data.table (inherits from data.frame) with 2954 rows and 29 columns.

    +

    Source

    + +

    https://science.sciencemag.org/content/366/6469/1134

    +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +NOTT_2019.superenhancer_interactome <- data.table::data.table( + readxl::read_excel( + file.path( + "~/Desktop/Fine_Mapping/echolocatoR", + "annotations/Nott_2019/aay0793-Nott-Table-S6.xlsx" + ), + skip = 2 + ) +) +usethis::use_data(NOTT_2019.superenhancer_interactome) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/NOTT_2019.superenhancers.html b/docs/reference/NOTT_2019.superenhancers.html new file mode 100644 index 0000000..7dff7c0 --- /dev/null +++ b/docs/reference/NOTT_2019.superenhancers.html @@ -0,0 +1,172 @@ + + + + + + + + +Get cell type-specific superenhancer data — NOTT_2019.superenhancers • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + + + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/PLOT.get_max_histogram_height.html b/docs/reference/PLOT.get_max_histogram_height.html new file mode 100644 index 0000000..4b37af3 --- /dev/null +++ b/docs/reference/PLOT.get_max_histogram_height.html @@ -0,0 +1,154 @@ + + + + + + + + +PLOT.get_max_histogram_height — PLOT.get_max_histogram_height • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    PLOT.get_max_histogram_height

    +
    + +
    PLOT.get_max_histogram_height(gg, round_to = NULL, verbose = TRUE)
    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/PLOT.get_window_limits.html b/docs/reference/PLOT.get_window_limits.html new file mode 100644 index 0000000..b256252 --- /dev/null +++ b/docs/reference/PLOT.get_window_limits.html @@ -0,0 +1,170 @@ + + + + + + + + +Get window size limits for plot — PLOT.get_window_limits • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Get window size limits for plot

    +
    + +
    PLOT.get_window_limits(
    +  finemap_dat,
    +  index_as_center = TRUE,
    +  plot.zoom = NULL,
    +  genomic_units = "Mb",
    +  verbose = TRUE
    +)
    + + +

    See also

    + +

    Other plot: +GR.name_filter_convert()

    + +

    Examples

    +
    data("BST1") +
    #> Warning: data set 'BST1' not found
    xlims <- PLOT.get_window_limits(finemap_dat = BST1, plot.zoom = 50000) +
    #> Error in PLOT.get_window_limits(finemap_dat = BST1, plot.zoom = 50000): could not find function "PLOT.get_window_limits"
    xlims <- PLOT.get_window_limits(finemap_dat = BST1, plot.zoom = "all") +
    #> Error in PLOT.get_window_limits(finemap_dat = BST1, plot.zoom = "all"): could not find function "PLOT.get_window_limits"
    xlims <- PLOT.get_window_limits(finemap_dat = BST1, plot.zoom = "5x") +
    #> Error in PLOT.get_window_limits(finemap_dat = BST1, plot.zoom = "5x"): could not find function "PLOT.get_window_limits"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/ROADMAP.construct_reference.html b/docs/reference/ROADMAP.construct_reference.html new file mode 100644 index 0000000..c0033ee --- /dev/null +++ b/docs/reference/ROADMAP.construct_reference.html @@ -0,0 +1,187 @@ + + + + + + + + +Gather Roadmap annotation metadata — ROADMAP.construct_reference • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Gather Roadmap annotation metadata

    +
    + +
    ROADMAP.construct_reference(
    +  ref_path = system.file("extdata/ROADMAP", "ROADMAP_Epigenomic.js", package =
    +    "echoannot"),
    +  keyword_query = NULL
    +)
    + +

    Arguments

    + + + + + + + + + + +
    ref_path

    Where the ROADMAP metadata is stored.

    keyword_query

    Search all columns in the Roadmap annotations metadata +and only query annotations that contain your keywords. +Can provide multiple keywords in list form: +c("placenta","liver","monocytes")

    + +

    See also

    + + + +

    Examples

    +
    ref <- ROADMAP.construct_reference(keyword_query = c( + "placenta", + "liver", + "monocytes" +)) +
    #> + ROADMAP:: 6 annotation(s) identified that match `keyword_query`.
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/ROADMAP.merge_and_process_grl.html b/docs/reference/ROADMAP.merge_and_process_grl.html new file mode 100644 index 0000000..671de1d --- /dev/null +++ b/docs/reference/ROADMAP.merge_and_process_grl.html @@ -0,0 +1,180 @@ + + + + + + + + +Standardize Roadmap query — ROADMAP.merge_and_process_grl • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Standardize Roadmap query

    +
    + +
    ROADMAP.merge_and_process_grl(
    +  grl.roadmap,
    +  gr.snp,
    +  n_top_tissues = 5,
    +  sep = " "
    +)
    + +

    Arguments

    + + + + + + + + + + +
    grl.roadmap

    Roadmap query results

    n_top_tissues

    The number of top tissues to include, +sorted by greatest number of rows +(i.e. the number of genomic ranges within the window).

    + +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/ROADMAP.query.html b/docs/reference/ROADMAP.query.html new file mode 100644 index 0000000..8ab8a61 --- /dev/null +++ b/docs/reference/ROADMAP.query.html @@ -0,0 +1,197 @@ + + + + + + + + +Query Roadmap by genomic coordinates — ROADMAP.query • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Query Roadmap by genomic coordinates

    +
    + +
    ROADMAP.query(
    +  results_path = file.path(tempdir(), "Roadmap"),
    +  gr.snp,
    +  keyword_query = NULL,
    +  limit_files = NULL,
    +  nThread = 1,
    +  verbose = TRUE
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    results_path

    Where to store query results.

    gr.snp

    GRanges object of +SNPs to query Roadmap with.

    limit_files

    Limit the number of annotation files queried +(for faster testing).

    nThread

    Number of threads to parallelise queries over.

    + +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +grl.roadmap <- ROADMAP.query( + gr.snp = echodata::BST1, + keyword_query = "placenta") +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/ROADMAP.query_and_plot.html b/docs/reference/ROADMAP.query_and_plot.html new file mode 100644 index 0000000..375bd3e --- /dev/null +++ b/docs/reference/ROADMAP.query_and_plot.html @@ -0,0 +1,218 @@ + + + + + + + + +Query and plot Roadmap epigenomic annotations — ROADMAP.query_and_plot • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Query and plot Roadmap epigenomic annotations

    +
    + +
    ROADMAP.query_and_plot(
    +  subset_DT,
    +  results_path = file.path(tempdir(), "Roadmap"),
    +  n_top_tissues = NULL,
    +  keyword_query = NULL,
    +  adjust = 0.2,
    +  force_new_query = FALSE,
    +  remove_tmps = TRUE,
    +  verbose = TRUE
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    subset_DT

    Data.frame with at least the following columns:

    +
    SNP

    SNP RSID

    +
    CHR

    chromosome

    +
    POS

    position

    + +
    results_path

    Where to store query results.

    n_top_tissues

    The number of top tissues to include, +sorted by greatest number of rows +(i.e. the number of genomic ranges within the window).

    keyword_query

    Search all columns in the Roadmap annotations metadata +and only query annotations that contain your keywords. +Can provide multiple keywords in list form: +c("placenta","liver","monocytes")

    force_new_query

    Force a new query from the XGR database.

    + +

    Value

    + +

    A named list containing:

      +
    • ggbio plot

    • +
    • GRanges object within the queried coordinates

    • +
    + +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +roadmap_plot_query <- ROADMAP.query_and_plot( + subset_DT = echodata::BST1, + keyword_query = "monocytes") +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/ROADMAP.tabix.html b/docs/reference/ROADMAP.tabix.html new file mode 100644 index 0000000..f781cc6 --- /dev/null +++ b/docs/reference/ROADMAP.tabix.html @@ -0,0 +1,214 @@ + + + + + + + + +Query Roadmap API — ROADMAP.tabix • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Query Roadmap epigenomic annotations (chromatin marks) +using a range of genomic coordinates.

    +
    + +
    ROADMAP.tabix(
    +  results_path = tempfile(fileext = "ROADMAP_query.csv.gz"),
    +  chrom,
    +  min_pos,
    +  max_pos,
    +  eid,
    +  convert_to_granges = TRUE,
    +  verbose = TRUE
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    results_path

    Where to store query results.

    chrom

    Chromosome to query

    min_pos

    Minimum genomic position

    max_pos

    Maximum genomic position

    eid

    Roadmap annotation ID

    convert_to_granges

    Whether to return query +as a data.frame or GRanges.

    + +

    Details

    + +

    +ROADMAP file locations.

    +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +BST1 <- echodata::BST1 +dat <- ROADMAP.tabix(chrom=BST1$CHR[1], + min_pos = min(BST1$POS), + max_pos = max(BST1$POS), + eid = "E099") +} + +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/ROADMAP.track_plot.html b/docs/reference/ROADMAP.track_plot.html new file mode 100644 index 0000000..182d72e --- /dev/null +++ b/docs/reference/ROADMAP.track_plot.html @@ -0,0 +1,203 @@ + + + + + + + + +Plot Roadmap query — ROADMAP.track_plot • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Plot Roadmap query

    +
    + +
    ROADMAP.track_plot(
    +  grl.roadmap.filt,
    +  gr.snp = NULL,
    +  geom = "density",
    +  adjust = 0.2,
    +  show_plot = TRUE,
    +  as.ggplot = TRUE
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    grl.roadmap.filt

    Roadmap query results.

    gr.snp

    Optionally, can include an extra GRanges object +to ensure the plot does not extend beyond certain coordinates.

    geom

    The type of plot to create. +Options include "density" and "histogram".

    adjust

    The granularity of the peaks.

    show_plot

    Whether to print the plot.

    + + +

    Examples

    +
    if (FALSE) { +gr.snp <- dt_to_granges(echodata::BST1) +grl.roadmap <- ROADMAP.query( + gr.snp = gr.snp, + keyword_query = "monocyte" +) +grl.roadmap.filt <- ROADMAP.merge_and_process_grl( + grl.roadmap = grl.roadmap, + gr.snp = gr.snp +) +track.roadmap <- ROADMAP.track_plot(grl.roadmap.filt, + gr.snp = gr.snp +) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png new file mode 100644 index 0000000..17a3580 Binary files /dev/null and b/docs/reference/Rplot001.png differ diff --git a/docs/reference/Rplot002.png b/docs/reference/Rplot002.png new file mode 100644 index 0000000..bab190e Binary files /dev/null and b/docs/reference/Rplot002.png differ diff --git a/docs/reference/XGR.download_and_standardize.html b/docs/reference/XGR.download_and_standardize.html new file mode 100644 index 0000000..2db5a55 --- /dev/null +++ b/docs/reference/XGR.download_and_standardize.html @@ -0,0 +1,212 @@ + + + + + + + + +Download, standardize, and merge XGR annotations — XGR.download_and_standardize • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Merges a list of XGR annotations into a single GRanges object

    +
    + +
    XGR.download_and_standardize(
    +  lib.selections = c("ENCODE_TFBS_ClusteredV3_CellTypes", "TFBS_Conserved",
    +    "Uniform_TFBS"),
    +  as_grangesList = FALSE,
    +  finemap_dat,
    +  nThread = 1
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    lib.selections

    Which XGR annotations to check overlap with. +For full list of libraries see + + here.

    as_grangesList

    Return as a GRangesList, +instead of a single merged GRanges object.

    finemap_dat

    Fine-mapping results.

    nThread

    Number of cores to parallelise across.

    + +

    Value

    + +

    GRangesList

    +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +gr.lib <- XGR.download_and_standardize( + lib.selections = c("ENCODE_DNaseI_ClusteredV3_CellTypes"), + finemap_dat = echodata::BST1) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/XGR.enrichment.html b/docs/reference/XGR.enrichment.html new file mode 100644 index 0000000..475cb09 --- /dev/null +++ b/docs/reference/XGR.enrichment.html @@ -0,0 +1,236 @@ + + + + + + + + +XGR enrichment — XGR.enrichment • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Run SNP-level enrichment test with xGRviaGenomicAnno.

    +
    + +
    XGR.enrichment(
    +  gr,
    +  merged_dat,
    +  foreground_filter = "Consensus_SNP==TRUE",
    +  background_filter = NULL,
    +  grouping_vars = c("Study", "Assay", "Cell_type"),
    +  fg_sample_size = NULL,
    +  bg_sample_size = NULL,
    +  background.annotatable.only = FALSE,
    +  verbose = TRUE
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    gr

    Annotations to test for enrichment with.

    merged_dat

    SNP-level fine-mapping results to test for enrichment with.

    foreground_filter

    Filter to apply to foreground (target SNPs).

    background_filter

    Filter to apply to background (non-target SNPs).

    grouping_vars

    Columns in merged_dat to group by when conducting +enrichment tests.

    fg_sample_size

    Foreground sample size.

    bg_sample_size

    Background sample size.

    background.annotatable.only

    For background SNPs, +only use SNPs that overlap with some annotation in gr. + This means that missing annotations (NA) will not be considered.

    verbose

    Print messages.

    + +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +gr.merged <- echoannot::merge_celltype_specific_epigenomics() +enrich.lead <- XGR.enrichment( + gr = gr.merged, + merged_dat = echodata::Nalls2019_merged, + foreground_filter = "leadSNP==TRUE", + grouping_vars = c("Study", "Cell_type", "Assay") +) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/XGR.enrichment_bootstrap.html b/docs/reference/XGR.enrichment_bootstrap.html new file mode 100644 index 0000000..8de8577 --- /dev/null +++ b/docs/reference/XGR.enrichment_bootstrap.html @@ -0,0 +1,248 @@ + + + + + + + + +XGR enrichment (bootstrapped) — XGR.enrichment_bootstrap • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Perform annotation enrichment tests using iterative bootstrapping procedure.

    +
    + +
    XGR.enrichment_bootstrap(
    +  gr,
    +  merged_dat,
    +  snp_groups = c("Random", "GWAS lead", "UCS (-PolyFun)", "UCS",
    +    "Consensus (-PolyFun)", "Consensus"),
    +  background_filter = NULL,
    +  grouping_vars = c("Study", "Assay", "Cell_type"),
    +  iterations = 1000,
    +  fg_sample_size = 20,
    +  bg_sample_size = NULL,
    +  bootstrap = TRUE,
    +  save_path = tempfile(fileext = "XGR_enrich_boot_res.csv.gz"),
    +  nThread = 1,
    +  verbose = TRUE
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    gr

    Annotations to test for enrichment with.

    merged_dat

    SNP-level fine-mapping results to test for enrichment with.

    snp_groups

    Which SNP groups to repeat enrichment tests for separately.

    background_filter

    Filter to apply to background (non-target SNPs).

    grouping_vars

    Columns in merged_dat to group by when conducting +enrichment tests.

    iterations

    Number of bootstrapping iterations.

    fg_sample_size

    Foreground sample size.

    bg_sample_size

    Background sample size.

    bootstrap

    Whether to use bootstrapping.

    save_path

    File path to save results to.

    nThread

    Number of threads to parallelise bootstrapping over.

    verbose

    Print messages.

    + +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +gr.merged <- echoannot::merge_celltype_specific_epigenomics() +enrich_res <- XGR.enrichment_bootstrap( + gr = gr.merged, + merged_dat = echodata::Nalls2019_merged +) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/XGR.enrichment_plot.html b/docs/reference/XGR.enrichment_plot.html new file mode 100644 index 0000000..7c2ede8 --- /dev/null +++ b/docs/reference/XGR.enrichment_plot.html @@ -0,0 +1,247 @@ + + + + + + + + +Plot enrichment results — XGR.enrichment_plot • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Plot enrichment results

    +
    + +
    XGR.enrichment_plot(
    +  enrich_res,
    +  title = NULL,
    +  subtitle = NULL,
    +  facet_formula = NULL,
    +  line_formula = "y ~ x",
    +  line_method = "lm",
    +  line_span = 1,
    +  FDR_thresh = 1,
    +  plot_type = "bar",
    +  shape_var = "Cell_type",
    +  facet_scales = "free",
    +  show_plot = TRUE,
    +  save_plot = FALSE,
    +  height = 5,
    +  width = 5
    +)
    + + +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +root <- file.path( + "/sc/arion/projects/pd-omics/brian", + "Fine_Mapping/Data/GWAS/Nalls23andMe_2019/_genome_wide" +) +### merged enrichment results +enrich_res <- data.table::fread( + file.path( + root, + "XGR/celltypespecific_epigenomics.SNP_groups.csv.gz" + ) +) +enrich_res <- data.table::fread( + file.path( + root, + "XGR/celltypespecific_epigenomics.snp_groups.csv.gz" + ) +) +enrich_boot <- data.table::fread( + file.path( + root, + "XGR/celltypespecific_epigenomics.snp_groups.permute.csv.gz" + ) +) +enrich_assay <- data.table::fread( + file.path( + root, + "XGR/celltypespecific_epigenomics.snp_groups.assay.csv.gz" + ) +) + +# Merged volcano plot +enrich_res <- subset(enrich_res, SNP_Group != "Consensus (-PolyFun)") %>% + dplyr::rename(SNP_group = SNP_Group) +gp <- XGR.enrichment_plot( + enrich_res = subset(enrich_res, !Assay %in% c("HiChIP_FitHiChIP", "PLAC")), + title = "Enrichment: Cell-type-specific epigenomics", + plot_type = "point", + save_plot = file.path( + root, "XGR/celltypespecific_epigenomics.enrich_volcano.png" + ), + height = 6, width = 8, shape_var = "Assay" +) +## Merged bar plot +gp <- XGR.enrichment_plot( + enrich_res = enrich_res, + plot_type = "bar", + facet_formula = ".~Assay", + FDR_thresh = .05 +) +# Merged volcano plot (permuted) +gp <- XGR.enrichment_plot( + enrich_res = enrich.scATAC.permute, + title = "Permuted enrichment: Cell-type-specific peaks and elements", + plot_type = "point" +) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/XGR.filter_assays.html b/docs/reference/XGR.filter_assays.html new file mode 100644 index 0000000..2bd5e60 --- /dev/null +++ b/docs/reference/XGR.filter_assays.html @@ -0,0 +1,174 @@ + + + + + + + + +Filter assays — XGR.filter_assays • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Identify the assays with the most annotations in the locus. +Then only keep these assays

    +
    + +
    XGR.filter_assays(gr.lib, n_top_assays = 5)
    + + +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/XGR.filter_sources.html b/docs/reference/XGR.filter_sources.html new file mode 100644 index 0000000..b8549ea --- /dev/null +++ b/docs/reference/XGR.filter_sources.html @@ -0,0 +1,174 @@ + + + + + + + + +Filter sources — XGR.filter_sources • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Identify the sources with the most annotations in the locus. +Then only keep these sources.

    +
    + +
    XGR.filter_sources(gr.lib, n_top_sources = 5)
    + + +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/XGR.import_annotations.html b/docs/reference/XGR.import_annotations.html new file mode 100644 index 0000000..8d1b78b --- /dev/null +++ b/docs/reference/XGR.import_annotations.html @@ -0,0 +1,178 @@ + + + + + + + + +Download XGR annotations — XGR.import_annotations • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Download XGR annotations

    +
    + +
    XGR.import_annotations(
    +  gr.snp,
    +  anno_data_path = file.path("annotations", paste0("XGR_", lib.name, ".rds")),
    +  lib.name,
    +  save_xgr = TRUE,
    +  annot_overlap_threshold = 5
    +)
    + + +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/XGR.iterate_enrichment.html b/docs/reference/XGR.iterate_enrichment.html new file mode 100644 index 0000000..32c72c5 --- /dev/null +++ b/docs/reference/XGR.iterate_enrichment.html @@ -0,0 +1,222 @@ + + + + + + + + +Conduct enrichment tests for each annotation — XGR.iterate_enrichment • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    XGR uses a binomial enrichment tests for each annotation.

    +
    + +
    XGR.iterate_enrichment(
    +  subset_DT,
    +  foreground_filter = "Consensus_SNP",
    +  background_filter = "leadSNP",
    +  lib.selections = c("ENCODE_TFBS_ClusteredV3_CellTypes",
    +    "ENCODE_DNaseI_ClusteredV3_CellTypes", "Broad_Histone", "FANTOM5_Enhancer",
    +    "Segment_Combined_Gm12878", "TFBS_Conserved", "ReMap_PublicAndEncode_TFBS",
    +    "Blueprint_VenousBlood_Histone", "Blueprint_DNaseI", "FANTOM5_CAT_Cell",
    +    "FANTOM5_CAT_MESH", "GWAScatalog_alltraits"),
    +  save_path = FALSE,
    +  nThread = 1
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    subset_DT

    Data.frame with at least the following columns:

    +
    SNP

    SNP RSID

    +
    CHR

    chromosome

    +
    POS

    position

    + +
    foreground_filter

    Specify foreground by filtering SNPs +in subset_DT. +Write filter as a string (or NULL to include all SNPs).

    background_filter

    Specify background by filtering SNPs +in subset_DT. +Write filter as a string (or NULL to include all SNPs).

    + +

    Details

    + +

    +Description of all datasets

    +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +enrich_res <- XGR.iterate_enrichment( + subset_DT = echodata::Nalls2019_merged, + foreground_filter = "Consensus_SNP", + background_filter = "leadSNP", + lib.selections = c("ENCODE_TFBS_ClusteredV3_CellTypes") +) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/XGR.iterate_overlap.html b/docs/reference/XGR.iterate_overlap.html new file mode 100644 index 0000000..5a10f0a --- /dev/null +++ b/docs/reference/XGR.iterate_overlap.html @@ -0,0 +1,222 @@ + + + + + + + + +Check overlap with XGR annotations — XGR.iterate_overlap • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Automatically handles different file formats provided by XGR + (e.g. varying kinds of nested/unnested GRanges). +Then returns a Granges object with only the XGR annotation ranges +that overlap with the SNPs in subset_DT. +The GRanges merges hits from subset_DT.

    +
    + +
    XGR.iterate_overlap(
    +  lib.selections = c("ENCODE_TFBS_ClusteredV3_CellTypes", "TFBS_Conserved",
    +    "ReMap_PublicAndEncode_TFBS", "Uniform_TFBS"),
    +  subset_DT,
    +  save_path = FALSE,
    +  nThread = 1
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    lib.selections

    Which XGR annotations to check overlap with. +For full list of libraries see + + here.

    subset_DT

    Data.frame with at least the following columns:

    +
    SNP

    SNP RSID

    +
    CHR

    chromosome

    +
    POS

    position

    + +
    save_path

    Save the results as a data.frame.

    nThread

    Multi-thread across libraries.

    + +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +gr.hits <- XGR.iterate_overlap( + lib.selections = c("ENCODE_TFBS_ClusteredV3_CellTypes"), + subset_DT = echodata::BST1 +) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/XGR.merge_and_process.html b/docs/reference/XGR.merge_and_process.html new file mode 100644 index 0000000..4b8e435 --- /dev/null +++ b/docs/reference/XGR.merge_and_process.html @@ -0,0 +1,184 @@ + + + + + + + + +Standardize XGR annotations — XGR.merge_and_process • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Parses the metadata and adds it as columns, +and then merges the results into a single +GenomicRangesList

    +
    + +
    XGR.merge_and_process(grl.xgr, lib, n_top_sources = 10)
    + +

    Arguments

    + + + + + + +
    grl.xgr

    GenomicRangesList of XGR queries.

    + +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/XGR.parse_metadata.html b/docs/reference/XGR.parse_metadata.html new file mode 100644 index 0000000..0a730a0 --- /dev/null +++ b/docs/reference/XGR.parse_metadata.html @@ -0,0 +1,172 @@ + + + + + + + + +XGR.parse_metadata — XGR.parse_metadata • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    XGR.parse_metadata

    +
    + +
    XGR.parse_metadata(gr.lib, lib.name = NA)
    + + +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/XGR.plot_enrichment.html b/docs/reference/XGR.plot_enrichment.html new file mode 100644 index 0000000..f4056f2 --- /dev/null +++ b/docs/reference/XGR.plot_enrichment.html @@ -0,0 +1,188 @@ + + + + + + + + +Plot XGR enrichment — XGR.plot_enrichment • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Plot XGR enrichment

    +
    + +
    XGR.plot_enrichment(
    +  enrich_res,
    +  adjp_thresh = 0.05,
    +  top_annotations = NULL,
    +  show_plot = TRUE
    +)
    + + +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +enrich_res <- XGR.iterate_enrichment( + subset_DT = echodata::Nalls2019_merged, + foreground_filter = "Consensus_SNP", + background_filter = "leadSNP", + lib.selections = c("ENCODE_TFBS_ClusteredV3_CellTypes") +) +XGR.plot_enrichment(enrich_res) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/XGR.plot_peaks.html b/docs/reference/XGR.plot_peaks.html new file mode 100644 index 0000000..f019c20 --- /dev/null +++ b/docs/reference/XGR.plot_peaks.html @@ -0,0 +1,236 @@ + + + + + + + + +Plot XGR peaks — XGR.plot_peaks • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Plots the distribution of annotations across a genomic region (x-axis).

    +
    + +
    XGR.plot_peaks(
    +  gr.lib,
    +  subset_DT,
    +  fill_var = "Assay",
    +  facet_var = "Source",
    +  geom = "density",
    +  locus = NULL,
    +  adjust = 0.2,
    +  show_plot = TRUE,
    +  show.legend = TRUE,
    +  as.ggplot = TRUE,
    +  trim_xlims = FALSE
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    gr.lib

    GRanges object of annotations.

    subset_DT

    Data.frame with at least the following columns:

    +
    SNP

    SNP RSID

    +
    CHR

    chromosome

    +
    POS

    position

    + +
    geom

    Plot type ("density", or "histogram").

    locus

    Locus name (optional).

    adjust

    The granularity of the peaks.

    show_plot

    Print the plot.

    + +

    Value

    + +

    ggbio track plot.

    +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +gr.lib <- XGR.download_and_standardize( + c("ENCODE_DNaseI_ClusteredV3_CellTypes"), + finemap_dat = echodata::BST1 +) +gr.filt <- XGR.filter_sources(gr.lib = gr.lib, n_top_sources = 5) +gr.filt <- XGR.filter_assays(gr.lib = gr.filt, n_top_assays = 5) +xgr.track <- XGR.plot_peaks( + gr.lib = gr.filt, + subset_DT = echodata::BST1, + fill_var = "Assay", + facet_var = "Source" +) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/XGR.prepare_foreground_background.html b/docs/reference/XGR.prepare_foreground_background.html new file mode 100644 index 0000000..8af7cfa --- /dev/null +++ b/docs/reference/XGR.prepare_foreground_background.html @@ -0,0 +1,215 @@ + + + + + + + + +Prepare SNP sets for enrichment — XGR.prepare_foreground_background • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Prepare custom foreground and background SNPs sets for enrichment +tests with XGR annotations.

    +
    + +
    XGR.prepare_foreground_background(
    +  subset_DT,
    +  foreground_filter = "Support>0",
    +  background_filter = NULL,
    +  fg_sample_size = NULL,
    +  bg_sample_size = NULL,
    +  verbose = TRUE
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    subset_DT

    Data.frame with at least the following columns:

    +
    SNP

    SNP RSID

    +
    CHR

    chromosome

    +
    POS

    position

    + +
    foreground_filter

    Specify foreground by filtering SNPs +in subset_DT. +Write filter as a string (or NULL to include all SNPs).

    background_filter

    Specify background by filtering SNPs +in subset_DT. +Write filter as a string (or NULL to include all SNPs).

    + +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +fg_bg <- XGR.prepare_foreground_background( + subset_DT = echodata::Nalls2019_merged, + foreground_filter = "Consensus_SNP==TRUE", + background_filter = "leadSNP==TRUE" +) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/XGR.sep_handler.html b/docs/reference/XGR.sep_handler.html new file mode 100644 index 0000000..c83118d --- /dev/null +++ b/docs/reference/XGR.sep_handler.html @@ -0,0 +1,172 @@ + + + + + + + + +XGR.sep_handler — XGR.sep_handler • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    XGR.sep_handler

    +
    + +
    XGR.sep_handler(lib.name)
    + + +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/annotate_missense.html b/docs/reference/annotate_missense.html new file mode 100644 index 0000000..26d2cc4 --- /dev/null +++ b/docs/reference/annotate_missense.html @@ -0,0 +1,174 @@ + + + + + + + + +Annotate any missense variants — annotate_missense • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Annotate any missense variants

    +
    + +
    annotate_missense(merged_DT, snp_filter = "Support>0")
    + + +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +annotated_DT <- annotate_missense( + merged_DT = echodata::Nalls2019_merged, + snp_filter = "Support>0" +) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/annotation_file_name.html b/docs/reference/annotation_file_name.html new file mode 100644 index 0000000..4b8577b --- /dev/null +++ b/docs/reference/annotation_file_name.html @@ -0,0 +1,154 @@ + + + + + + + + +Name annotation file — annotation_file_name • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Name annotation file

    +
    + +
    annotation_file_name(locus_dir, lib_name)
    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/assign_lead_SNP.html b/docs/reference/assign_lead_SNP.html new file mode 100644 index 0000000..055c021 --- /dev/null +++ b/docs/reference/assign_lead_SNP.html @@ -0,0 +1,171 @@ + + + + + + + + +Assign a lead GWAS SNP to a locus — assign_lead_SNP • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    If none of the SNPs in the data.frame have leadSNP==TRUE, +then sort by lowest p-value (and then highest Effect size) +and assign the top SNP as the lead SNP.

    +
    + +
    assign_lead_SNP(new_DT, verbose = TRUE)
    + +

    Arguments

    + + + + + + +
    data.frame

    Fine-mapping results data.frame.

    + +

    Value

    + +

    Fine-mapping results data.frame with +new boolean leadSNP column, + indicating whether each SNPs is the lead GWAS SNP in that locus or not.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/biomart_geneInfo.html b/docs/reference/biomart_geneInfo.html new file mode 100644 index 0000000..a9d4712 --- /dev/null +++ b/docs/reference/biomart_geneInfo.html @@ -0,0 +1,175 @@ + + + + + + + + +Get gene info using Biomart — biomart_geneInfo • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Get gene info using Biomart

    +
    + +
    biomart_geneInfo(geneList, reference_genome = "grch37")
    + + +

    Source

    + +

    +biomaRt

    +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +gene_info <- biomart_geneInfo(c("PTK2B", "CLU", "APOE")) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/biomart_snp_info.html b/docs/reference/biomart_snp_info.html new file mode 100644 index 0000000..1e22848 --- /dev/null +++ b/docs/reference/biomart_snp_info.html @@ -0,0 +1,178 @@ + + + + + + + + +Download SNP-wise annotations from Biomart — biomart_snp_info • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Download SNP-wise annotations from Biomart

    +
    + +
    biomart_snp_info(
    +  snp_list,
    +  reference_genome = "grch37",
    +  attributes = c("refsnp_id", "allele", "chr_name", "chrom_start", "chrom_end",
    +    "chrom_strand", "ensembl_gene_stable_id", "consequence_type_tv",
    +    "polyphen_prediction", "polyphen_score", "sift_prediction", "sift_score",
    +    "reg_consequence_types", "validated"),
    +  verbose = TRUE
    +)
    + + +

    Source

    + +

    +biomaRt

    +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/biomart_snps_to_geneInfo.html b/docs/reference/biomart_snps_to_geneInfo.html new file mode 100644 index 0000000..233ce62 --- /dev/null +++ b/docs/reference/biomart_snps_to_geneInfo.html @@ -0,0 +1,175 @@ + + + + + + + + +Identify which genes SNPs belong to using Biomart — biomart_snps_to_geneInfo • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Identify which genes SNPs belong to using Biomart

    +
    + +
    biomart_snps_to_geneInfo(snp_list, reference_genome = "grch37")
    + + +

    Source

    + +

    +biomaRt

    +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +# biomart_snps_to_geneInfo(c("rs114360492")) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/cell_type_specificity.html b/docs/reference/cell_type_specificity.html new file mode 100644 index 0000000..96a802c --- /dev/null +++ b/docs/reference/cell_type_specificity.html @@ -0,0 +1,166 @@ + + + + + + + + +Get cell-type-specifity score for each cell type — cell_type_specificity • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Aggregate SNP overlap across various epigenomic datasets +and then identify the number of SNPs overlapping by each cell type

    +
    + +
    cell_type_specificity(
    +  plot_dat,
    +  merged_DT,
    +  min_count = NULL,
    +  top_celltype_only = FALSE,
    +  label_yaxis = TRUE,
    +  y_lab = NULL,
    +  show_genes = FALSE,
    +  x_strip_angle = 40,
    +  show_plot = TRUE
    +)
    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/clean_granges.html b/docs/reference/clean_granges.html new file mode 100644 index 0000000..dde22e5 --- /dev/null +++ b/docs/reference/clean_granges.html @@ -0,0 +1,154 @@ + + + + + + + + +Clean GRanges object — clean_granges • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Clean GRanges object

    +
    + +
    clean_granges(gr)
    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/coloc_nominated_eGenes.html b/docs/reference/coloc_nominated_eGenes.html new file mode 100644 index 0000000..51b329a --- /dev/null +++ b/docs/reference/coloc_nominated_eGenes.html @@ -0,0 +1,204 @@ + + + + + + + + +Nominate target genes within each locus — coloc_nominated_eGenes • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Across all GWAS-QTL colocalization tests across all studies, +take the eGene with the highest colocalziation probability (PP.H4) +and assign it as the most likely causal gene in that locus.

    +
    + +
    coloc_nominated_eGenes(
    +  coloc_results,
    +  merged_DT,
    +  label_yaxis = TRUE,
    +  y_lab = "Locus",
    +  x_lab = NULL,
    +  fill_var = "PP.H4",
    +  text_size = 2,
    +  PP_threshold = NULL,
    +  nThread = 1,
    +  show_plot = TRUE,
    +  verbose = TRUE
    +)
    + + +

    Details

    + +

    eQTL queries and colocalization test done with catalogueR.

    + +

    Examples

    +
    if (FALSE) { +merged_DT <- echodata::Nalls2019_merged +base_url <- "~/Desktop/Fine_Mapping/Data/GWAS/Nalls23andMe_2019" +coloc_results_path <- file.path( + base_url, "_genome_wide/COLOC/coloc.eQTL_Catalogue_ALL.csv.gz" +) +gg_egene <- coloc_nominated_eGenes(coloc_results, + merged_DT = merged_DT, + fill_var = NULL +) + +# QTL +base_url <- "/sc/hydra/projects/ad-omics/microglia_omics/Fine_Mapping" +coloc_results_path <- file.path( + base_url, + "Kunkle_Microglia_all_regions/QTL_merged_coloc_results.snp.tsv.gz" +) +merged_DT <- data.table::fread( + file.path( + "/pd-omics/brian/Fine_Mapping/Data/QTL", + "Microglia_all_regions", + "multiGWAS.microgliaQTL_finemapping.csv.gz" + ) +) +gg_egene <- coloc_nominated_eGenes(coloc_results, + merged_DT = merged_DT, + fill_var = NULL +) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/dt_to_granges.html b/docs/reference/dt_to_granges.html new file mode 100644 index 0000000..23f6a2d --- /dev/null +++ b/docs/reference/dt_to_granges.html @@ -0,0 +1,161 @@ + + + + + + + + +Convert data.table to GRanges object — dt_to_granges • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Convert data.table to GRanges object

    +
    + +
    dt_to_granges(
    +  subset_DT,
    +  chrom_col = "CHR",
    +  start_col = "POS",
    +  end_col = start_col,
    +  style = "NCBI",
    +  verbose = TRUE
    +)
    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/find_consensus_SNPs.html b/docs/reference/find_consensus_SNPs.html new file mode 100644 index 0000000..eecfb28 --- /dev/null +++ b/docs/reference/find_consensus_SNPs.html @@ -0,0 +1,193 @@ + + + + + + + + +Adds fine-mapping summary columns — find_consensus_SNPs • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Adds several columns that summarise the results across all fine-mapping +tools that were run:

    +
    Support

    The number of tools in which the SNP was proposed +in a credible set.

    +
    mean.PP

    The mean per-SNP PP across all fine-mapping tools used.

    +
    Consensus_SNP

    Whether or not the SNP was in the credible set of > + consensus_thresh SNPs (default=2).

    + +
    + +
    + +
    find_consensus_SNPs(
    +  finemap_dat,
    +  credset_thresh = 0.95,
    +  consensus_thresh = 2,
    +  sort_by_support = TRUE,
    +  exclude_methods = NULL,
    +  top_CS_only = FALSE,
    +  replace_PP_NAs = TRUE,
    +  verbose = FALSE
    +)
    + +

    Arguments

    + + + + + + +
    consensus_thresh

    Threshold for determining +Consensus_SNP status.

    + + +

    Examples

    +
    merged_DT <- find_consensus_SNPs(finemap_dat = echodata::Nalls2019_merged) +
    #> Error in find_consensus_SNPs(finemap_dat = echodata::Nalls2019_merged): could not find function "find_consensus_SNPs"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/find_topConsensus.html b/docs/reference/find_topConsensus.html new file mode 100644 index 0000000..0da1458 --- /dev/null +++ b/docs/reference/find_topConsensus.html @@ -0,0 +1,158 @@ + + + + + + + + +Find the top Consensus SNP — find_topConsensus • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Identify the top_N Consensus SNP(s) per Locus, +defined as the Consensus SNPs with the highest mean PP +across all fine-mapping tools used.

    +
    + +
    find_topConsensus(dat, top_N = 1, grouping_vars = c("Locus"))
    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/get_CS_bins.html b/docs/reference/get_CS_bins.html new file mode 100644 index 0000000..38e31d8 --- /dev/null +++ b/docs/reference/get_CS_bins.html @@ -0,0 +1,170 @@ + + + + + + + + +Count bins of tool-specific and union CS sizes — get_CS_bins • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Count bins of tool-specific and union CS sizes

    +
    + +
    get_CS_bins(merged_DT)
    + + +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +bin_counts <- get_CS_bins(merged_DT = echodata::Nalls2019_merged) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/get_CS_counts.html b/docs/reference/get_CS_counts.html new file mode 100644 index 0000000..cc1cd78 --- /dev/null +++ b/docs/reference/get_CS_counts.html @@ -0,0 +1,170 @@ + + + + + + + + +Tally tool-specific and union CS sizes — get_CS_counts • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Tally tool-specific and union CS sizes

    +
    + +
    get_CS_counts(merged_DT, top_CS_only = FALSE)
    + + +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +locus_order <- get_CS_counts(merged_DT = echodata::Nalls2019_merged) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/get_SNPgroup_counts.html b/docs/reference/get_SNPgroup_counts.html new file mode 100644 index 0000000..6f48589 --- /dev/null +++ b/docs/reference/get_SNPgroup_counts.html @@ -0,0 +1,169 @@ + + + + + + + + +Tally locus-specific SNP group sizes — get_SNPgroup_counts • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Tally locus-specific SNP group sizes

    +
    + +
    get_SNPgroup_counts(merged_DT, grouping_vars = "Locus")
    + + +

    See also

    + + + +

    Examples

    +
    data("merged_DT") +
    #> Warning: data set 'merged_DT' not found
    snp_groups <- get_SNPgroup_counts(merged_DT = echodata::Nalls2019_merged) +
    #> Error in get_SNPgroup_counts(merged_DT = echodata::Nalls2019_merged): could not find function "get_SNPgroup_counts"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/granges_overlap.html b/docs/reference/granges_overlap.html new file mode 100644 index 0000000..6beb786 --- /dev/null +++ b/docs/reference/granges_overlap.html @@ -0,0 +1,166 @@ + + + + + + + + +Find overlap between genomic coordinates/ranges — granges_overlap • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Find overlap between genomic coordinates/ranges

    +
    + +
    granges_overlap(
    +  dat1,
    +  dat2,
    +  chrom_col.1 = "chrom",
    +  start_col.1 = "start",
    +  end_col.1 = "end",
    +  chrom_col.2 = chrom_col.1,
    +  start_col.2 = start_col.1,
    +  end_col.2 = end_col.1,
    +  return_merged = TRUE,
    +  chr_format = "NCBI",
    +  verbose = FALSE
    +)
    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/granges_to_bed.html b/docs/reference/granges_to_bed.html new file mode 100644 index 0000000..a6d1986 --- /dev/null +++ b/docs/reference/granges_to_bed.html @@ -0,0 +1,178 @@ + + + + + + + + +Convert GRanges object to BED format and save — granges_to_bed • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Convert GRanges object to BED format and save

    +
    + +
    granges_to_bed(
    +  GR.annotations,
    +  output_path,
    +  sep = "\t",
    +  nThread = 1,
    +  gzip = FALSE
    +)
    + + +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/haplor_epigenetics_enrichment.html b/docs/reference/haplor_epigenetics_enrichment.html new file mode 100644 index 0000000..5f51065 --- /dev/null +++ b/docs/reference/haplor_epigenetics_enrichment.html @@ -0,0 +1,177 @@ + + + + + + + + +Test for enrichment of HaploR annotations — haplor_epigenetics_enrichment • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Test for enrichment of HaploR annotations

    +
    + +
    haplor_epigenetics_enrichment(
    +  snp_list1,
    +  snp_list2,
    +  chisq = TRUE,
    +  fisher = TRUE,
    +  epigenetic_variables = c("Promoter_histone_marks", "Enhancer_histone_marks"),
    +  tissue_list = c("BRN", "BLD")
    +)
    + + +

    Source

    + +

    +HaploR

    +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/haplor_epigenetics_summary.html b/docs/reference/haplor_epigenetics_summary.html new file mode 100644 index 0000000..2b89102 --- /dev/null +++ b/docs/reference/haplor_epigenetics_summary.html @@ -0,0 +1,174 @@ + + + + + + + + +Summarise HaploR annotations — haplor_epigenetics_summary • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Summarise HaploR annotations

    +
    + +
    haplor_epigenetics_summary(
    +  merged_results,
    +  tissue_list = c("BRN", "BLD"),
    +  epigenetic_variables = c("Promoter_histone_marks", "Enhancer_histone_marks")
    +)
    + + +

    Source

    + +

    +HaploR

    +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/haplor_haploreg.html b/docs/reference/haplor_haploreg.html new file mode 100644 index 0000000..26d20fd --- /dev/null +++ b/docs/reference/haplor_haploreg.html @@ -0,0 +1,170 @@ + + + + + + + + +Download SNP-wise annotations from HaploReg — haplor_haploreg • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Download SNP-wise annotations from HaploReg

    +
    + +
    haplor_haploreg(snp_list, verbose = T, chunk_size = NA)
    + + +

    Source

    + +

    +HaploR

    +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/haplor_regulomedb.html b/docs/reference/haplor_regulomedb.html new file mode 100644 index 0000000..f61f80b --- /dev/null +++ b/docs/reference/haplor_regulomedb.html @@ -0,0 +1,170 @@ + + + + + + + + +Download SNP-wise annotations from RegulomeDB — haplor_regulomedb • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Download SNP-wise annotations from RegulomeDB

    +
    + +
    haplor_regulomedb(snp_list, verbose = TRUE, chunk_size = NA)
    + + +

    Source

    + +

    +HaploR

    +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/import.bw.filt.html b/docs/reference/import.bw.filt.html new file mode 100644 index 0000000..9f27c2a --- /dev/null +++ b/docs/reference/import.bw.filt.html @@ -0,0 +1,174 @@ + + + + + + + + +Import filtered bigwig — import.bw.filt • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Import a subset of a bigwig file +based on the coordinates in a GRanges object (gr.dat).

    +
    + +
    import.bw.filt(bw.file, gr.dat, full_data = TRUE)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    bw.file

    Path to a bigwig file.

    gr.dat

    GenomicRanges object to query the bigwig file with.

    full_data

    Whether to return the actual read ranges (full_data=T), +or just the "score" column which summarizes the height of +the aggregated reads across the genome (full_data=TRUE).

    + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/index.html b/docs/reference/index.html new file mode 100644 index 0000000..47b66f0 --- /dev/null +++ b/docs/reference/index.html @@ -0,0 +1,330 @@ + + + + + + + + +Function reference • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    All functions

    +

    +
    +

    CORCES_2020.HiChIP_FitHiChIP_loop_calls

    +

    FitHiChIP loop calls from human brain tissue

    +

    CORCES_2020.bulkATACseq_peaks

    +

    bulkATACseq peaks from human brain tissue

    +

    CORCES_2020.cicero_coaccessibility

    +

    Cicero_coaccessibility from human brain tissue

    +

    CORCES_2020.get_ATAC_peak_overlap()

    +

    Get overlap between datatable of SNPs and scATAC peaks

    +

    CORCES_2020.get_HiChIP_FitHiChIP_overlap()

    +

    Get overlap between data table of SNPs and HiChIP_FitHiChIP +coaccessibility anchors

    +

    CORCES_2020.scATACseq_celltype_peaks

    +

    scATACseq cell type-specific peaks from human brain tissue

    +

    CORCES_2020.scATACseq_peaks

    +

    scATACseq peaks from human brain tissue

    +

    CS_bin_plot()

    +

    Plot CS bin counts

    +

    CS_counts_plot()

    +

    Bar plot of tool-specific CS sizes

    +

    NOTT_2019.bigwig_metadata

    +

    Metadata and links to data

    +

    NOTT_2019.interactome

    +

    Brain cell type-specific enhancers, promoters, and interactomes

    +

    NOTT_2019.superenhancer_interactome

    +

    Brain cell type-specific interactomes with superenhancers

    +

    ROADMAP.construct_reference()

    +

    Gather Roadmap annotation metadata

    +

    ROADMAP.merge_and_process_grl()

    +

    Standardize Roadmap query

    +

    ROADMAP.query()

    +

    Query Roadmap by genomic coordinates

    +

    ROADMAP.query_and_plot()

    +

    Query and plot Roadmap epigenomic annotations

    +

    XGR.download_and_standardize()

    +

    Download, standardize, and merge XGR annotations

    +

    XGR.enrichment()

    +

    XGR enrichment

    +

    XGR.enrichment_bootstrap()

    +

    XGR enrichment (bootstrapped)

    +

    XGR.enrichment_plot()

    +

    Plot enrichment results

    +

    annotate_missense()

    +

    Annotate any missense variants

    +

    get_SNPgroup_counts()

    +

    Tally locus-specific SNP group sizes

    +

    merge_celltype_specific_epigenomics()

    +

    Merge all cell-type-specific epigenomics

    +

    merge_finemapping_results()

    +

    Merge fine-mapping results from all loci

    +

    plot_dataset_overlap()

    +

    Plot inter-study SNP overlap

    +

    plot_missense()

    +

    Plot any missense variants

    +

    super_summary_plot()

    +

    Merge all summary plots into one super plot

    +
    + + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/is_granges.html b/docs/reference/is_granges.html new file mode 100644 index 0000000..5ade8c9 --- /dev/null +++ b/docs/reference/is_granges.html @@ -0,0 +1,154 @@ + + + + + + + + +is_granges — is_granges • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    is_granges

    +
    + +
    is_granges(obj)
    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/merge_celltype_specific_epigenomics.html b/docs/reference/merge_celltype_specific_epigenomics.html new file mode 100644 index 0000000..b0e01ef --- /dev/null +++ b/docs/reference/merge_celltype_specific_epigenomics.html @@ -0,0 +1,168 @@ + + + + + + + + +Merge all cell-type-specific epigenomics — merge_celltype_specific_epigenomics • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Merges multiple cell-type-specific epigenomic datasets +(Nott 2019, Corces 2020) into a single GRanges object.

    +
    + +
    merge_celltype_specific_epigenomics(keep_extra_cols = FALSE)
    + +

    Arguments

    + + + + + + +
    keep_extra_cols

    Keep extra columns +that are not shared across all annotations.

    + + +

    Examples

    +
    gr.merged <- echoannot::merge_celltype_specific_epigenomics() +
    #> ++ NOTT_2019:: Downloading and merging 12 peaks BED files.
    #> ++ NOTT_2019:: Downloading ATAC/NeuN_optimal_peak_IDR_ENCODE.ATAC.bed
    #> ++ NOTT_2019:: Downloading ATAC/PU1_optimal_peak_IDR_ENCODE.ATAC.bed
    #> ++ NOTT_2019:: Downloading ATAC/Olig2_optimal_peak_IDR_ENCODE.ATAC.bed
    #> ++ NOTT_2019:: Downloading ATAC/LHX2_optimal_peak_IDR_ENCODE.ATAC.bed
    #> ++ NOTT_2019:: Downloading H3K27ac/NeuN_optimal_peak.H3K27.bed
    #> ++ NOTT_2019:: Downloading H3K27ac/PU1_optimal_peak.H3K27.bed
    #> ++ NOTT_2019:: Downloading H3K27ac/Olig2_optimal_peak.H3K27.bed
    #> ++ NOTT_2019:: Downloading H3K27ac/LHX2_optimal_peak.H3K27.bed
    #> ++ NOTT_2019:: Downloading H3K4me3/NeuN_optimal_peak.H3K4me3.bed
    #> ++ NOTT_2019:: Downloading H3K4me3/PU1_optimal_peak.H3K4me3.bed
    #> ++ NOTT_2019:: Downloading H3K4me3/Olig2_optimal_peak.H3K4me3.bed
    #> ++ NOTT_2019:: Downloading H3K4me3/LHX2_optimal_peak.H3K4me3.bed
    #> ++ NOTT_2019:: Converting merged BED files to GRanges.
    #> ++ NOTT_2019:: 634540 ranges retrieved.
    #> Error in -c(start, end): invalid argument to unary operator
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/merge_finemapping_results.html b/docs/reference/merge_finemapping_results.html new file mode 100644 index 0000000..df5f616 --- /dev/null +++ b/docs/reference/merge_finemapping_results.html @@ -0,0 +1,233 @@ + + + + + + + + +Merge fine-mapping results from all loci — merge_finemapping_results • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Gather fine-mapping results from echolocatoR across all loci +and merge into a single data.frame.

    +
    + +
    merge_finemapping_results(
    +  dataset = "./Data/GWAS",
    +  minimum_support = 1,
    +  include_leadSNPs = TRUE,
    +  LD_reference = NULL,
    +  save_path = tempfile(fileext = "merged_results.csv.gz"),
    +  from_storage = TRUE,
    +  haploreg_annotation = FALSE,
    +  regulomeDB_annotation = FALSE,
    +  biomart_annotation = FALSE,
    +  PP_threshold = 0.95,
    +  consensus_threshold = 2,
    +  exclude_methods = NULL,
    +  top_CS_only = FALSE,
    +  verbose = TRUE,
    +  nThread = 1
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    dataset

    Path to the folder you want to recursively search for results files within + (e.g. "Data/GWAS/Nalls23andMe_2019"). +Set this to a path that includes multiple subfolders if you want to gather results +from multiple studies at once +(e.g. "Data/GWAS").

    minimum_support

    Filter SNPs by the minimum number +of fine-mapping tools that contained the SNP in their Credible Set.

    include_leadSNPs

    Include lead GWAS/QTL SNPs per locus +(regardless of other filtering criterion).

    from_storage

    Search for stored results files.

    haploreg_annotation

    Annotate SNPs with HaploReg (using HaploR).

    regulomeDB_annotation

    Annotate SNPs with regulaomeDB (using HaploR).

    biomart_annotation

    Annotate SNPs with biomart.

    PP_threshold

    Mean posterior probability threshold to include SNPs in mean PP Credible Set +(averaged across all fine-mapping tools).

    exclude_methods

    Exclude certain fine-mapping methods when estimating +mean.CS and Consensus_SNP.

    verbose

    Print messages.

    xlsx_path

    Save merged data.frame as excel file.

    consensus_thresh

    The minimum number of tools that have the SNPs in their Credible Set +to classify it as a Consensus_SNP.

    + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/merge_finemapping_results_each.html b/docs/reference/merge_finemapping_results_each.html new file mode 100644 index 0000000..2ce406b --- /dev/null +++ b/docs/reference/merge_finemapping_results_each.html @@ -0,0 +1,169 @@ + + + + + + + + +Create full cross-locus merged files for each dataset, +then return a subset of those files as one super-merged table. — merge_finemapping_results_each • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Create full cross-locus merged files for each dataset, +then return a subset of those files as one super-merged table.

    +
    + +
    merge_finemapping_results_each(
    +  study_dirs,
    +  LD_reference = "1KGphase3",
    +  minimum_support = 1,
    +  include_leadSNPs = TRUE,
    +  return_filter = "!is.na(SNP)",
    +  merged_path = "merged_DT.csv.gz",
    +  force_new_merge = FALSE,
    +  nThread = 1,
    +  verbose = TRUE
    +)
    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/message_parallel.html b/docs/reference/message_parallel.html new file mode 100644 index 0000000..df9c980 --- /dev/null +++ b/docs/reference/message_parallel.html @@ -0,0 +1,157 @@ + + + + + + + + +Send messages to console even from within parallel processes — message_parallel • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Send messages to console even from within parallel processes

    +
    + +
    message_parallel(...)
    + + +

    Value

    + +

    A message

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/order_loci.html b/docs/reference/order_loci.html new file mode 100644 index 0000000..e6cb7df --- /dev/null +++ b/docs/reference/order_loci.html @@ -0,0 +1,171 @@ + + + + + + + + +Order loci by UCS size, or alphabetically — order_loci • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Order loci by UCS size, or alphabetically

    +
    + +
    order_loci(
    +  dat,
    +  merged_DT,
    +  by_UCS_size = FALSE,
    +  descending = TRUE,
    +  verbose = FALSE
    +)
    + + + +

    Examples

    +
    data("merged_DT") +
    #> Warning: data set 'merged_DT' not found
    if (FALSE) { +merged_DT <- echodata::Nalls2019_merged +merged_DT <- order_loci( + dat = merged_DT, + merged_DT = merged_DT, + descending = FALSE +) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/peak_overlap.html b/docs/reference/peak_overlap.html new file mode 100644 index 0000000..2071766 --- /dev/null +++ b/docs/reference/peak_overlap.html @@ -0,0 +1,166 @@ + + + + + + + + +Get overlap between SNPs and epigenomic peaks — peak_overlap • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Get overlap between SNPs and epigenomic peaks

    +
    + +
    peak_overlap(
    +  merged_DT,
    +  snp_filter = "!is.na(SNP)",
    +  include.NOTT_2019_peaks = TRUE,
    +  include.NOTT_2019_enhancers_promoters = TRUE,
    +  include.NOTT_2019_PLACseq = TRUE,
    +  include.CORCES_2020_scATACpeaks = TRUE,
    +  include.CORCES_2020_Cicero_coaccess = TRUE,
    +  include.CORCES_2020_bulkATACpeaks = TRUE,
    +  include.CORCES_2020_HiChIP_FitHiChIP_coaccess = TRUE,
    +  include.CORCES_2020_gene_annotations = TRUE,
    +  verbose = T
    +)
    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/peak_overlap_plot-1.png b/docs/reference/peak_overlap_plot-1.png new file mode 100644 index 0000000..eb2ca75 Binary files /dev/null and b/docs/reference/peak_overlap_plot-1.png differ diff --git a/docs/reference/peak_overlap_plot-2.png b/docs/reference/peak_overlap_plot-2.png new file mode 100644 index 0000000..c829831 Binary files /dev/null and b/docs/reference/peak_overlap_plot-2.png differ diff --git a/docs/reference/peak_overlap_plot.html b/docs/reference/peak_overlap_plot.html new file mode 100644 index 0000000..d34f0c0 --- /dev/null +++ b/docs/reference/peak_overlap_plot.html @@ -0,0 +1,236 @@ + + + + + + + + +Plot overlap between some SNP group and various epigenomic data — peak_overlap_plot • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Plot overlap between some SNP group and various epigenomic data

    +
    + +
    peak_overlap_plot(
    +  merged_DT,
    +  snp_filter = "Consensus_SNP==TRUE",
    +  include.NOTT_2019_peaks = TRUE,
    +  include.NOTT_2019_enhancers_promoters = TRUE,
    +  include.NOTT_2019_PLACseq = TRUE,
    +  include.CORCES_2020_scATACpeaks = TRUE,
    +  include.CORCES_2020_Cicero_coaccess = TRUE,
    +  include.CORCES_2020_bulkATACpeaks = TRUE,
    +  include.CORCES_2020_HiChIP_FitHiChIP_coaccess = TRUE,
    +  include.CORCES_2020_gene_annotations = TRUE,
    +  plot_celltype_specificity = TRUE,
    +  plot_celltype_specificity_genes = FALSE,
    +  facets_formula = ". ~ Cell_type",
    +  show_plot = TRUE,
    +  label_yaxis = TRUE,
    +  x_strip_angle = 90,
    +  x_tick_angle = 40,
    +  drop_empty_cols = F,
    +  fill_title = paste(snp_filter, "\nin epigenomic peaks"),
    +  save_path = F,
    +  height = 11,
    +  width = 12,
    +  subplot_widths = c(1, 0.5),
    +  verbose = TRUE
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    include.NOTT_2019_peaks

    Plot SNP subset overlap with +peaks from cell-type-specific bulk ATAC, H3K27ac, and H3K4me3 assays.

    include.NOTT_2019_enhancers_promoters

    Plot SNP subset overlap with +cell enhancers and promoters.

    include.CORCES_2020_scATACpeaks

    Plot SNP subset overlap with +cell-type-specific scATAC-seq peaks.

    include.CORCES_2020_Cicero_coaccess

    Plot SNP subset overlap with +Cicero coaccessibility peaks (derived from scATACseq).

    + +

    Source

    + +

    +Nott et al. (2019) + +Corces et al. (2020/bioRxiv)

    +

    See also

    + + + +

    Examples

    +
    # Consensus SNPs +gg_peaks <- peak_overlap_plot( + merged_DT = echodata::Nalls2019_merged, + snp_filter = "Consensus_SNP==T", + fill_title = "Consensus SNPs in epigenomic peaks" +) +
    #> ++ NOTT_2019:: Downloading and merging 12 peaks BED files.
    #> ++ NOTT_2019:: Downloading ATAC/NeuN_optimal_peak_IDR_ENCODE.ATAC.bed
    #> ++ NOTT_2019:: Downloading ATAC/PU1_optimal_peak_IDR_ENCODE.ATAC.bed
    #> ++ NOTT_2019:: Downloading ATAC/Olig2_optimal_peak_IDR_ENCODE.ATAC.bed
    #> ++ NOTT_2019:: Downloading ATAC/LHX2_optimal_peak_IDR_ENCODE.ATAC.bed
    #> ++ NOTT_2019:: Downloading H3K27ac/NeuN_optimal_peak.H3K27.bed
    #> ++ NOTT_2019:: Downloading H3K27ac/PU1_optimal_peak.H3K27.bed
    #> ++ NOTT_2019:: Downloading H3K27ac/Olig2_optimal_peak.H3K27.bed
    #> ++ NOTT_2019:: Downloading H3K27ac/LHX2_optimal_peak.H3K27.bed
    #> ++ NOTT_2019:: Downloading H3K4me3/NeuN_optimal_peak.H3K4me3.bed
    #> ++ NOTT_2019:: Downloading H3K4me3/PU1_optimal_peak.H3K4me3.bed
    #> ++ NOTT_2019:: Downloading H3K4me3/Olig2_optimal_peak.H3K4me3.bed
    #> ++ NOTT_2019:: Downloading H3K4me3/LHX2_optimal_peak.H3K4me3.bed
    #> ++ NOTT_2019:: Converting merged BED files to GRanges.
    #> ++ NOTT_2019:: 634540 ranges retrieved.
    #> 140 query SNP(s) detected with reference overlap.
    #> Warning: The `.dots` argument of `group_by()` is deprecated as of dplyr 1.0.0.
    #> Importing Astrocyte enhancers ...
    #> Importing Astrocyte promoters ...
    #> Importing Neuronal enhancers ...
    #> Importing Neuronal promoters ...
    #> Importing Oligo enhancers ...
    #> Importing Oligo promoters ...
    #> Importing Microglia enhancers ...
    #> Importing Microglia promoters ...
    #> ++ Converting to GRanges.
    #> 108 query SNP(s) detected with reference overlap.
    #> Importing Microglia interactome ...
    #> Importing Neuronal interactome ...
    #> Importing Oligo interactome ...
    #> 210 query SNP(s) detected with reference overlap.
    #> 169 query SNP(s) detected with reference overlap.
    #> CORCES_2020:: Extracting overlapping cell-type-specific scATAC-seq peaks
    #> Performing liftover: hg38 ==> hg19
    #> /var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T//RtmprlbVSo/hg19ToHg38.over.chain.gz
    #> 4 query SNP(s) detected with reference overlap.
    #> + CORCES_2020:: No Cicero hits found.
    #> CORCES_2020:: Annotating peaks by cell-type-specific target genes
    #> CORCES_2020:: Extracting overlapping bulkATAC-seq peaks from brain tissue
    #> Performing liftover: hg38 ==> hg19
    #> 3 query SNP(s) detected with reference overlap.
    #> CORCES_2020:: Annotating peaks by bulk brain target genes
    #> Error in if (!is.null(convert_ref_genome) && toupper(convert_ref_genome) != : +#> missing value where TRUE/FALSE needed
    # UCS SNPs +gg_peaks <- peak_overlap_plot( + merged_DT = echodata::Nalls2019_merged, + snp_filter = "Support>0", + fill_title = "UCS SNPs in epigenomic peaks" +) +
    #> ++ NOTT_2019:: Downloading and merging 12 peaks BED files.
    #> ++ NOTT_2019:: Downloading ATAC/NeuN_optimal_peak_IDR_ENCODE.ATAC.bed
    #> ++ NOTT_2019:: Downloading ATAC/PU1_optimal_peak_IDR_ENCODE.ATAC.bed
    #> ++ NOTT_2019:: Downloading ATAC/Olig2_optimal_peak_IDR_ENCODE.ATAC.bed
    #> ++ NOTT_2019:: Downloading ATAC/LHX2_optimal_peak_IDR_ENCODE.ATAC.bed
    #> ++ NOTT_2019:: Downloading H3K27ac/NeuN_optimal_peak.H3K27.bed
    #> ++ NOTT_2019:: Downloading H3K27ac/PU1_optimal_peak.H3K27.bed
    #> ++ NOTT_2019:: Downloading H3K27ac/Olig2_optimal_peak.H3K27.bed
    #> ++ NOTT_2019:: Downloading H3K27ac/LHX2_optimal_peak.H3K27.bed
    #> ++ NOTT_2019:: Downloading H3K4me3/NeuN_optimal_peak.H3K4me3.bed
    #> ++ NOTT_2019:: Downloading H3K4me3/PU1_optimal_peak.H3K4me3.bed
    #> ++ NOTT_2019:: Downloading H3K4me3/Olig2_optimal_peak.H3K4me3.bed
    #> ++ NOTT_2019:: Downloading H3K4me3/LHX2_optimal_peak.H3K4me3.bed
    #> ++ NOTT_2019:: Converting merged BED files to GRanges.
    #> ++ NOTT_2019:: 634540 ranges retrieved.
    #> 386 query SNP(s) detected with reference overlap.
    #> Importing Astrocyte enhancers ...
    #> Importing Astrocyte promoters ...
    #> Importing Neuronal enhancers ...
    #> Importing Neuronal promoters ...
    #> Importing Oligo enhancers ...
    #> Importing Oligo promoters ...
    #> Importing Microglia enhancers ...
    #> Importing Microglia promoters ...
    #> ++ Converting to GRanges.
    #> 311 query SNP(s) detected with reference overlap.
    #> Importing Microglia interactome ...
    #> Importing Neuronal interactome ...
    #> Importing Oligo interactome ...
    #> 861 query SNP(s) detected with reference overlap.
    #> 699 query SNP(s) detected with reference overlap.
    #> CORCES_2020:: Extracting overlapping cell-type-specific scATAC-seq peaks
    #> Performing liftover: hg38 ==> hg19
    #> 16 query SNP(s) detected with reference overlap.
    #> + CORCES_2020:: Cicero coaccessibility scores identified for 1 / 16 peak hits.
    #> CORCES_2020:: Annotating peaks by cell-type-specific target genes
    #> CORCES_2020:: Extracting overlapping bulkATAC-seq peaks from brain tissue
    #> Performing liftover: hg38 ==> hg19
    #> 12 query SNP(s) detected with reference overlap.
    #> CORCES_2020:: Annotating peaks by bulk brain target genes
    #> Error in if (!is.null(convert_ref_genome) && toupper(convert_ref_genome) != : +#> missing value where TRUE/FALSE needed
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/plot_dataset_overlap.html b/docs/reference/plot_dataset_overlap.html new file mode 100644 index 0000000..c81ab63 --- /dev/null +++ b/docs/reference/plot_dataset_overlap.html @@ -0,0 +1,174 @@ + + + + + + + + +Plot inter-study SNP overlap — plot_dataset_overlap • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Cross-tabulate SNP overlap (after applying filter) +between each pair of studies.

    +
    + +
    plot_dataset_overlap(
    +  merged_DT,
    +  snp_filter = "!is.na(SNP)",
    +  filename = NA,
    +  formula_str = "~ SNP + Dataset",
    +  triangle = FALSE,
    +  proxies = NULL
    +)
    + + +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/plot_missense.html b/docs/reference/plot_missense.html new file mode 100644 index 0000000..c8fccee --- /dev/null +++ b/docs/reference/plot_missense.html @@ -0,0 +1,187 @@ + + + + + + + + +Plot any missense variants — plot_missense • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Plot any missense variants

    +
    + +
    plot_missense(
    +  merged_DT,
    +  snp_filter = "Support>0",
    +  label_yaxis = FALSE,
    +  x_label = "UCS missense\nmutations",
    +  show.legend = TRUE,
    +  show_numbers = FALSE,
    +  show_plot = TRUE
    +)
    + + +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +merged_DT <- echodata::Nalls2019_merged +gg_missense <- plot_missense( + merged_DT = merged_DT, + snp_filter = "Support>0" +) +gg_missense <- plot_missense( + merged_DT = merged_DT, + snp_filter = "Consensus_SNP==TRUE" +) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/rbind_granges.html b/docs/reference/rbind_granges.html new file mode 100644 index 0000000..1028450 --- /dev/null +++ b/docs/reference/rbind_granges.html @@ -0,0 +1,154 @@ + + + + + + + + +Bind GRanges with different mcols — rbind_granges • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Bind GRanges with different mcols

    +
    + +
    rbind_granges(gr1, gr2)
    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/results_report.html b/docs/reference/results_report.html new file mode 100644 index 0000000..0a1eb32 --- /dev/null +++ b/docs/reference/results_report.html @@ -0,0 +1,173 @@ + + + + + + + + +Give a quick summary report of the fine-mapping results — results_report • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Give a quick summary report of the fine-mapping results

    +
    + +
    results_report(merged_dat)
    + + +

    Value

    + +

    Null

    +

    See also

    + + + +

    Examples

    +
    if (FALSE) { +results_report(echodata::Nalls2019_merged) +} +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/snps_by_mutation_type.html b/docs/reference/snps_by_mutation_type.html new file mode 100644 index 0000000..c1691ac --- /dev/null +++ b/docs/reference/snps_by_mutation_type.html @@ -0,0 +1,170 @@ + + + + + + + + +Return only the missense SNPs — snps_by_mutation_type • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Return only the missense SNPs

    +
    + +
    snps_by_mutation_type(merged_results, mutation_type = "missense_variant")
    + + +

    Source

    + +

    +biomaRt

    +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/source_all.html b/docs/reference/source_all.html new file mode 100644 index 0000000..59bae26 --- /dev/null +++ b/docs/reference/source_all.html @@ -0,0 +1,174 @@ + + + + + + + + +source_all — source_all • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Source all files in a directory at once. +Also loads selected libraries.

    +
    + +
    source_all(path = "R/", pattern = "*.R$", packages = "dplyr")
    + +

    Arguments

    + + + + + + + + + + +
    path

    a character vector of full path names; the default + corresponds to the working directory, getwd(). Tilde + expansion (see path.expand) is performed. Missing + values will be ignored. Elements with a marked encoding will + be converted to the native encoding (and if that fails, considered + non-existent).

    pattern

    an optional regular expression. Only file names + which match the regular expression will be returned.

    + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/super_summary_plot.html b/docs/reference/super_summary_plot.html new file mode 100644 index 0000000..195eaa9 --- /dev/null +++ b/docs/reference/super_summary_plot.html @@ -0,0 +1,175 @@ + + + + + + + + +Merge all summary plots into one super plot — super_summary_plot • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Merge all summary plots into one super plot

    +
    + +
    super_summary_plot(
    +  merged_DT,
    +  snp_filter = "Consensus_SNP==TRUE",
    +  coloc_results = NULL,
    +  plot_missense = TRUE,
    +  show_plot = TRUE,
    +  save_plot = FALSE,
    +  height = 15,
    +  width = 13,
    +  dpi = 500
    +)
    + + +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/update_cols.html b/docs/reference/update_cols.html new file mode 100644 index 0000000..1e46019 --- /dev/null +++ b/docs/reference/update_cols.html @@ -0,0 +1,159 @@ + + + + + + + + +Update CS cols — update_cols • echoannot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Convert old column format: ".Credible_Set" => ".CS"

    +
    + +
    update_cols(finemap_dat)
    + + + +

    Examples

    +
    if (FALSE) { +finemap_DT <- update_cols(finemap_dat = echodata::BST1) +} +
    +
    + +
    + + + +
    + + + + + + + + diff --git a/inst/.DS_Store b/inst/.DS_Store new file mode 100644 index 0000000..9717f4c Binary files /dev/null and b/inst/.DS_Store differ diff --git a/inst/extdata/Nott_2019/Nott_2019.snEpigenomics.xlsx b/inst/extdata/Nott_2019/Nott_2019.snEpigenomics.xlsx new file mode 100644 index 0000000..f7ce46d Binary files /dev/null and b/inst/extdata/Nott_2019/Nott_2019.snEpigenomics.xlsx differ diff --git a/inst/extdata/ROADMAP/ROADMAP_Epigenomic.js b/inst/extdata/ROADMAP/ROADMAP_Epigenomic.js new file mode 100755 index 0000000..170d1c0 --- /dev/null +++ b/inst/extdata/ROADMAP/ROADMAP_Epigenomic.js @@ -0,0 +1,129 @@ +roadmapCellData ="""EID GROUP ANATOMY GR Epigenome Mnemonic Standardized Epigenome name (from Wouter) Epigenome name (from EDACC Release 9 directory) TYPE +E033 Blood & T-cell BLOOD Blood_and_Tcell BLD.CD3.CPC Primary T cells from cord blood CD3_Primary_Cells_Cord_BI PrimaryCell +E034 Blood & T-cell BLOOD Blood_and_Tcell BLD.CD3.PPC Primary T cells from peripheral blood CD3_Primary_Cells_Peripheral_UW PrimaryCell +E037 Blood & T-cell BLOOD Blood_and_Tcell BLD.CD4.MPC Primary T helper memory cells from peripheral blood 2 CD4_Memory_Primary_Cells PrimaryCell +E038 Blood & T-cell BLOOD Blood_and_Tcell BLD.CD4.NPC Primary T helper naive cells from peripheral blood CD4_Naive_Primary_Cells PrimaryCell +E039 Blood & T-cell BLOOD Blood_and_Tcell BLD.CD4.CD25M.CD45RA.NPC Primary T helper naive cells from peripheral blood CD4+_CD25-_CD45RA+_Naive_Primary_Cells PrimaryCell +E040 Blood & T-cell BLOOD Blood_and_Tcell BLD.CD4.CD25M.CD45RO.MPC Primary T helper memory cells from peripheral blood 1 CD4+_CD25-_CD45RO+_Memory_Primary_Cells PrimaryCell +E041 Blood & T-cell BLOOD Blood_and_Tcell BLD.CD4.CD25M.IL17M.PL.TPC Primary T helper cells PMA-I stimulated CD4+_CD25-_IL17-_PMA-Ionomycin_stimulated_MACS_purified_Th_Primary_Cells PrimaryCell +E042 Blood & T-cell BLOOD Blood_and_Tcell BLD.CD4.CD25M.IL17P.PL.TPC Primary T helper 17 cells PMA-I stimulated CD4+_CD25-_IL17+_PMA-Ionomcyin_stimulated_Th17_Primary_Cells PrimaryCell +E043 Blood & T-cell BLOOD Blood_and_Tcell BLD.CD4.CD25M.TPC Primary T helper cells from peripheral blood CD4+_CD25-_Th_Primary_Cells PrimaryCell +E044 Blood & T-cell BLOOD Blood_and_Tcell BLD.CD4.CD25.CD127M.TREGPC Primary T regulatory cells from peripheral blood CD4+_CD25+_CD127-_Treg_Primary_Cells PrimaryCell +E045 Blood & T-cell BLOOD Blood_and_Tcell BLD.CD4.CD25I.CD127.TMEMPC Primary T cells effector/memory enriched from peripheral blood CD4+_CD25int_CD127+_Tmem_Primary_Cells PrimaryCell +E047 Blood & T-cell BLOOD Blood_and_Tcell BLD.CD8.NPC Primary T CD8+ naive cells from peripheral blood CD8_Naive_Primary_Cells PrimaryCell +E048 Blood & T-cell BLOOD Blood_and_Tcell BLD.CD8.MPC Primary T CD8+ memory cells from peripheral blood CD8_Memory_Primary_Cells PrimaryCell +E062 Blood & T-cell BLOOD Blood_and_Tcell BLD.PER.MONUC.PC Primary mononuclear cells from peripheral blood Peripheral_Blood_Mononuclear_Primary_Cells PrimaryCell +E053 Neurosph BRAIN Brain BRN.CRTX.DR.NRSPHR Cortex derived primary cultured neurospheres Neurosphere_Cultured_Cells_Cortex_Derived PrimaryCulture +E054 Neurosph BRAIN Brain BRN.GANGEM.DR.NRSPHR Ganglion Eminence derived primary cultured neurospheres Neurosphere_Cultured_Cells_Ganglionic_Eminence_Derived PrimaryCulture +E067 Brain BRAIN Brain BRN.ANG.GYR Brain Angular Gyrus Brain_Angular_Gyrus PrimaryTissue +E068 Brain BRAIN Brain BRN.ANT.CAUD Brain Anterior Caudate Brain_Anterior_Caudate PrimaryTissue +E069 Brain BRAIN Brain BRN.CING.GYR Brain Cingulate Gyrus Brain_Cingulate_Gyrus PrimaryTissue +E070 Brain BRAIN Brain BRN.GRM.MTRX Brain Germinal Matrix Brain_Germinal_Matrix PrimaryTissue +E071 Brain BRAIN Brain BRN.HIPP.MID Brain Hippocampus Middle Brain_Hippocampus_Middle PrimaryTissue +E072 Brain BRAIN Brain BRN.INF.TMP Brain Inferior Temporal Lobe Brain_Inferior_Temporal_Lobe PrimaryTissue +E073 Brain BRAIN Brain BRN.DL.PRFRNTL.CRTX Brain_Dorsolateral_Prefrontal_Cortex Brain_Mid_Frontal_Lobe PrimaryTissue +E074 Brain BRAIN Brain BRN.SUB.NIG Brain Substantia Nigra Brain_Substantia_Nigra PrimaryTissue +E081 Brain BRAIN Brain BRN.FET.M Fetal Brain Male Fetal_Brain_Male PrimaryTissue +E082 Brain BRAIN Brain BRN.FET.F Fetal Brain Female Fetal_Brain_Female PrimaryTissue +E075 Digestive GI_COLON Digestive GI.CLN.MUC Colonic Mucosa Colonic_Mucosa PrimaryTissue +E077 Digestive GI_DUODENUM Digestive GI.DUO.MUC Duodenum Mucosa Duodenum_Mucosa PrimaryTissue +E079 Digestive GI_ESOPHAGUS Digestive GI.ESO Esophagus Esophagus PrimaryTissue +E084 Digestive GI_INTESTINE Digestive GI.L.INT.FET Fetal Intestine Large Fetal_Intestine_Large PrimaryTissue +E085 Digestive GI_INTESTINE Digestive GI.S.INT.FET Fetal Intestine Small Fetal_Intestine_Small PrimaryTissue +E092 Digestive GI_STOMACH Digestive GI.STMC.FET Fetal Stomach Fetal_Stomach PrimaryTissue +E094 Digestive GI_STOMACH Digestive GI.STMC.GAST Gastric Gastric PrimaryTissue +E101 Digestive GI_RECTUM Digestive GI.RECT.MUC.29 Rectal Mucosa Donor 29 Rectal_Mucosa.Donor_29 PrimaryTissue +E102 Digestive GI_RECTUM Digestive GI.RECT.MUC.31 Rectal Mucosa Donor 31 Rectal_Mucosa.Donor_31 PrimaryTissue +E106 Digestive GI_COLON Digestive GI.CLN.SIG Sigmoid Colon Sigmoid_Colon PrimaryTissue +E109 Digestive GI_INTESTINE Digestive GI.S.INT Small Intestine Small_Intestine PrimaryTissue +E110 Digestive GI_STOMACH Digestive GI.STMC.MUC Stomach Mucosa Stomach_Mucosa PrimaryTissue +E114 ENCODE2012 LUNG ENCODE2012 LNG.A549.ETOH002.CNCR A549 EtOH 0.02pct Lung Carcinoma Cell Line A549_EtOH_0.02pct_Lung_Carcinoma CellLine +E115 ENCODE2012 BLOOD ENCODE2012 BLD.DND41.CNCR Dnd41 TCell Leukemia Cell Line Dnd41_TCell_Leukemia CellLine +E116 ENCODE2012 BLOOD ENCODE2012 BLD.GM12878 GM12878 Lymphoblastoid Cells GM12878_Lymphoblastoid PrimaryCulture +E117 ENCODE2012 CERVIX ENCODE2012 CRVX.HELAS3.CNCR HeLa-S3 Cervical Carcinoma Cell Line HeLa-S3_Cervical_Carcinoma CellLine +E118 ENCODE2012 LIVER ENCODE2012 LIV.HEPG2.CNCR HepG2 Hepatocellular Carcinoma Cell Line HepG2_Hepatocellular_Carcinoma CellLine +E119 ENCODE2012 BREAST ENCODE2012 BRST.HMEC HMEC Mammary Epithelial Primary Cells HMEC_Mammary_Epithelial PrimaryCulture +E120 ENCODE2012 MUSCLE ENCODE2012 MUS.HSMM HSMM Skeletal Muscle Myoblasts Cells HSMM_Skeletal_Muscle_Myoblasts PrimaryCulture +E121 ENCODE2012 MUSCLE ENCODE2012 MUS.HSMMT HSMM cell derived Skeletal Muscle Myotubes Cells HSMMtube_Skeletal_Muscle_Myotubes_Derived_from_HSMM PrimaryCulture +E122 ENCODE2012 VASCULAR ENCODE2012 VAS.HUVEC HUVEC Umbilical Vein Endothelial Primary Cells HUVEC_Umbilical_Vein_Endothelial_Cells PrimaryCulture +E123 ENCODE2012 BLOOD ENCODE2012 BLD.K562.CNCR K562 Leukemia Cells K562_Leukemia PrimaryCulture +E124 ENCODE2012 BLOOD ENCODE2012 BLD.CD14.MONO Monocytes-CD14+ RO01746 Primary Cells Monocytes-CD14+_RO01746 PrimaryCell +E125 ENCODE2012 BRAIN ENCODE2012 BRN.NHA NH-A Astrocytes Primary Cells NH-A_Astrocytes PrimaryCulture +E126 ENCODE2012 SKIN ENCODE2012 SKIN.NHDFAD NHDF-Ad Adult Dermal Fibroblast Primary Cells NHDF-Ad_Adult_Dermal_Fibroblasts PrimaryCulture +E127 ENCODE2012 SKIN ENCODE2012 SKIN.NHEK NHEK-Epidermal Keratinocyte Primary Cells NHEK-Epidermal_Keratinocytes PrimaryCulture +E128 ENCODE2012 LUNG ENCODE2012 LNG.NHLF NHLF Lung Fibroblast Primary Cells NHLF_Lung_Fibroblasts PrimaryCulture +E129 ENCODE2012 BONE ENCODE2012 BONE.OSTEO Osteoblast Primary Cells Osteoblasts PrimaryCulture +E027 Epithelial BREAST Epithelial BRST.MYO Breast Myoepithelial Primary Cells Breast_Myoepithelial_Cells PrimaryCell +E028 Epithelial BREAST Epithelial BRST.HMEC.35 Breast variant Human Mammary Epithelial Cells (vHMEC) Breast_vHMEC PrimaryCulture +E055 Epithelial SKIN Epithelial SKIN.PEN.FRSK.FIB.01 Foreskin Fibroblast Primary Cells skin01 Penis_Foreskin_Fibroblast_Primary_Cells_skin01 PrimaryCulture +E056 Epithelial SKIN Epithelial SKIN.PEN.FRSK.FIB.02 Foreskin Fibroblast Primary Cells skin02 Penis_Foreskin_Fibroblast_Primary_Cells_skin02 PrimaryCulture +E057 Epithelial SKIN Epithelial SKIN.PEN.FRSK.KER.02 Foreskin Keratinocyte Primary Cells skin02 Penis_Foreskin_Keratinocyte_Primary_Cells_skin02 PrimaryCulture +E058 Epithelial SKIN Epithelial SKIN.PEN.FRSK.KER.03 Foreskin Keratinocyte Primary Cells skin03 Penis_Foreskin_Keratinocyte_Primary_Cells_skin03 PrimaryCulture +E059 Epithelial SKIN Epithelial SKIN.PEN.FRSK.MEL.01 Foreskin Melanocyte Primary Cells skin01 Penis_Foreskin_Melanocyte_Primary_Cells_skin01 PrimaryCulture +E061 Epithelial SKIN Epithelial SKIN.PEN.FRSK.MEL.03 Foreskin Melanocyte Primary Cells skin03 Penis_Foreskin_Melanocyte_Primary_Cells_skin03 PrimaryCulture +E004 ES-deriv ESC_DERIVED ES-deriv ESDR.H1.BMP4.MESO H1 BMP4 Derived Mesendoderm Cultured Cells H1_BMP4_Derived_Mesendoderm_Cultured_Cells ESCDerived +E005 ES-deriv ESC_DERIVED ES-deriv ESDR.H1.BMP4.TROP H1 BMP4 Derived Trophoblast Cultured Cells H1_BMP4_Derived_Trophoblast_Cultured_Cells ESCDerived +E006 ES-deriv ESC_DERIVED ES-deriv ESDR.H1.MSC H1 Derived Mesenchymal Stem Cells H1_Derived_Mesenchymal_Stem_Cells ESCDerived +E007 ES-deriv ESC_DERIVED ES-deriv ESDR.H1.NEUR.PROG H1 Derived Neuronal Progenitor Cultured Cells H1_Derived_Neuronal_Progenitor_Cultured_Cells ESCDerived +E009 ES-deriv ESC_DERIVED ES-deriv ESDR.H9.NEUR.PROG H9 Derived Neuronal Progenitor Cultured Cells H9_Derived_Neuronal_Progenitor_Cultured_Cells ESCDerived +E010 ES-deriv ESC_DERIVED ES-deriv ESDR.H9.NEUR H9 Derived Neuron Cultured Cells H9_Derived_Neuron_Cultured_Cells ESCDerived +E011 ES-deriv ESC_DERIVED ES-deriv ESDR.CD184.ENDO hESC Derived CD184+ Endoderm Cultured Cells hESC_Derived_CD184+_Endoderm_Cultured_Cells ESCDerived +E012 ES-deriv ESC_DERIVED ES-deriv ESDR.CD56.ECTO hESC Derived CD56+ Ectoderm Cultured Cells hESC_Derived_CD56+_Ectoderm_Cultured_Cells ESCDerived +E013 ES-deriv ESC_DERIVED ES-deriv ESDR.CD56.MESO hESC Derived CD56+ Mesoderm Cultured Cells hESC_Derived_CD56+_Mesoderm_Cultured_Cells ESCDerived +E001 ESC ESC ESC ESC.I3 ES-I3 Cells ES-I3_Cell_Line PrimaryCulture +E002 ESC ESC ESC ESC.WA7 ES-WA7 Cells ES-WA7_Cell_Line PrimaryCulture +E003 ESC ESC ESC ESC.H1 H1 Cells H1_Cell_Line PrimaryCulture +E008 ESC ESC ESC ESC.H9 H9 Cells H9_Cell_Line PrimaryCulture +E014 ESC ESC ESC ESC.HUES48 HUES48 Cells HUES48_Cell_Line PrimaryCulture +E015 ESC ESC ESC ESC.HUES6 HUES6 Cells HUES6_Cell_Line PrimaryCulture +E016 ESC ESC ESC ESC.HUES64 HUES64 Cells HUES64_Cell_Line PrimaryCulture +E024 ESC ESC ESC ESC.4STAR ES-UCSF4 Cells 4star PrimaryCulture +E065 Heart VASCULAR Heart VAS.AOR Aorta Aorta PrimaryTissue +E083 Heart HEART Heart HRT.FET Fetal Heart Fetal_Heart PrimaryTissue +E095 Heart HEART Heart HRT.VENT.L Left Ventricle Left_Ventricle PrimaryTissue +E104 Heart HEART Heart HRT.ATR.R Right Atrium Right_Atrium PrimaryTissue +E105 Heart HEART Heart HRT.VNT.R Right Ventricle Right_Ventricle PrimaryTissue +E029 HSC & B-cell BLOOD HSC_and_Bcell BLD.CD14.PC Primary monocytes from peripheral blood CD14_Primary_Cells PrimaryCell +E030 HSC & B-cell BLOOD HSC_and_Bcell BLD.CD15.PC Primary neutrophils from peripheral blood CD15_Primary_Cells PrimaryCell +E031 HSC & B-cell BLOOD HSC_and_Bcell BLD.CD19.CPC Primary B cells from cord blood CD19_Primary_Cells_Cord_BI PrimaryCell +E032 HSC & B-cell BLOOD HSC_and_Bcell BLD.CD19.PPC Primary B cells from peripheral blood CD19_Primary_Cells_Peripheral_UW PrimaryCell +E035 HSC & B-cell BLOOD HSC_and_Bcell BLD.CD34.PC Primary hematopoietic stem cells CD34_Primary_Cells PrimaryCell +E036 HSC & B-cell BLOOD HSC_and_Bcell BLD.CD34.CC Primary hematopoietic stem cells short term culture CD34_Cultured_Cells PrimaryCell +E046 HSC & B-cell BLOOD HSC_and_Bcell BLD.CD56.PC Primary Natural Killer cells from peripheral blood CD56_Primary_Cells PrimaryCell +E050 HSC & B-cell BLOOD HSC_and_Bcell BLD.MOB.CD34.PC.F Primary hematopoietic stem cells G-CSF-mobilized Female Mobilized_CD34_Primary_Cells_Female PrimaryCell +E051 HSC & B-cell BLOOD HSC_and_Bcell BLD.MOB.CD34.PC.M Primary hematopoietic stem cells G-CSF-mobilized Male Mobilized_CD34_Primary_Cells_Male PrimaryCell +E018 iPSC IPSC iPSC IPSC.15b iPS-15b Cells iPS-15b_Cell_Line PrimaryCulture +E019 iPSC IPSC iPSC IPSC.18 iPS-18 Cells iPS-18_Cell_Line PrimaryCulture +E020 iPSC IPSC iPSC IPSC.20B iPS-20b Cells iPS-20b_Cell_Line PrimaryCulture +E021 iPSC IPSC iPSC IPSC.DF.6.9 iPS DF 6.9 Cells iPS_DF_6.9_Cell_Line PrimaryCulture +E022 iPSC IPSC iPSC IPSC.DF.19.11 iPS DF 19.11 Cells iPS_DF_19.11_Cell_Line PrimaryCulture +E023 Mesench FAT Mesench FAT.MSC.DR.ADIP Mesenchymal Stem Cell Derived Adipocyte Cultured Cells Mesenchymal_Stem_Cell_Derived_Adipocyte_Cultured_Cells PrimaryCulture +E025 Mesench FAT Mesench FAT.ADIP.DR.MSC Adipose Derived Mesenchymal Stem Cell Cultured Cells Adipose_Derived_Mesenchymal_Stem_Cell_Cultured_Cells PrimaryCulture +E026 Mesench STROMAL_CONNECTIVE Mesench STRM.MRW.MSC Bone Marrow Derived Cultured Mesenchymal Stem Cells Bone_Marrow_Derived_Mesenchymal_Stem_Cell_Cultured_Cells PrimaryCulture +E049 Mesench STROMAL_CONNECTIVE Mesench STRM.CHON.MRW.DR.MSC Mesenchymal Stem Cell Derived Chondrocyte Cultured Cells Chondrocytes_from_Bone_Marrow_Derived_Mesenchymal_Stem_Cell_Cultured_Cells PrimaryCulture +E052 Myosat MUSCLE Muscle MUS.SAT Muscle Satellite Cultured Cells Muscle_Satellite_Cultured_Cells PrimaryCulture +E089 Muscle MUSCLE Muscle MUS.TRNK.FET Fetal Muscle Trunk Fetal_Muscle_Trunk PrimaryTissue +E090 Muscle MUSCLE_LEG Muscle MUS.LEG.FET Fetal Muscle Leg Fetal_Muscle_Leg PrimaryTissue +E100 Muscle MUSCLE Muscle MUS.PSOAS Psoas Muscle Psoas_Muscle PrimaryTissue +E107 Muscle MUSCLE Muscle MUS.SKLT.M Skeletal Muscle Male Skeletal_Muscle_Male PrimaryTissue +E108 Muscle MUSCLE Muscle MUS.SKLT.F Skeletal Muscle Female Skeletal_Muscle_Female PrimaryTissue +E017 IMR90 LUNG Other LNG.IMR90 IMR90 fetal lung fibroblasts Cell Line IMR90_Cell_Line CellLine +E063 Adipose FAT Other FAT.ADIP.NUC Adipose Nuclei Adipose_Nuclei PrimaryTissue +E066 Other LIVER Other LIV.ADLT Liver Adult_Liver PrimaryTissue +E076 Sm. Muscle GI_COLON Other GI.CLN.SM.MUS Colon Smooth Muscle Colon_Smooth_Muscle PrimaryTissue +E078 Sm. Muscle GI_DUODENUM Other GI.DUO.SM.MUS Duodenum Smooth Muscle Duodenum_Smooth_Muscle PrimaryTissue +E080 Other ADRENAL Other ADRL.GLND.FET Fetal Adrenal Gland Fetal_Adrenal_Gland PrimaryTissue +E086 Other KIDNEY Other KID.FET Fetal Kidney Fetal_Kidney PrimaryTissue +E087 Other PANCREAS Other PANC.ISLT Pancreatic Islets Pancreatic_Islets PrimaryTissue +E088 Other LUNG Other LNG.FET Fetal Lung Fetal_Lung PrimaryTissue +E091 Other PLACENTA Other PLCNT.FET Placenta Fetal_Placenta PrimaryTissue +E093 Thymus THYMUS Other THYM.FET Fetal Thymus Fetal_Thymus PrimaryTissue +E096 Other LUNG Other LNG Lung Lung PrimaryTissue +E097 Other OVARY Other OVRY Ovary Ovary PrimaryTissue +E098 Other PANCREAS Other PANC Pancreas Pancreas PrimaryTissue +E099 Other PLACENTA Other PLCNT.AMN Placenta Amnion Placenta_Amnion PrimaryTissue +E103 Sm. Muscle GI_RECTUM Other GI.RECT.SM.MUS Rectal Smooth Muscle Rectal_Smooth_Muscle PrimaryTissue +E111 Sm. Muscle GI_STOMACH Other GI.STMC.MUS Stomach Smooth Muscle Stomach_Smooth_Muscle PrimaryTissue +E112 Thymus THYMUS Other THYM Thymus Thymus PrimaryTissue +E113 Other SPLEEN Other SPLN Spleen Spleen PrimaryTissue +""" \ No newline at end of file diff --git a/inst/extdata/ROADMAP/ROADMAP_chromatinState_HMM.tsv b/inst/extdata/ROADMAP/ROADMAP_chromatinState_HMM.tsv new file mode 100644 index 0000000..53530fe --- /dev/null +++ b/inst/extdata/ROADMAP/ROADMAP_chromatinState_HMM.tsv @@ -0,0 +1,19 @@ +STATE NO. MNEMONIC DESCRIPTION COLOR NAME COLOR CODE +1 TssA Active TSS Red 255,0,0 +2 TssFlnk Flanking TSS Orange Red 255,69,0 +3 TssFlnkU Flanking TSS Upstream Orange Red 255,69,0 +4 TssFlnkD Flanking TSS Downstream Orange Red 255,69,0 +5 Tx Strong transcription Green 0,128,0 +6 TxWk Weak transcription DarkGreen 0,100,0 +7 EnhG1 Genic enhancer1 GreenYellow 194,225,5 +8 EnhG2 Genic enhancer2 GreenYellow 194,225,5 +9 EnhA1 Active Enhancer 1 Orange 255,195,77 +10 EnhA2 Active Enhancer 2 Orange 255,195,77 +11 EnhWk Weak Enhancer Yellow 255,255,0 +12 ZNF/Rpts ZNF genes & repeats Medium Aquamarine 102,205,170 +13 Het Heterochromatin PaleTurquoise 138,145,208 +14 TssBiv Bivalent/Poised TSS IndianRed 205,92,92 +15 EnhBiv Bivalent Enhancer DarkKhaki 189,183,107 +16 ReprPC Repressed PolyComb Silver 128,128,128 +17 ReprPCWk Weak Repressed PolyComb Gainsboro 192,192,192 +18 Quies Quiescent/Low White 255,255,255 \ No newline at end of file diff --git a/man/GR.name_filter_convert.Rd b/man/GR.name_filter_convert.Rd new file mode 100644 index 0000000..b726333 --- /dev/null +++ b/man/GR.name_filter_convert.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/GR.name_filter_convert.R +\name{GR.name_filter_convert} +\alias{GR.name_filter_convert} +\title{GR.name_filter_convert} +\usage{ +GR.name_filter_convert(GR.final, GR.names, min_hits = 1) +} +\description{ +GR.name_filter_convert +} +\seealso{ +Other plot: +\code{\link{PLOT.get_window_limits}()} +} +\concept{plot} +\keyword{internal} diff --git a/man/PLOT.get_max_histogram_height.Rd b/man/PLOT.get_max_histogram_height.Rd new file mode 100644 index 0000000..3500d51 --- /dev/null +++ b/man/PLOT.get_max_histogram_height.Rd @@ -0,0 +1,12 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/PLOT.get_max_histogram_height.R +\name{PLOT.get_max_histogram_height} +\alias{PLOT.get_max_histogram_height} +\title{PLOT.get_max_histogram_height} +\usage{ +PLOT.get_max_histogram_height(gg, round_to = NULL, verbose = TRUE) +} +\description{ +PLOT.get_max_histogram_height +} +\keyword{internal} diff --git a/man/PLOT.get_window_limits.Rd b/man/PLOT.get_window_limits.Rd index abb9782..d20d1b4 100644 --- a/man/PLOT.get_window_limits.Rd +++ b/man/PLOT.get_window_limits.Rd @@ -21,5 +21,9 @@ xlims <- PLOT.get_window_limits(finemap_dat = BST1, plot.zoom = 50000) xlims <- PLOT.get_window_limits(finemap_dat = BST1, plot.zoom = "all") xlims <- PLOT.get_window_limits(finemap_dat = BST1, plot.zoom = "5x") } +\seealso{ +Other plot: +\code{\link{GR.name_filter_convert}()} +} \concept{plot} \keyword{internal} diff --git a/man/ROADMAP.construct_reference.Rd b/man/ROADMAP.construct_reference.Rd new file mode 100644 index 0000000..2703c7a --- /dev/null +++ b/man/ROADMAP.construct_reference.Rd @@ -0,0 +1,38 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ROADMAP.construct_reference.R +\name{ROADMAP.construct_reference} +\alias{ROADMAP.construct_reference} +\title{Gather Roadmap annotation metadata} +\usage{ +ROADMAP.construct_reference( + ref_path = system.file("extdata/ROADMAP", "ROADMAP_Epigenomic.js", package = + "echoannot"), + keyword_query = NULL +) +} +\arguments{ +\item{ref_path}{Where the ROADMAP metadata is stored.} + +\item{keyword_query}{Search all columns in the Roadmap annotations metadata +and only query annotations that contain your keywords. +Can provide multiple keywords in list form: +\code{c("placenta","liver","monocytes")}} +} +\description{ +Gather Roadmap annotation metadata +} +\examples{ +ref <- ROADMAP.construct_reference(keyword_query = c( + "placenta", + "liver", + "monocytes" +)) +} +\seealso{ +Other ROADMAP: +\code{\link{ROADMAP.merge_and_process_grl}()}, +\code{\link{ROADMAP.query_and_plot}()}, +\code{\link{ROADMAP.query}()}, +\code{\link{ROADMAP.tabix}()} +} +\concept{ROADMAP} diff --git a/man/ROADMAP.merge_and_process_grl.Rd b/man/ROADMAP.merge_and_process_grl.Rd new file mode 100644 index 0000000..e95b56e --- /dev/null +++ b/man/ROADMAP.merge_and_process_grl.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ROADMAP.merge_and_process_grl.R +\name{ROADMAP.merge_and_process_grl} +\alias{ROADMAP.merge_and_process_grl} +\title{Standardize Roadmap query} +\usage{ +ROADMAP.merge_and_process_grl( + grl.roadmap, + gr.snp, + n_top_tissues = 5, + sep = " " +) +} +\arguments{ +\item{grl.roadmap}{Roadmap query results} + +\item{n_top_tissues}{The number of top tissues to include, +sorted by greatest number of rows +(i.e. the number of genomic ranges within the window).} +} +\description{ +Standardize Roadmap query +} +\seealso{ +Other ROADMAP: +\code{\link{ROADMAP.construct_reference}()}, +\code{\link{ROADMAP.query_and_plot}()}, +\code{\link{ROADMAP.query}()}, +\code{\link{ROADMAP.tabix}()} +} +\concept{ROADMAP} diff --git a/man/ROADMAP.query.Rd b/man/ROADMAP.query.Rd new file mode 100644 index 0000000..c2e371c --- /dev/null +++ b/man/ROADMAP.query.Rd @@ -0,0 +1,44 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ROADMAP.query.R +\name{ROADMAP.query} +\alias{ROADMAP.query} +\title{Query Roadmap by genomic coordinates} +\usage{ +ROADMAP.query( + results_path = file.path(tempdir(), "Roadmap"), + gr.snp, + keyword_query = NULL, + limit_files = NULL, + nThread = 1, + verbose = TRUE +) +} +\arguments{ +\item{results_path}{Where to store query results.} + +\item{gr.snp}{\code{\link[GenomicRanges]{GRanges}} object of +SNPs to query Roadmap with.} + +\item{limit_files}{Limit the number of annotation files queried +(for faster testing).} + +\item{nThread}{Number of threads to parallelise queries over.} +} +\description{ +Query Roadmap by genomic coordinates +} +\examples{ +\dontrun{ +grl.roadmap <- ROADMAP.query( + gr.snp = echodata::BST1, + keyword_query = "placenta") +} +} +\seealso{ +Other ROADMAP: +\code{\link{ROADMAP.construct_reference}()}, +\code{\link{ROADMAP.merge_and_process_grl}()}, +\code{\link{ROADMAP.query_and_plot}()}, +\code{\link{ROADMAP.tabix}()} +} +\concept{ROADMAP} diff --git a/man/ROADMAP.query_and_plot.Rd b/man/ROADMAP.query_and_plot.Rd new file mode 100644 index 0000000..9fbc498 --- /dev/null +++ b/man/ROADMAP.query_and_plot.Rd @@ -0,0 +1,63 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ROADMAP.query_and_plot.R +\name{ROADMAP.query_and_plot} +\alias{ROADMAP.query_and_plot} +\title{Query and plot Roadmap epigenomic annotations} +\usage{ +ROADMAP.query_and_plot( + subset_DT, + results_path = file.path(tempdir(), "Roadmap"), + n_top_tissues = NULL, + keyword_query = NULL, + adjust = 0.2, + force_new_query = FALSE, + remove_tmps = TRUE, + verbose = TRUE +) +} +\arguments{ +\item{subset_DT}{Data.frame with at least the following columns: +\describe{ +\item{SNP}{SNP RSID} +\item{CHR}{chromosome} +\item{POS}{position} +}} + +\item{results_path}{Where to store query results.} + +\item{n_top_tissues}{The number of top tissues to include, +sorted by greatest number of rows +(i.e. the number of genomic ranges within the window).} + +\item{keyword_query}{Search all columns in the Roadmap annotations metadata +and only query annotations that contain your keywords. +Can provide multiple keywords in list form: +\code{c("placenta","liver","monocytes")}} + +\item{force_new_query}{Force a new query from the XGR database.} +} +\value{ +A named list containing: +\itemize{ +\item{\code{ggbio} plot} +\item{\code{GRanges} object within the queried coordinates} +} +} +\description{ +Query and plot Roadmap epigenomic annotations +} +\examples{ +\dontrun{ +roadmap_plot_query <- ROADMAP.query_and_plot( + subset_DT = echodata::BST1, + keyword_query = "monocytes") +} +} +\seealso{ +Other ROADMAP: +\code{\link{ROADMAP.construct_reference}()}, +\code{\link{ROADMAP.merge_and_process_grl}()}, +\code{\link{ROADMAP.query}()}, +\code{\link{ROADMAP.tabix}()} +} +\concept{ROADMAP} diff --git a/man/ROADMAP.tabix.Rd b/man/ROADMAP.tabix.Rd new file mode 100644 index 0000000..251ea8a --- /dev/null +++ b/man/ROADMAP.tabix.Rd @@ -0,0 +1,57 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ROADMAP.tabix.R +\name{ROADMAP.tabix} +\alias{ROADMAP.tabix} +\title{Query Roadmap API} +\usage{ +ROADMAP.tabix( + results_path = tempfile(fileext = "ROADMAP_query.csv.gz"), + chrom, + min_pos, + max_pos, + eid, + convert_to_granges = TRUE, + verbose = TRUE +) +} +\arguments{ +\item{results_path}{Where to store query results.} + +\item{chrom}{Chromosome to query} + +\item{min_pos}{Minimum genomic position} + +\item{max_pos}{Maximum genomic position} + +\item{eid}{Roadmap annotation ID} + +\item{convert_to_granges}{Whether to return query +as a \code{data.frame} or \code{\link[GenomicRanges]{GRanges}}.} +} +\description{ +Query Roadmap epigenomic annotations (chromatin marks) +using a range of genomic coordinates. +} +\details{ +\href{https://egg2.wustl.edu/roadmap/data/byFileType/chromhmmSegmentations/ChmmModels/coreMarks/jointModel/final/}{ +ROADMAP file locations.} +} +\examples{ +\dontrun{ +BST1 <- echodata::BST1 +dat <- ROADMAP.tabix(chrom=BST1$CHR[1], + min_pos = min(BST1$POS), + max_pos = max(BST1$POS), + eid = "E099") +} + +} +\seealso{ +Other ROADMAP: +\code{\link{ROADMAP.construct_reference}()}, +\code{\link{ROADMAP.merge_and_process_grl}()}, +\code{\link{ROADMAP.query_and_plot}()}, +\code{\link{ROADMAP.query}()} +} +\concept{ROADMAP} +\keyword{internal} diff --git a/man/ROADMAP.track_plot.Rd b/man/ROADMAP.track_plot.Rd new file mode 100644 index 0000000..0348a61 --- /dev/null +++ b/man/ROADMAP.track_plot.Rd @@ -0,0 +1,48 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ROADMAP.track_plot.R +\name{ROADMAP.track_plot} +\alias{ROADMAP.track_plot} +\title{Plot Roadmap query} +\usage{ +ROADMAP.track_plot( + grl.roadmap.filt, + gr.snp = NULL, + geom = "density", + adjust = 0.2, + show_plot = TRUE, + as.ggplot = TRUE +) +} +\arguments{ +\item{grl.roadmap.filt}{Roadmap query results.} + +\item{gr.snp}{Optionally, can include an extra \code{\link[GenomicRanges]{GRanges}} object +to ensure the plot does not extend beyond certain coordinates.} + +\item{geom}{The type of plot to create. +Options include "density" and "histogram".} + +\item{adjust}{The granularity of the peaks.} + +\item{show_plot}{Whether to print the plot.} +} +\description{ +Plot Roadmap query +} +\examples{ +\dontrun{ +gr.snp <- dt_to_granges(echodata::BST1) +grl.roadmap <- ROADMAP.query( + gr.snp = gr.snp, + keyword_query = "monocyte" +) +grl.roadmap.filt <- ROADMAP.merge_and_process_grl( + grl.roadmap = grl.roadmap, + gr.snp = gr.snp +) +track.roadmap <- ROADMAP.track_plot(grl.roadmap.filt, + gr.snp = gr.snp +) +} +} +\keyword{internal} diff --git a/man/XGR.download_and_standardize.Rd b/man/XGR.download_and_standardize.Rd new file mode 100644 index 0000000..47578d1 --- /dev/null +++ b/man/XGR.download_and_standardize.Rd @@ -0,0 +1,59 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/XGR.download_and_standardize.R +\name{XGR.download_and_standardize} +\alias{XGR.download_and_standardize} +\title{Download, standardize, and merge XGR annotations} +\usage{ +XGR.download_and_standardize( + lib.selections = c("ENCODE_TFBS_ClusteredV3_CellTypes", "TFBS_Conserved", + "Uniform_TFBS"), + as_grangesList = FALSE, + finemap_dat, + nThread = 1 +) +} +\arguments{ +\item{lib.selections}{Which XGR annotations to check overlap with. +For full list of libraries see +\href{http://xgr.r-forge.r-project.org/#annotations-at-the-genomic-region-level}{ + here.}} + +\item{as_grangesList}{Return as a \code{GRangesList}, +instead of a single merged \code{GRanges} object.} + +\item{finemap_dat}{Fine-mapping results.} + +\item{nThread}{Number of cores to parallelise across.} +} +\value{ +GRangesList +} +\description{ +Merges a list of XGR annotations into a single GRanges object +} +\examples{ +\dontrun{ +gr.lib <- XGR.download_and_standardize( + lib.selections = c("ENCODE_DNaseI_ClusteredV3_CellTypes"), + finemap_dat = echodata::BST1) +} +} +\seealso{ +Other XGR: +\code{\link{XGR.enrichment_bootstrap}()}, +\code{\link{XGR.enrichment_plot}()}, +\code{\link{XGR.enrichment}()}, +\code{\link{XGR.filter_assays}()}, +\code{\link{XGR.filter_sources}()}, +\code{\link{XGR.import_annotations}()}, +\code{\link{XGR.iterate_enrichment}()}, +\code{\link{XGR.iterate_overlap}()}, +\code{\link{XGR.merge_and_process}()}, +\code{\link{XGR.parse_metadata}()}, +\code{\link{XGR.plot_enrichment}()}, +\code{\link{XGR.plot_peaks}()}, +\code{\link{XGR.prepare_foreground_background}()}, +\code{\link{XGR.sep_handler}()}, +\code{\link{granges_to_bed}()} +} +\concept{XGR} diff --git a/man/XGR.enrichment.Rd b/man/XGR.enrichment.Rd new file mode 100644 index 0000000..e6268db --- /dev/null +++ b/man/XGR.enrichment.Rd @@ -0,0 +1,73 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/XGR.enrichment.R +\name{XGR.enrichment} +\alias{XGR.enrichment} +\title{XGR enrichment} +\usage{ +XGR.enrichment( + gr, + merged_dat, + foreground_filter = "Consensus_SNP==TRUE", + background_filter = NULL, + grouping_vars = c("Study", "Assay", "Cell_type"), + fg_sample_size = NULL, + bg_sample_size = NULL, + background.annotatable.only = FALSE, + verbose = TRUE +) +} +\arguments{ +\item{gr}{Annotations to test for enrichment with.} + +\item{merged_dat}{SNP-level fine-mapping results to test for enrichment with.} + +\item{foreground_filter}{Filter to apply to foreground (target SNPs).} + +\item{background_filter}{Filter to apply to background (non-target SNPs).} + +\item{grouping_vars}{Columns in \code{merged_dat} to group by when conducting +enrichment tests.} + +\item{fg_sample_size}{Foreground sample size.} + +\item{bg_sample_size}{Background sample size.} + +\item{background.annotatable.only}{For background SNPs, +only use SNPs that overlap with some annotation in \code{gr}. + This means that missing annotations (\code{NA}) will not be considered.} + +\item{verbose}{Print messages.} +} +\description{ +Run SNP-level enrichment test with \link[XGR]{xGRviaGenomicAnno}. +} +\examples{ +\dontrun{ +gr.merged <- echoannot::merge_celltype_specific_epigenomics() +enrich.lead <- XGR.enrichment( + gr = gr.merged, + merged_dat = echodata::Nalls2019_merged, + foreground_filter = "leadSNP==TRUE", + grouping_vars = c("Study", "Cell_type", "Assay") +) +} +} +\seealso{ +Other XGR: +\code{\link{XGR.download_and_standardize}()}, +\code{\link{XGR.enrichment_bootstrap}()}, +\code{\link{XGR.enrichment_plot}()}, +\code{\link{XGR.filter_assays}()}, +\code{\link{XGR.filter_sources}()}, +\code{\link{XGR.import_annotations}()}, +\code{\link{XGR.iterate_enrichment}()}, +\code{\link{XGR.iterate_overlap}()}, +\code{\link{XGR.merge_and_process}()}, +\code{\link{XGR.parse_metadata}()}, +\code{\link{XGR.plot_enrichment}()}, +\code{\link{XGR.plot_peaks}()}, +\code{\link{XGR.prepare_foreground_background}()}, +\code{\link{XGR.sep_handler}()}, +\code{\link{granges_to_bed}()} +} +\concept{XGR} diff --git a/man/XGR.enrichment_bootstrap.Rd b/man/XGR.enrichment_bootstrap.Rd new file mode 100644 index 0000000..bb1484b --- /dev/null +++ b/man/XGR.enrichment_bootstrap.Rd @@ -0,0 +1,79 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/XGR.enrichment_bootstrap.R +\name{XGR.enrichment_bootstrap} +\alias{XGR.enrichment_bootstrap} +\title{XGR enrichment (bootstrapped)} +\usage{ +XGR.enrichment_bootstrap( + gr, + merged_dat, + snp_groups = c("Random", "GWAS lead", "UCS (-PolyFun)", "UCS", + "Consensus (-PolyFun)", "Consensus"), + background_filter = NULL, + grouping_vars = c("Study", "Assay", "Cell_type"), + iterations = 1000, + fg_sample_size = 20, + bg_sample_size = NULL, + bootstrap = TRUE, + save_path = tempfile(fileext = "XGR_enrich_boot_res.csv.gz"), + nThread = 1, + verbose = TRUE +) +} +\arguments{ +\item{gr}{Annotations to test for enrichment with.} + +\item{merged_dat}{SNP-level fine-mapping results to test for enrichment with.} + +\item{snp_groups}{Which SNP groups to repeat enrichment tests for separately.} + +\item{background_filter}{Filter to apply to background (non-target SNPs).} + +\item{grouping_vars}{Columns in \code{merged_dat} to group by when conducting +enrichment tests.} + +\item{iterations}{Number of bootstrapping iterations.} + +\item{fg_sample_size}{Foreground sample size.} + +\item{bg_sample_size}{Background sample size.} + +\item{bootstrap}{Whether to use bootstrapping.} + +\item{save_path}{File path to save results to.} + +\item{nThread}{Number of threads to parallelise bootstrapping over.} + +\item{verbose}{Print messages.} +} +\description{ +Perform annotation enrichment tests using iterative bootstrapping procedure. +} +\examples{ +\dontrun{ +gr.merged <- echoannot::merge_celltype_specific_epigenomics() +enrich_res <- XGR.enrichment_bootstrap( + gr = gr.merged, + merged_dat = echodata::Nalls2019_merged +) +} +} +\seealso{ +Other XGR: +\code{\link{XGR.download_and_standardize}()}, +\code{\link{XGR.enrichment_plot}()}, +\code{\link{XGR.enrichment}()}, +\code{\link{XGR.filter_assays}()}, +\code{\link{XGR.filter_sources}()}, +\code{\link{XGR.import_annotations}()}, +\code{\link{XGR.iterate_enrichment}()}, +\code{\link{XGR.iterate_overlap}()}, +\code{\link{XGR.merge_and_process}()}, +\code{\link{XGR.parse_metadata}()}, +\code{\link{XGR.plot_enrichment}()}, +\code{\link{XGR.plot_peaks}()}, +\code{\link{XGR.prepare_foreground_background}()}, +\code{\link{XGR.sep_handler}()}, +\code{\link{granges_to_bed}()} +} +\concept{XGR} diff --git a/man/XGR.enrichment_plot.Rd b/man/XGR.enrichment_plot.Rd new file mode 100644 index 0000000..b7cca69 --- /dev/null +++ b/man/XGR.enrichment_plot.Rd @@ -0,0 +1,105 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/XGR.enrichment_plot.R +\name{XGR.enrichment_plot} +\alias{XGR.enrichment_plot} +\title{Plot enrichment results} +\usage{ +XGR.enrichment_plot( + enrich_res, + title = NULL, + subtitle = NULL, + facet_formula = NULL, + line_formula = "y ~ x", + line_method = "lm", + line_span = 1, + FDR_thresh = 1, + plot_type = "bar", + shape_var = "Cell_type", + facet_scales = "free", + show_plot = TRUE, + save_plot = FALSE, + height = 5, + width = 5 +) +} +\description{ +Plot enrichment results +} +\examples{ +\dontrun{ +root <- file.path( + "/sc/arion/projects/pd-omics/brian", + "Fine_Mapping/Data/GWAS/Nalls23andMe_2019/_genome_wide" +) +### merged enrichment results +enrich_res <- data.table::fread( + file.path( + root, + "XGR/celltypespecific_epigenomics.SNP_groups.csv.gz" + ) +) +enrich_res <- data.table::fread( + file.path( + root, + "XGR/celltypespecific_epigenomics.snp_groups.csv.gz" + ) +) +enrich_boot <- data.table::fread( + file.path( + root, + "XGR/celltypespecific_epigenomics.snp_groups.permute.csv.gz" + ) +) +enrich_assay <- data.table::fread( + file.path( + root, + "XGR/celltypespecific_epigenomics.snp_groups.assay.csv.gz" + ) +) + +# Merged volcano plot +enrich_res <- subset(enrich_res, SNP_Group != "Consensus (-PolyFun)") \%>\% + dplyr::rename(SNP_group = SNP_Group) +gp <- XGR.enrichment_plot( + enrich_res = subset(enrich_res, !Assay \%in\% c("HiChIP_FitHiChIP", "PLAC")), + title = "Enrichment: Cell-type-specific epigenomics", + plot_type = "point", + save_plot = file.path( + root, "XGR/celltypespecific_epigenomics.enrich_volcano.png" + ), + height = 6, width = 8, shape_var = "Assay" +) +## Merged bar plot +gp <- XGR.enrichment_plot( + enrich_res = enrich_res, + plot_type = "bar", + facet_formula = ".~Assay", + FDR_thresh = .05 +) +# Merged volcano plot (permuted) +gp <- XGR.enrichment_plot( + enrich_res = enrich.scATAC.permute, + title = "Permuted enrichment: Cell-type-specific peaks and elements", + plot_type = "point" +) +} +} +\seealso{ +Other XGR: +\code{\link{XGR.download_and_standardize}()}, +\code{\link{XGR.enrichment_bootstrap}()}, +\code{\link{XGR.enrichment}()}, +\code{\link{XGR.filter_assays}()}, +\code{\link{XGR.filter_sources}()}, +\code{\link{XGR.import_annotations}()}, +\code{\link{XGR.iterate_enrichment}()}, +\code{\link{XGR.iterate_overlap}()}, +\code{\link{XGR.merge_and_process}()}, +\code{\link{XGR.parse_metadata}()}, +\code{\link{XGR.plot_enrichment}()}, +\code{\link{XGR.plot_peaks}()}, +\code{\link{XGR.prepare_foreground_background}()}, +\code{\link{XGR.sep_handler}()}, +\code{\link{granges_to_bed}()} +} +\concept{XGR} diff --git a/man/XGR.filter_assays.Rd b/man/XGR.filter_assays.Rd new file mode 100644 index 0000000..11e5917 --- /dev/null +++ b/man/XGR.filter_assays.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/XGR.filter_assays.R +\name{XGR.filter_assays} +\alias{XGR.filter_assays} +\title{Filter assays} +\usage{ +XGR.filter_assays(gr.lib, n_top_assays = 5) +} +\description{ +Identify the assays with the most annotations in the locus. +Then only keep these assays +} +\seealso{ +Other XGR: +\code{\link{XGR.download_and_standardize}()}, +\code{\link{XGR.enrichment_bootstrap}()}, +\code{\link{XGR.enrichment_plot}()}, +\code{\link{XGR.enrichment}()}, +\code{\link{XGR.filter_sources}()}, +\code{\link{XGR.import_annotations}()}, +\code{\link{XGR.iterate_enrichment}()}, +\code{\link{XGR.iterate_overlap}()}, +\code{\link{XGR.merge_and_process}()}, +\code{\link{XGR.parse_metadata}()}, +\code{\link{XGR.plot_enrichment}()}, +\code{\link{XGR.plot_peaks}()}, +\code{\link{XGR.prepare_foreground_background}()}, +\code{\link{XGR.sep_handler}()}, +\code{\link{granges_to_bed}()} +} +\concept{XGR} +\keyword{internal} diff --git a/man/XGR.filter_sources.Rd b/man/XGR.filter_sources.Rd new file mode 100644 index 0000000..c3e3e0d --- /dev/null +++ b/man/XGR.filter_sources.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/XGR.filter_sources.R +\name{XGR.filter_sources} +\alias{XGR.filter_sources} +\title{Filter sources} +\usage{ +XGR.filter_sources(gr.lib, n_top_sources = 5) +} +\description{ +Identify the sources with the most annotations in the locus. +Then only keep these sources. +} +\seealso{ +Other XGR: +\code{\link{XGR.download_and_standardize}()}, +\code{\link{XGR.enrichment_bootstrap}()}, +\code{\link{XGR.enrichment_plot}()}, +\code{\link{XGR.enrichment}()}, +\code{\link{XGR.filter_assays}()}, +\code{\link{XGR.import_annotations}()}, +\code{\link{XGR.iterate_enrichment}()}, +\code{\link{XGR.iterate_overlap}()}, +\code{\link{XGR.merge_and_process}()}, +\code{\link{XGR.parse_metadata}()}, +\code{\link{XGR.plot_enrichment}()}, +\code{\link{XGR.plot_peaks}()}, +\code{\link{XGR.prepare_foreground_background}()}, +\code{\link{XGR.sep_handler}()}, +\code{\link{granges_to_bed}()} +} +\concept{XGR} +\keyword{internal} diff --git a/man/XGR.import_annotations.Rd b/man/XGR.import_annotations.Rd new file mode 100644 index 0000000..ef0b0e6 --- /dev/null +++ b/man/XGR.import_annotations.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/XGR.import_annotations.R +\name{XGR.import_annotations} +\alias{XGR.import_annotations} +\title{Download XGR annotations} +\usage{ +XGR.import_annotations( + gr.snp, + anno_data_path = file.path("annotations", paste0("XGR_", lib.name, ".rds")), + lib.name, + save_xgr = TRUE, + annot_overlap_threshold = 5 +) +} +\description{ +Download XGR annotations +} +\seealso{ +Other XGR: +\code{\link{XGR.download_and_standardize}()}, +\code{\link{XGR.enrichment_bootstrap}()}, +\code{\link{XGR.enrichment_plot}()}, +\code{\link{XGR.enrichment}()}, +\code{\link{XGR.filter_assays}()}, +\code{\link{XGR.filter_sources}()}, +\code{\link{XGR.iterate_enrichment}()}, +\code{\link{XGR.iterate_overlap}()}, +\code{\link{XGR.merge_and_process}()}, +\code{\link{XGR.parse_metadata}()}, +\code{\link{XGR.plot_enrichment}()}, +\code{\link{XGR.plot_peaks}()}, +\code{\link{XGR.prepare_foreground_background}()}, +\code{\link{XGR.sep_handler}()}, +\code{\link{granges_to_bed}()} +} +\concept{XGR} +\keyword{internal} diff --git a/man/XGR.iterate_enrichment.Rd b/man/XGR.iterate_enrichment.Rd new file mode 100644 index 0000000..6a6cb3f --- /dev/null +++ b/man/XGR.iterate_enrichment.Rd @@ -0,0 +1,72 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/XGR.iterate_enrichment.R +\name{XGR.iterate_enrichment} +\alias{XGR.iterate_enrichment} +\title{Conduct enrichment tests for each annotation} +\usage{ +XGR.iterate_enrichment( + subset_DT, + foreground_filter = "Consensus_SNP", + background_filter = "leadSNP", + lib.selections = c("ENCODE_TFBS_ClusteredV3_CellTypes", + "ENCODE_DNaseI_ClusteredV3_CellTypes", "Broad_Histone", "FANTOM5_Enhancer", + "Segment_Combined_Gm12878", "TFBS_Conserved", "ReMap_PublicAndEncode_TFBS", + "Blueprint_VenousBlood_Histone", "Blueprint_DNaseI", "FANTOM5_CAT_Cell", + "FANTOM5_CAT_MESH", "GWAScatalog_alltraits"), + save_path = FALSE, + nThread = 1 +) +} +\arguments{ +\item{subset_DT}{Data.frame with at least the following columns: +\describe{ +\item{SNP}{SNP RSID} +\item{CHR}{chromosome} +\item{POS}{position} +}} + +\item{foreground_filter}{Specify foreground by filtering SNPs +in \code{subset_DT}. +Write filter as a string (or \code{NULL} to include all SNPs).} + +\item{background_filter}{Specify background by filtering SNPs +in \code{subset_DT}. +Write filter as a string (or \code{NULL} to include all SNPs).} +} +\description{ +XGR uses a binomial enrichment tests for each annotation. +} +\details{ +\href{https://www.rdocumentation.org/packages/XGR/versions/1.1.5/topics/xDefineGenomicAnno}{ +Description of all datasets} +} +\examples{ +\dontrun{ +enrich_res <- XGR.iterate_enrichment( + subset_DT = echodata::Nalls2019_merged, + foreground_filter = "Consensus_SNP", + background_filter = "leadSNP", + lib.selections = c("ENCODE_TFBS_ClusteredV3_CellTypes") +) +} +} +\seealso{ +Other XGR: +\code{\link{XGR.download_and_standardize}()}, +\code{\link{XGR.enrichment_bootstrap}()}, +\code{\link{XGR.enrichment_plot}()}, +\code{\link{XGR.enrichment}()}, +\code{\link{XGR.filter_assays}()}, +\code{\link{XGR.filter_sources}()}, +\code{\link{XGR.import_annotations}()}, +\code{\link{XGR.iterate_overlap}()}, +\code{\link{XGR.merge_and_process}()}, +\code{\link{XGR.parse_metadata}()}, +\code{\link{XGR.plot_enrichment}()}, +\code{\link{XGR.plot_peaks}()}, +\code{\link{XGR.prepare_foreground_background}()}, +\code{\link{XGR.sep_handler}()}, +\code{\link{granges_to_bed}()} +} +\concept{XGR} +\keyword{internal} diff --git a/man/XGR.iterate_overlap.Rd b/man/XGR.iterate_overlap.Rd new file mode 100644 index 0000000..ecb139b --- /dev/null +++ b/man/XGR.iterate_overlap.Rd @@ -0,0 +1,66 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/XGR.iterate_overlap.R +\name{XGR.iterate_overlap} +\alias{XGR.iterate_overlap} +\title{Check overlap with XGR annotations} +\usage{ +XGR.iterate_overlap( + lib.selections = c("ENCODE_TFBS_ClusteredV3_CellTypes", "TFBS_Conserved", + "ReMap_PublicAndEncode_TFBS", "Uniform_TFBS"), + subset_DT, + save_path = FALSE, + nThread = 1 +) +} +\arguments{ +\item{lib.selections}{Which XGR annotations to check overlap with. +For full list of libraries see +\href{http://xgr.r-forge.r-project.org/#annotations-at-the-genomic-region-level}{ + here.}} + +\item{subset_DT}{Data.frame with at least the following columns: +\describe{ +\item{SNP}{SNP RSID} +\item{CHR}{chromosome} +\item{POS}{position} +}} + +\item{save_path}{Save the results as a \code{data.frame}.} + +\item{nThread}{Multi-thread across libraries.} +} +\description{ +Automatically handles different file formats provided by XGR + (e.g. varying kinds of nested/unnested \code{GRanges}). +Then returns a \code{Granges} object with only the XGR annotation ranges +that overlap with the SNPs in \code{subset_DT}. +The \code{GRanges} merges hits from \code{subset_DT}. +} +\examples{ +\dontrun{ +gr.hits <- XGR.iterate_overlap( + lib.selections = c("ENCODE_TFBS_ClusteredV3_CellTypes"), + subset_DT = echodata::BST1 +) +} +} +\seealso{ +Other XGR: +\code{\link{XGR.download_and_standardize}()}, +\code{\link{XGR.enrichment_bootstrap}()}, +\code{\link{XGR.enrichment_plot}()}, +\code{\link{XGR.enrichment}()}, +\code{\link{XGR.filter_assays}()}, +\code{\link{XGR.filter_sources}()}, +\code{\link{XGR.import_annotations}()}, +\code{\link{XGR.iterate_enrichment}()}, +\code{\link{XGR.merge_and_process}()}, +\code{\link{XGR.parse_metadata}()}, +\code{\link{XGR.plot_enrichment}()}, +\code{\link{XGR.plot_peaks}()}, +\code{\link{XGR.prepare_foreground_background}()}, +\code{\link{XGR.sep_handler}()}, +\code{\link{granges_to_bed}()} +} +\concept{XGR} +\keyword{internal} diff --git a/man/XGR.merge_and_process.Rd b/man/XGR.merge_and_process.Rd new file mode 100644 index 0000000..dfe5cbb --- /dev/null +++ b/man/XGR.merge_and_process.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/XGR.merge_and_process.R +\name{XGR.merge_and_process} +\alias{XGR.merge_and_process} +\title{Standardize XGR annotations} +\usage{ +XGR.merge_and_process(grl.xgr, lib, n_top_sources = 10) +} +\arguments{ +\item{grl.xgr}{\link[GenomicRanges]{GenomicRangesList} of XGR queries.} +} +\description{ +Parses the metadata and adds it as columns, +and then merges the results into a single +\code{\link[GenomicRanges]{GenomicRangesList}} +} +\seealso{ +Other XGR: +\code{\link{XGR.download_and_standardize}()}, +\code{\link{XGR.enrichment_bootstrap}()}, +\code{\link{XGR.enrichment_plot}()}, +\code{\link{XGR.enrichment}()}, +\code{\link{XGR.filter_assays}()}, +\code{\link{XGR.filter_sources}()}, +\code{\link{XGR.import_annotations}()}, +\code{\link{XGR.iterate_enrichment}()}, +\code{\link{XGR.iterate_overlap}()}, +\code{\link{XGR.parse_metadata}()}, +\code{\link{XGR.plot_enrichment}()}, +\code{\link{XGR.plot_peaks}()}, +\code{\link{XGR.prepare_foreground_background}()}, +\code{\link{XGR.sep_handler}()}, +\code{\link{granges_to_bed}()} +} +\concept{XGR} +\keyword{internal} diff --git a/man/XGR.parse_metadata.Rd b/man/XGR.parse_metadata.Rd new file mode 100644 index 0000000..90cec74 --- /dev/null +++ b/man/XGR.parse_metadata.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/XGR.parse_metadata.R +\name{XGR.parse_metadata} +\alias{XGR.parse_metadata} +\title{XGR.parse_metadata} +\usage{ +XGR.parse_metadata(gr.lib, lib.name = NA) +} +\description{ +XGR.parse_metadata +} +\seealso{ +Other XGR: +\code{\link{XGR.download_and_standardize}()}, +\code{\link{XGR.enrichment_bootstrap}()}, +\code{\link{XGR.enrichment_plot}()}, +\code{\link{XGR.enrichment}()}, +\code{\link{XGR.filter_assays}()}, +\code{\link{XGR.filter_sources}()}, +\code{\link{XGR.import_annotations}()}, +\code{\link{XGR.iterate_enrichment}()}, +\code{\link{XGR.iterate_overlap}()}, +\code{\link{XGR.merge_and_process}()}, +\code{\link{XGR.plot_enrichment}()}, +\code{\link{XGR.plot_peaks}()}, +\code{\link{XGR.prepare_foreground_background}()}, +\code{\link{XGR.sep_handler}()}, +\code{\link{granges_to_bed}()} +} +\concept{XGR} +\keyword{internal} diff --git a/man/XGR.plot_enrichment.Rd b/man/XGR.plot_enrichment.Rd new file mode 100644 index 0000000..e4370cc --- /dev/null +++ b/man/XGR.plot_enrichment.Rd @@ -0,0 +1,47 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/XGR.plot_enrichment.R +\name{XGR.plot_enrichment} +\alias{XGR.plot_enrichment} +\title{Plot XGR enrichment} +\usage{ +XGR.plot_enrichment( + enrich_res, + adjp_thresh = 0.05, + top_annotations = NULL, + show_plot = TRUE +) +} +\description{ +Plot XGR enrichment +} +\examples{ +\dontrun{ +enrich_res <- XGR.iterate_enrichment( + subset_DT = echodata::Nalls2019_merged, + foreground_filter = "Consensus_SNP", + background_filter = "leadSNP", + lib.selections = c("ENCODE_TFBS_ClusteredV3_CellTypes") +) +XGR.plot_enrichment(enrich_res) +} +} +\seealso{ +Other XGR: +\code{\link{XGR.download_and_standardize}()}, +\code{\link{XGR.enrichment_bootstrap}()}, +\code{\link{XGR.enrichment_plot}()}, +\code{\link{XGR.enrichment}()}, +\code{\link{XGR.filter_assays}()}, +\code{\link{XGR.filter_sources}()}, +\code{\link{XGR.import_annotations}()}, +\code{\link{XGR.iterate_enrichment}()}, +\code{\link{XGR.iterate_overlap}()}, +\code{\link{XGR.merge_and_process}()}, +\code{\link{XGR.parse_metadata}()}, +\code{\link{XGR.plot_peaks}()}, +\code{\link{XGR.prepare_foreground_background}()}, +\code{\link{XGR.sep_handler}()}, +\code{\link{granges_to_bed}()} +} +\concept{XGR} +\keyword{internal} diff --git a/man/XGR.plot_peaks.Rd b/man/XGR.plot_peaks.Rd new file mode 100644 index 0000000..fd3a4ea --- /dev/null +++ b/man/XGR.plot_peaks.Rd @@ -0,0 +1,80 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/XGR.plot_peaks.R +\name{XGR.plot_peaks} +\alias{XGR.plot_peaks} +\title{Plot XGR peaks} +\usage{ +XGR.plot_peaks( + gr.lib, + subset_DT, + fill_var = "Assay", + facet_var = "Source", + geom = "density", + locus = NULL, + adjust = 0.2, + show_plot = TRUE, + show.legend = TRUE, + as.ggplot = TRUE, + trim_xlims = FALSE +) +} +\arguments{ +\item{gr.lib}{\code{GRanges} object of annotations.} + +\item{subset_DT}{Data.frame with at least the following columns: +\describe{ +\item{SNP}{SNP RSID} +\item{CHR}{chromosome} +\item{POS}{position} +}} + +\item{geom}{Plot type ("density", or "histogram").} + +\item{locus}{Locus name (\emph{optional}).} + +\item{adjust}{The granularity of the peaks.} + +\item{show_plot}{Print the plot.} +} +\value{ +\code{ggbio} track plot. +} +\description{ +Plots the distribution of annotations across a genomic region (x-axis). +} +\examples{ +\dontrun{ +gr.lib <- XGR.download_and_standardize( + c("ENCODE_DNaseI_ClusteredV3_CellTypes"), + finemap_dat = echodata::BST1 +) +gr.filt <- XGR.filter_sources(gr.lib = gr.lib, n_top_sources = 5) +gr.filt <- XGR.filter_assays(gr.lib = gr.filt, n_top_assays = 5) +xgr.track <- XGR.plot_peaks( + gr.lib = gr.filt, + subset_DT = echodata::BST1, + fill_var = "Assay", + facet_var = "Source" +) +} +} +\seealso{ +Other XGR: +\code{\link{XGR.download_and_standardize}()}, +\code{\link{XGR.enrichment_bootstrap}()}, +\code{\link{XGR.enrichment_plot}()}, +\code{\link{XGR.enrichment}()}, +\code{\link{XGR.filter_assays}()}, +\code{\link{XGR.filter_sources}()}, +\code{\link{XGR.import_annotations}()}, +\code{\link{XGR.iterate_enrichment}()}, +\code{\link{XGR.iterate_overlap}()}, +\code{\link{XGR.merge_and_process}()}, +\code{\link{XGR.parse_metadata}()}, +\code{\link{XGR.plot_enrichment}()}, +\code{\link{XGR.prepare_foreground_background}()}, +\code{\link{XGR.sep_handler}()}, +\code{\link{granges_to_bed}()} +} +\concept{XGR} +\keyword{internal} diff --git a/man/XGR.prepare_foreground_background.Rd b/man/XGR.prepare_foreground_background.Rd new file mode 100644 index 0000000..3b8fff6 --- /dev/null +++ b/man/XGR.prepare_foreground_background.Rd @@ -0,0 +1,64 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/XGR.prepare_foreground_background.R +\name{XGR.prepare_foreground_background} +\alias{XGR.prepare_foreground_background} +\title{Prepare SNP sets for enrichment} +\usage{ +XGR.prepare_foreground_background( + subset_DT, + foreground_filter = "Support>0", + background_filter = NULL, + fg_sample_size = NULL, + bg_sample_size = NULL, + verbose = TRUE +) +} +\arguments{ +\item{subset_DT}{Data.frame with at least the following columns: +\describe{ +\item{SNP}{SNP RSID} +\item{CHR}{chromosome} +\item{POS}{position} +}} + +\item{foreground_filter}{Specify foreground by filtering SNPs +in \code{subset_DT}. +Write filter as a string (or \code{NULL} to include all SNPs).} + +\item{background_filter}{Specify background by filtering SNPs +in \code{subset_DT}. +Write filter as a string (or \code{NULL} to include all SNPs).} +} +\description{ +Prepare custom foreground and background SNPs sets for enrichment +tests with XGR annotations. +} +\examples{ +\dontrun{ +fg_bg <- XGR.prepare_foreground_background( + subset_DT = echodata::Nalls2019_merged, + foreground_filter = "Consensus_SNP==TRUE", + background_filter = "leadSNP==TRUE" +) +} +} +\seealso{ +Other XGR: +\code{\link{XGR.download_and_standardize}()}, +\code{\link{XGR.enrichment_bootstrap}()}, +\code{\link{XGR.enrichment_plot}()}, +\code{\link{XGR.enrichment}()}, +\code{\link{XGR.filter_assays}()}, +\code{\link{XGR.filter_sources}()}, +\code{\link{XGR.import_annotations}()}, +\code{\link{XGR.iterate_enrichment}()}, +\code{\link{XGR.iterate_overlap}()}, +\code{\link{XGR.merge_and_process}()}, +\code{\link{XGR.parse_metadata}()}, +\code{\link{XGR.plot_enrichment}()}, +\code{\link{XGR.plot_peaks}()}, +\code{\link{XGR.sep_handler}()}, +\code{\link{granges_to_bed}()} +} +\concept{XGR} +\keyword{internal} diff --git a/man/XGR.sep_handler.Rd b/man/XGR.sep_handler.Rd new file mode 100644 index 0000000..9b08e6b --- /dev/null +++ b/man/XGR.sep_handler.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/XGR.sep_handler.R +\name{XGR.sep_handler} +\alias{XGR.sep_handler} +\title{XGR.sep_handler} +\usage{ +XGR.sep_handler(lib.name) +} +\description{ +XGR.sep_handler +} +\seealso{ +Other XGR: +\code{\link{XGR.download_and_standardize}()}, +\code{\link{XGR.enrichment_bootstrap}()}, +\code{\link{XGR.enrichment_plot}()}, +\code{\link{XGR.enrichment}()}, +\code{\link{XGR.filter_assays}()}, +\code{\link{XGR.filter_sources}()}, +\code{\link{XGR.import_annotations}()}, +\code{\link{XGR.iterate_enrichment}()}, +\code{\link{XGR.iterate_overlap}()}, +\code{\link{XGR.merge_and_process}()}, +\code{\link{XGR.parse_metadata}()}, +\code{\link{XGR.plot_enrichment}()}, +\code{\link{XGR.plot_peaks}()}, +\code{\link{XGR.prepare_foreground_background}()}, +\code{\link{granges_to_bed}()} +} +\concept{XGR} +\keyword{internal} diff --git a/man/dt_to_granges.Rd b/man/dt_to_granges.Rd new file mode 100644 index 0000000..5800381 --- /dev/null +++ b/man/dt_to_granges.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/dt_to_granges.R +\name{dt_to_granges} +\alias{dt_to_granges} +\title{Convert data.table to GRanges object} +\usage{ +dt_to_granges( + subset_DT, + chrom_col = "CHR", + start_col = "POS", + end_col = start_col, + style = "NCBI", + verbose = TRUE +) +} +\description{ +Convert data.table to GRanges object +} +\concept{utils} +\keyword{internal} diff --git a/man/granges_to_bed.Rd b/man/granges_to_bed.Rd new file mode 100644 index 0000000..1d0c20b --- /dev/null +++ b/man/granges_to_bed.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/granges_to_bed.R +\name{granges_to_bed} +\alias{granges_to_bed} +\title{Convert GRanges object to BED format and save} +\usage{ +granges_to_bed( + GR.annotations, + output_path, + sep = "\\t", + nThread = 1, + gzip = FALSE +) +} +\description{ +Convert GRanges object to BED format and save +} +\seealso{ +Other XGR: +\code{\link{XGR.download_and_standardize}()}, +\code{\link{XGR.enrichment_bootstrap}()}, +\code{\link{XGR.enrichment_plot}()}, +\code{\link{XGR.enrichment}()}, +\code{\link{XGR.filter_assays}()}, +\code{\link{XGR.filter_sources}()}, +\code{\link{XGR.import_annotations}()}, +\code{\link{XGR.iterate_enrichment}()}, +\code{\link{XGR.iterate_overlap}()}, +\code{\link{XGR.merge_and_process}()}, +\code{\link{XGR.parse_metadata}()}, +\code{\link{XGR.plot_enrichment}()}, +\code{\link{XGR.plot_peaks}()}, +\code{\link{XGR.prepare_foreground_background}()}, +\code{\link{XGR.sep_handler}()} +} +\concept{XGR} +\keyword{internal} diff --git a/man/is_granges.Rd b/man/is_granges.Rd new file mode 100644 index 0000000..1517e1b --- /dev/null +++ b/man/is_granges.Rd @@ -0,0 +1,12 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/is_granges.R +\name{is_granges} +\alias{is_granges} +\title{is_granges} +\usage{ +is_granges(obj) +} +\description{ +is_granges +} +\keyword{internal} diff --git a/man/merge_celltype_specific_epigenomics.Rd b/man/merge_celltype_specific_epigenomics.Rd index 50cd7f6..0af1e27 100644 --- a/man/merge_celltype_specific_epigenomics.Rd +++ b/man/merge_celltype_specific_epigenomics.Rd @@ -6,10 +6,14 @@ \usage{ merge_celltype_specific_epigenomics(keep_extra_cols = FALSE) } +\arguments{ +\item{keep_extra_cols}{Keep extra columns +that are not shared across all annotations.} +} \description{ Merges multiple cell-type-specific epigenomic datasets (Nott 2019, Corces 2020) into a single \link[GenomicRanges]{GRanges} object. } \examples{ -gr.merged <- merge_celltype_specific_epigenomics() +gr.merged <- echoannot::merge_celltype_specific_epigenomics() } diff --git a/tests/testthat.R b/tests/testthat.R new file mode 100644 index 0000000..b613f3b --- /dev/null +++ b/tests/testthat.R @@ -0,0 +1,4 @@ +library(testthat) +library(echoannot) + +test_check("echoannot") diff --git a/tests/testthat/test-CS_bin_plot.R b/tests/testthat/test-CS_bin_plot.R new file mode 100644 index 0000000..ac7fd7b --- /dev/null +++ b/tests/testthat/test-CS_bin_plot.R @@ -0,0 +1,7 @@ +test_that("CS_bin_plot works", { + gg_cs_bin <- echoannot::CS_bin_plot(merged_DT = echodata::Nalls2019_merged) + testthat::expect_length(gg_cs_bin, 2) + testthat::expect_true(methods::is(gg_cs_bin$plot, "gg")) + testthat::expect_true(methods::is(gg_cs_bin$data, "data.frame")) + testthat::expect_gte(nrow(gg_cs_bin$data), 400) +}) diff --git a/tests/testthat/test-CS_counts_plot.R b/tests/testthat/test-CS_counts_plot.R new file mode 100644 index 0000000..c43aded --- /dev/null +++ b/tests/testthat/test-CS_counts_plot.R @@ -0,0 +1,9 @@ +test_that("CS_counts_plot works", { + gg_cs_counts <- echoannot::CS_counts_plot( + merged_DT = echodata::Nalls2019_merged + ) + testthat::expect_length(gg_cs_counts, 2) + testthat::expect_true(methods::is(gg_cs_counts$plot, "gg")) + testthat::expect_true(methods::is(gg_cs_counts$data, "data.frame")) + testthat::expect_gte(nrow(gg_cs_counts$data), 300) +}) diff --git a/tests/testthat/test-ROADMAP.query.R b/tests/testthat/test-ROADMAP.query.R new file mode 100644 index 0000000..41cc015 --- /dev/null +++ b/tests/testthat/test-ROADMAP.query.R @@ -0,0 +1,9 @@ +test_that("ROADMAP.query_and_plot works", { + + grl.roadmap <- ROADMAP.query( + gr.snp = echodata::BST1, + keyword_query = "placenta") + testthat::expect_length(grl.roadmap, 2) + testthat::expect_true(methods::is(grl.roadmap[[1]],"GRanges")) + testthat::expect_gte(length(grl.roadmap[[1]]), 400000) +}) diff --git a/tests/testthat/test-ROADMAP.query_and_plot.R b/tests/testthat/test-ROADMAP.query_and_plot.R new file mode 100644 index 0000000..0d6fe08 --- /dev/null +++ b/tests/testthat/test-ROADMAP.query_and_plot.R @@ -0,0 +1,9 @@ +test_that("ROADMAP.query_and_plot works", { + + roadmap_plot_query <- ROADMAP.query_and_plot(subset_DT = echodata::BST1, + keyword_query = "monocytes") + testthat::expect_length(roadmap_plot_query, 2) + testthat::expect_true(methods::is(roadmap_plot_query$Roadmap_plot, "gg")) + testthat::expect_true(methods::is(roadmap_plot_query$Roadmap_query, "GRanges")) + testthat::expect_gte(length(roadmap_plot_query$Roadmap_query), 700) +}) diff --git a/tests/testthat/test-XGR.download_and_standardize.R b/tests/testthat/test-XGR.download_and_standardize.R new file mode 100644 index 0000000..83aa21f --- /dev/null +++ b/tests/testthat/test-XGR.download_and_standardize.R @@ -0,0 +1,8 @@ +test_that("XGR.download_and_standardize works", { + + gr.lib <- XGR.download_and_standardize( + lib.selections = c("ENCODE_DNaseI_ClusteredV3_CellTypes"), + finemap_dat = echodata::BST1) + testthat::expect_true(methods::is(gr.lib,"GRanges")) + testthat::expect_gte(length(gr.lib), 8000) +}) diff --git a/tests/testthat/test-merge_finemapping_results.R b/tests/testthat/test-merge_finemapping_results.R new file mode 100644 index 0000000..7e56a1e --- /dev/null +++ b/tests/testthat/test-merge_finemapping_results.R @@ -0,0 +1,21 @@ +test_that("merge_finemapping_results works", { + local_files <- echodata::portal_query( + phenotypes = "parkinson", + LD_panels = "UKB", + loci = c("BST1", "LRRK2"), + file_types = "multi_finemap" + ) + dataset <- dirname(dirname(dirname(local_files)))[1] + testthat::expect_true(dir.exists(dataset)) + + merged_DT <- echoannot::merge_finemapping_results( + dataset = dataset, + minimum_support = 1, + haploreg_annotation = TRUE + ) + + testthat::expect_true("Promoter_histone_marks" %in% colnames(merged_DT)) + testthat::expect_gte(nrow(merged_DT), 10) + testthat::expect_true(methods::is(merged_DT, "data.table")) + testthat::expect_equal(dplyr::n_distinct(merged_DT$Locus), 2) +}) diff --git a/tests/testthat/test-peak_overlap_plot.R b/tests/testthat/test-peak_overlap_plot.R new file mode 100644 index 0000000..9f06c00 --- /dev/null +++ b/tests/testthat/test-peak_overlap_plot.R @@ -0,0 +1,18 @@ +test_that("peak_overlap_plot works", { + gg_epi <- echoannot::peak_overlap_plot( + merged_DT = echodata::Nalls2019_merged, + include.NOTT_2019_enhancers_promoters = TRUE, + include.NOTT_2019_PLACseq = TRUE, + #### Omit many annot to save time #### + include.NOTT_2019_peaks = TRUE, + include.CORCES_2020_scATACpeaks = TRUE, + include.CORCES_2020_Cicero_coaccess = TRUE, + include.CORCES_2020_bulkATACpeaks = TRUE, + include.CORCES_2020_HiChIP_FitHiChIP_coaccess = TRUE, + include.CORCES_2020_gene_annotations = TRUE + ) + testthat::expect_length(gg_epi, 2) + testthat::expect_true(methods::is(gg_epi$plot, "gg")) + testthat::expect_true(methods::is(gg_epi$data, "data.frame")) + testthat::expect_gte(nrow(gg_epi$data), 100) +}) diff --git a/vignettes/echoannot.Rmd b/vignettes/echoannot.Rmd index f43d03e..258d9d1 100644 --- a/vignettes/echoannot.Rmd +++ b/vignettes/echoannot.Rmd @@ -68,12 +68,6 @@ gg_cs_bin <- echoannot::CS_bin_plot(merged_DT = echodata::Nalls2019_merged) gg_cs_counts <- echoannot::CS_counts_plot(merged_DT = echodata::Nalls2019_merged) ``` -## Credible Set counts plot - -```{r} -gg_cs_counts <- echoannot::CS_counts_plot(merged_DT = echodata::Nalls2019_merged) -``` - ## Epigenomic data