extract_run_id: Extract SRR/ERR/DRR run IDs from string

View source: R/SRA_helper.R

extract_run_idR Documentation

Extract SRR/ERR/DRR run IDs from string

Description

Extract SRR/ERR/DRR run IDs from string

Usage

extract_run_id(
  x,
  search = "(SRR[0-9]+|DRR[0-9]+|ERR[0-9]+)",
  only_valid = FALSE
)

Arguments

x

character vector to search through.

search

the regex search, default: "(SRR[0-9]+|DRR[0-9]+|ERR[0-9]+)"

only_valid

logical, default FALSE. If TRUE, return only the hits.

Value

a character vector of run accepted run ids according to search, if only_valid named character vector for which indices are returned

Examples

search <- c("SRR1230123_absdb", "SRR1241204124_asdasd", "asd_ERR1231230213",
 "DRR12412412_asdqwe", "ASDASD_ASDASD", "SRRASDASD")
ORFik:::extract_run_id(search)
ORFik:::extract_run_id(search, only_valid = TRUE)

Roleren/ORFik documentation built on Oct. 19, 2024, 7:37 a.m.