grepPatternList: Enhanced grep function

Description Usage Arguments Value Author(s) Examples

Description

Enhanced grep function which can search with multiple patterns.

Usage

1
  grepPatternList(patternList, x, combine=c("or", "and"), ...)

Arguments

patternList

The character string of pattern list to grep.

x

See the argument x in grep method.

combine

When it's "or", for each element of x, a TRUE value will be returned if it matches to at least one of the pattern list. When it's "and", a TRUE value will be returned only if it matches to all of the pattern list.

...

Other arguments passed into grep method.

Value

A logical vector of length(x).

Author(s)

Ge Tan

Examples

1
2
3
4
5
6
7
8
  patternList <- c("R1_001.fastq.gz", "R1.fastq.gz", "R1.fastq",
                   "F3.csfasta")
  x <- c("nanocage_ACAGAT_carp_embryo_R1.fastq.gz",
         "nanocage_CACGAT_carp_hk_control_R1.fastq.gz",
         "nanocage_CACTGA_carp_hk_Tborreli1_R1.fastq.gz",
         "nanocage_CTGACG_carp_hk_Tborreli2_R1.fastq.gz")
  grepPatternList(patternList, x, combine="or")
  grepPatternList(patternList, x, combine="and")

ge11232002/NGS documentation built on May 17, 2019, 12:13 a.m.