ParseProteinNum: Parse protein information strings or reference strings.

View source: R/parse-helper.R

ParseProteinNumR Documentation

Parse protein information strings or reference strings.

Description

Given a string like "#1,45,72#", parse into a character vector of c("1", "45", "72"). Consecutive commas are collapsed into one, and spaces are treated as commas.

Usage

ParseProteinNum(x, type)

Arguments

x

A string in the format of "#1#" or "#1,2,3#" or "<1,3>".

type

Either "protein" or "reference".

Value

A string, or a vector of strings of protein numbers.

Examples

brendaDb:::ParseProteinNum("#1,2,3#", "protein")
# [1] "1,2,3"
brendaDb:::ParseProteinNum("<123>", "reference")
# [1] "123"


y1zhou/brendaDb documentation built on Dec. 12, 2022, 3:43 a.m.