regex_classification: Classify an array of strings by regular expression

View source: R/util_generic.R

regex_classificationR Documentation

Classify an array of strings by regular expression

Description

For example, provide fasta headers and an array of regular expressions to find out which are yeast/human while removing ambigous entries or those matching ecoli: regex = c(human="_HUMA", yeast="_YEAS", discard="_ECOL")

Usage

regex_classification(x, regex, discard_label = "discard")

Arguments

x

array of string where each regex is applied to

regex

named vector of regular expressions. setting proper names is important, these are the classification labels. example: c(human="_HUMA", yeast="_YEAS", discard="_ECOL")

discard_label

default label for classifications that should be discarded downstream. default: "discard"


ftwkoopmans/msdap documentation built on March 5, 2025, 12:15 a.m.