getContigRegions {dStruct}R Documentation

Identifies contiguous regions from a list of nucleotide indices.

Description

Given a sequence of nucleotide indices, this function returns integer ranges covered by the indices. There is an option to merge ranges if they are separated by less than a user-specified distance.

Usage

getContigRegions(x, gap = 0)

Arguments

x

A vector of integers.

gap

Include gaps in the ranges if they are shorter than or equal to this length.

Value

IRanges object storing start and end sites of continguous regions.

Author(s)

Krishna Choudhary

Examples

#Convert an integer vector of nucleotide positions to an IRanges object containing the coordinates of contiguous regions.
nucleotide_positions <- c(1, 3, 2, 8, 4:7, 11:20)
getContigRegions(nucleotide_positions)

#Merge regions if their end points are within 3 nt of each other.
getContigRegions(nucleotide_positions, gap = 3)

[Package dStruct version 1.0.0 Index]