getRegion: Select a region from an ExpData object.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Genominator.R

Description

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

Usage

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

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.

Value

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

Author(s)

James Bullard bullard@berkeley.edu, Kasper Daniel Hansen khansen@jhsph.edu

See Also

See Genominator vignette for more information.

Examples

1
2
3
4
5
ed <- ExpData(system.file(package = "Genominator", "sample.db"),
              tablename = "raw")
c1 <- getRegion(ed, chr = 1)
dim(c1)
head(c1)

Genominator documentation built on Oct. 31, 2019, 8:56 a.m.