Skip to content

Allow region_coords in plotCoverage while rescale_introns = TRUE #10

Description

@whtns

This is a great package. I'm using in a shiny app. I'd like to plot a specific sub-genomic region while rescaling introns. I could do this with ggplot xlim (I think) but I'd also like to extract the coverage data and return to the user.

# set up code
require("dplyr")
require("GenomicRanges")
sample_data = dplyr::data_frame(sample_id = c("aipt_A", "aipt_C", "bima_A", "bima_C"), 
                                condition = factor(c("Naive", "LPS", "Naive", "LPS"), levels = c("Naive", "LPS")), 
                                scaling_factor = 1) %>%
  dplyr::mutate(bigWig = system.file("extdata",  paste0(sample_id, ".str2.bw"), package = "wiggleplotr"))

track_data = dplyr::mutate(sample_data, track_id = condition, colour_group = condition)

selected_transcripts = c("ENST00000438495", "ENST00000392477") #Plot only two transcripts of the gens

# This works 
plotCoverage(ncoa7_exons[selected_transcripts], ncoa7_cdss[selected_transcripts], 
             ncoa7_metadata, track_data, 
             heights = c(2,1), fill_palette = getGenotypePalette(),
             rescale_introns = FALSE,
             region_coords = c(125900000, 125950000)
             )

# This does not work
plotCoverage(ncoa7_exons[selected_transcripts], ncoa7_cdss[selected_transcripts], 
             ncoa7_metadata, track_data, 
             heights = c(2,1), fill_palette = getGenotypePalette(),
             # rescale_introns = FALSE,
             region_coords = c(2000, 4000)
)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions