getGeneinfo: Get Gene Informaton from a ballgown object

Description Usage Arguments Value Examples

View source: R/getGeneinfo.R

Description

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

Usage

1
2
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

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) - 1e3
# chromend = max(geneinfo$stop) + 1e3
# 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 documentation built on Jan. 12, 2022, 7:50 a.m.