getGeneinfo: Get Gene Informaton from a ballgown object

Description Usage Arguments Value See Also Examples

View source: R/getGeneinfo.R

Description

Get gene informaton from a ballgown object by genes or by genomic regions

Usage

1
2
3
4
5
6
7
8
9
getGeneinfo(
  genes = NA,
  bg,
  chrom,
  start,
  end,
  samples = sampleNames(bg),
  trans.select = NA
)

Arguments

genes

a character vector specifying gene IDs in 'bg'. Any values other than NA override genomic region (chrom, start, stop)

bg

ballgown object

chrom

chromosome of a region

start

start postion

end

stop postion

samples

names of samples. The transcrpts in these samples are subjected to 'trans.select'

trans.select

logical expression-like string, indicating transcript rows to select from a matrix of transcript coverages: NA value keeps all transcripts.

Value

a data.frame in bed-like file format that can be used as input for plotGenes in the SuShi package

See Also

splicePlot; plotGenes in Sushi package

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(rice.bg)
unique(geneIDs(rice.bg))

gene_id <- c("MSTRG.181", "MSTRG.182", "MSTRG.183")
geneinfo <- getGeneinfo(genes = gene_id, rice.bg)
trans <- table(geneinfo$name)  # show how many exons each transcript has
trans

library(Sushi)
chrom = geneinfo$chrom[1]
chromstart = min(geneinfo$start) - 1000
chromend = max(geneinfo$stop) + 1000
color = rep(SushiColors(2)(length(trans)), trans)

par(mar = c(3, 1, 1, 1))
plotGenes(geneinfo, chrom, chromstart, chromend, col = color, bheight = 0.2, 
    bentline = FALSE, plotgenetype = "arrow", labeloffset = 0.5)
labelgenome(chrom, chromstart, chromend, side = 1, n = 5, scale = "Kb")

yuhuihui2011/vasp_test documentation built on March 5, 2020, 12:50 a.m.