separate_genes: Separate genes and operons into multiple rows

Description Usage Arguments Value Note Author(s) Examples

View source: R/separate_genes.R

Description

Separate genes and operons mentioned in full text into multiple rows

Usage

1
2
separate_genes(txt, pattern = "\\b[A-Za-z][a-z]{2}[A-Z0-9]+\\b",
  genes, operon = 6, column = "text")

Arguments

txt

a table

pattern

regular expression to match genes, default is to match microbial genes like AbcD, default [A-Za-z][a-z]2[A-Z0-9]+

genes

an optional vector of genes, set pattern to NA to only match this list.

operon

operon length, default 6. Split genes with 6 or more letters into separate genes, for example AbcDEF is split into abcD, abcE and abcF.

column

column name to search, default "text"

Value

a tibble with gene name, matching text and rows.

Note

Check for genes in italics using xml_text(xml_find_all(doc, "//sec//p//italic")) and update the pattern or add additional genes as an optional vector if needed

Author(s)

Chris Stubben

Examples

1
2
3
x <- data.frame(row = 1, text = "Genes like YacK, hmu and sufABC")
separate_genes(x)
separate_genes(x, genes = "hmu")

ropensci/tidypmc documentation built on Dec. 14, 2019, 11:42 p.m.