DELocal: Finds differentially expressed genes by comparing neighboring...

View source: R/LocalizedLinearModel.r

DELocalR Documentation

Finds differentially expressed genes by comparing neighboring genes

Description

Finds differentially expressed genes by comparing neighboring genes

Usage

DELocal(
  pSmrExpt,
  nearest_neighbours,
  pDesign,
  pValue_cut = 0.05,
  pLogFold_cut = 0
)

Arguments

pSmrExpt

SummarizedExperiment object

nearest_neighbours

How many nearest neighbours within 1 Mb window to evaluate?

pDesign

design formula

pValue_cut

cut off value for adjusted p-value

pLogFold_cut

cut off value for relative log fold change compared to neighbouring genes

Value

A data.frame with top significant genes with the following columns:

relative.logFC: relative logFC compared to neighbouring genes

P.Value: raw p-value

adj.P.Value: adjusted p-value

B: log-odds that the gene is differentially expressed

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_result <- DELocal(pSmrExpt = smrExpt[x_genes,],
                         nearest_neighbours = 5, pDesign = ~ condition,
                         pValue_cut = 0.05, pLogFold_cut = 0)

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