parseChromLocString: Parse a string containing a chromosome and location on the...

View source: R/utils.R

parseChromLocStringR Documentation

Parse a string containing a chromosome and location on the genome

Description

Given a string of the format "chromosome:start-end", pull out the three values contained in the string and return them as a named list

Usage

parseChromLocString(chromLocString)

Arguments

chromLocString

A string of the format "chromosome:start-end"

Value

A named list containing the chromosome, start, and end from the supplied string

Examples

# Note: Both examples return :
# list(chrom="chr10", start=118441047, end=118445892)

# Parse a string containing the "chr" prefix for chromosome
chrom.list <- parseChromLocString("chr10:118441047-118445892")

# Parse a string without the "chr" prefix in the chromosome
chrom.list <- parseChromLocString("10:118441047-118445892")


PriceLab/TReNA documentation built on March 21, 2023, 1:57 p.m.