plot_regions_relative_to_reference | R Documentation |
Generate segment plot to visualize genomic regions related to reference regions.
plot_regions_relative_to_reference(query, reference)
query |
an object of |
reference |
an object of |
a list containing segment plot and plot data
## Not run:
ref_file <- system.file("extdata", "Homo_sapiens.GRCh38.101.gtf.gz" ,package = "parcutils")
ref_data <- rtracklayer::import(ref_file) %>%
tibble::as_tibble() %>%
dplyr::mutate(seqnames = stringr::str_c("chr",seqnames ,sep = "")) %>% plyranges::as_granges()
ref_data_gr <- ref_data %>%
dplyr::filter(type == "gene" & gene_biotype == "protein_coding")
query_regions_gr <- ref_data %>% dplyr::filter(type == "Selenocysteine") %>% sample(5000)
oo <- plot_regions_relative_to_reference(query = query_regions_gr, reference = ref_data_gr)
oo$plot
oo$data %>% ggplot2::ggplot(aes(x = q_relt_start)) + geom_density()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.