range_merge_markers: merge a range of markers

Description Usage Arguments Value Author(s) Examples

Description

Usful function to annotate the markers that are significant for a particular gene in a genome scan. First work out which markers are significant (either as indices, or as the marker names) then supply these markers to this function, along with the names of all markers, and you will be supplied with a char vector of these markers, and if a few markers in a row are significant, then just the start and end marker with a "-" (or sep) is returned.

Usage

1
2
  range_merge_markers(x, marker.names, gaplength = 0,
    sep = "-", single.string = ", ")

Arguments

x

1:length(marker.names)

marker.names

The marker names (or words) to look up the indices supplied in x.

gaplength

allow N gaps between consecutive markers to be allowed. 0 implies no gaps; 1 implies if markers A and C are significant, then marker B is expected to be significant, and included in the range.

sep

Which character should be used to delimit a range of words?

single.string

if NULL, then a character vector is returned. If not NULL then it's value will be used to concatenate the ranges into a single string, thus ", " comma separates the ranges. For clarity, avoid using the same symbol as specified by sep.

Value

A character vector with ranges identified by the first and last marker, and singletons identified by their name.

Author(s)

Mark Cowley, 22 march 2006

Examples

1
2
3
4
range_merge_markers(c(1:4,6), LETTERS)
# [1] "A-D" "F"
range_merge_markers(c(LETTERS[1:4], LETTERS[6]), LETTERS)
# [1] "A-D" "F"

drmjc/genomics documentation built on May 15, 2019, 2:22 p.m.