Learn R Programming

Genominator (version 1.26.0)

getRegion: Select a region from an ExpData object.

Description

This function selects a subset of the data that falls into a particular contiguous genomic region.

Usage

getRegion(expData, chr, start, end, strand, what = "*", whereClause = "", verbose = getOption("verbose"))

Arguments

expData
An object of class ExpData.
chr
Chromosome number of desired region.
start
Start position of desired region. If omitted, it is set to 0.
end
End position of desired region. If omitted, it is set to 1e12.
strand
Strand of desired region. Values of 1 or -1 return data from forward or reverse strand. A value of 0 or a missing argument returns data from any strand, including data with missing strand information.
what
A vector of column names specifying which columns of the data should be returned. Defaults to all columns.
whereClause
Additional filtration criteria, customizable to refer to additional data columns. See Details for more explanation.
verbose
Logical indicating whether details should be printed.

Value

Returns a data frame containing the data from the desired region, with the desired columns.

Details

The argument whereClause should be a string indicating a subset of the data to be selected, using SQL syntax. For example, if you have a column called category, you could specify category = 1 to select only those data entries where category has a value of 1. This function operates as a database query, and this argument can include logical combinations of multiple criteria.

See Also

See Genominator vignette for more information.

Examples

Run this code
ed <- ExpData(system.file(package = "Genominator", "sample.db"),
              tablename = "raw")
c1 <- getRegion(ed, chr = 1)
dim(c1)
head(c1)

Run the code above in your browser using DataLab