getRelevantCol: Find the column index of interest given the potential...

Description Usage Arguments Value See Also Examples

View source: R/hiAnnotator.R

Description

The function finds relevant column(s) of interest from a vector of column names derived from a dataframe. If no usable column is found, the function spits out a relevant error or returns the index of the usable column(s). This is an assistant function called by functions listed in the see also section.

Usage

1
getRelevantCol(col.names, col.options, col.type = NULL, multiple.ok = FALSE)

Arguments

col.names

column names from a dataframe

col.options

potential column names or partial names that may exist in col.names

col.type

type of column information the function is searching for, used in construction of error messages. Default is NULL.

multiple.ok

if multiple matches are found then return indices, else spit an error out. Default is TRUE.

Value

the index of usable column(s) or an error if no applicable column is found.

See Also

makeGRanges, getNearestFeature, getSitesInFeature.

Examples

1
2
3
4
5
data(sites)
names(sites)
getRelevantCol(names(sites), c("chr", "chromosome", "tname", "seqnames",
"chrom","contig"),"seqnames")
getRelevantCol(names(sites), c("ort", "orientation", "strand"), "strand")

malnirav/hiAnnotator documentation built on July 29, 2021, 6:32 a.m.