plotNeighbourhood: Returns median expression from different conditions of genes...

View source: R/LocalizedLinearModel.r

plotNeighbourhoodR Documentation

Returns median expression from different conditions of genes from a neighbourhood of a gene of interest

Description

Returns median expression from different conditions of genes from a neighbourhood of a gene of interest

Usage

plotNeighbourhood(
  pSmrExpt,
  pNearest_neighbours = 5,
  pDesign = ~condition,
  colorFactor = "condition",
  pGene_id
)

Arguments

pSmrExpt

SummarizedExperiment object

pNearest_neighbours

How many nearest neighbours within 1 Mb window to plot

pDesign

design formula

colorFactor

The coloring factor

pGene_id

The gene of interest

Value

a list which contains both the data from the neighbourhood and a ggplot object

Examples

count_matrix <- as.matrix(read.table(file = system.file("extdata",
                                                                  "tooth_RNASeq_counts.txt",
                                                                  package = "DELocal")))
colData <- data.frame(condition=gsub("\\..*",x=colnames(count_matrix),
                                     replacement = ""))
gene_location <- read.table(file = system.file("extdata", "gene_location.txt",
                                    package = "DELocal"))
smrExpt <- SummarizedExperiment::SummarizedExperiment(assays=list(counts=count_matrix),
                                            rowData = gene_location,
                                            colData = colData)
contrast= c("condition","ME13","ME14")
require(dplyr)
x_genes <- SummarizedExperiment::rowData(smrExpt) %>%
      as.data.frame() %>%
      filter(chromosome_name=="X") %>% rownames()
DELocal::plotNeighbourhood(pSmrExpt = smrExpt, pGene_id = "ENSMUSG00000059401")

dasroy/DELocal documentation built on Feb. 7, 2024, 9:28 a.m.