add_expressed_genes: Adding the nearest expressed genes

Description Usage Arguments Value Examples

View source: R/get_expressed_genes.R

Description

Updating expressed regions with the expressed gene that is closest to it. After entering the tissue that has been sequenced, the nearest gene and nearest expressed gene will be added to the metadata columns of the annotated ERs.

Usage

1
2
3
4
5
6
7
8
add_expressed_genes(
  input_file = NULL,
  tissue,
  gtf,
  species = "Homo_sapiens",
  annot_ers,
  type_col_name = "type"
)

Arguments

input_file

GTEX median expression file, if left as NULL the default file will be used.

tissue

Tissue to filter for. See tissue_options for options

gtf

Either a string containg the path to a .gtf file or a pre-imported gtf using rtracklayer::import . Provides gene data to help determine the nearest gene and nearest expressed gene.

species

character string containing the species to filter for, Homo sapiens is the default

annot_ers

annotated ERs i.e. the product of annotatERs, should have an mcols column called "annotation"

type_col_name

column name in the gtf file to filter on genes. Default is "type

Value

Granges with annotated ERs and details of their nearest expressed genes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
gtf_url <- paste0(
    "http://ftp.ensembl.org/pub/release-103/gtf/",
    "homo_sapiens/Homo_sapiens.GRCh38.103.chr.gtf.gz"
)
gtf_path <- file_cache(gtf_url)
gtf_gr <- rtracklayer::import(gtf_path)

ex_opt_ers <- GenomicRanges::GRanges(
    seqnames = S4Vectors::Rle(c("chr21", "chr22"), c(2, 2)),
    ranges = IRanges::IRanges(
        start = c(5116369, 5118691, 5125879, 5128214),
        end = c(5117231, 5118847, 5125988, 5128403)
    )
)

ex_opt_ers_w_exp_genes <- add_expressed_genes(
    tissue = "lung", gtf = gtf_gr,
    annot_ers = ex_opt_ers
)

ex_opt_ers_w_exp_genes

eolagbaju/ODER documentation built on Dec. 20, 2021, 5:21 a.m.