cell_line_find_all: Find all matching cell-lines

Description Usage Arguments Details Value Examples

View source: R/cellosaurus.R

Description

Simple search function that searches text elements within the Cellosaurus XML document, to find entries that contain any of the terms provided in the text parameter. For greater control, consider using cell_lines_filter instead.

Usage

1
cell_line_find_all(cellosaurus, text)

Arguments

cellosaurus

An XML document containing the Cellosaurus dataset.

text

Some text to search for. Finding is handled using XPath so some special characters may cause difficulties, including these: '/:[]*. Can take a string or a character vector of length > 1. If providing a vector, the function will search for cell-lines that match any of the terms (i.e., "or").

Details

This function provides a quick way to find matching text, but is constrained in a couple of important ways. It will only search in text sections of the XML dataset (i.e., the values between XML tags). This means that it cannot find anything that Cellosaurus stores in attributes (e.g. sex='' entries). Conversely, the function will search in all of the text sections, without discrimination; it cannot search only in specific sections. For more advanced control, use the cell_lines_filter function, which has neither of these constraints.

Value

An XML nodeset containing all cell-lines that contain the search text. If there are no matches, the nodeset will be empty.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
cellosaurus <- read_cellosaurus_xml(system.file("extdata",
                                                "cellosaurus.xml",
                                                package = "rcellosaurus"))

# Finding all the cell-lines that match "sapiens".
# As of Cellosaurus v22.1 (2017-05-17) returned 69593 results.
# Takes a minute or two on a reasonably quick modern laptop.
cell_line_find_all(cellosaurus, "sapiens")

# Supplying a vector of multiple search terms will do an "or" search:
two_lines <- cell_line_find_all(cellosaurus, c("CVCL_E548", "CVCL_IW91"))
two_species <- cell_line_find_all(cellosaurus, c("Mus musculus",
                                                 "Cavia porcellus"))

jimvine/rcellosaurus documentation built on May 14, 2019, 8:04 a.m.