ranges-names: Tools for working with named Ranges

Description Usage Arguments Details Value Examples

Description

Tools for working with named Ranges

Usage

1
2
3
4
5
remove_names(.data)

names_to_column(.data, var = "name")

id_to_column(.data, var = "id")

Arguments

.data

a Ranges object

var

Name of column to use for names

Details

The function names_to_column() and id_to_column() always places var as the first column in mcols(.data), shifting all other columns to the left. The id_to_column() creates a column with sequential row identifiers starting at 1, it will also remove any existing names.

Value

Returns a Ranges object with empty names

Examples

1
2
3
4
5
6
ir <- IRanges::IRanges(start = 1:3, width = 4, names = c("a", "b", "c"))
remove_names(ir)
ir_noname <- names_to_column(ir)
ir_noname
ir_with_id <- id_to_column(ir)
ir_with_id

plyranges documentation built on Nov. 8, 2020, 7:36 p.m.