Description Usage Arguments Details Value Examples
View source: R/cell_line_filter.R
An XML nodeset of cell-line elements can be filtered to produce a subset containing only those elements that match the filter criteria.
1 2 | cell_lines_filter(cell_lines, filter_by, filter_term,
filter_type = c("equals", "contains", "starts-with"))
|
cell_lines |
An XML nodeset containing cell-line elements. Typically either all the
cell-lines in the Cellosaurus dataset, obtained using
|
filter_by |
A string specifying which characteristic the filter should be applied to. Valid options are listed in Details. |
filter_term |
A string or character vector specifying the term(s) to filter on. If
multiple values are provided, the filter will be applied as an "OR",
i.e., retaining cell-lines that match any of the items in
|
filter_type |
Options are |
The following options are available as filter_by
terms:
accession
accession-primary
(as accession
, but only matching
primary accession codes),
accession-secondary
(as accession
, but only matching
secondary accession codes),
name
name-identifier
(as name
, but only matching identifier
(i.e., primary) names),
name-synonym
(as name
, but only matching synonym
(i.e., secondary) names),
category
sex
species
species-accession
comment
comment-category
same-origin-as
(Names of cell-lines that this cell-line
has the same origin as),
same-origin-as-accession
(Accession codes of cell-lines that
this cell-line has the same origin as),
derived-from
(Name of a cell-line that this cell-line is
derived from),
derived-from-accession
(Accession code of a cell-line that
this cell-line is derived from),
disease
(Disease by name),
disease-accession
(Disease by accession code).
For full details of the meanings of these values, see the Cellosaurus documentation.
Because filter_term
s are applied to retain
cell-line elements that match any of the terms (effectively a logical OR),
filtering to find cell lines that match two
(or more) criteria is achieved using two (or more) calls to this function.
An XML nodeset containing the subset of the cell-lines that match the filter criteria. If no cell-lines match, an empty nodeset will be returned. If one cell-line matches, a nodeset with a single node will be returned.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # Set up the data
cellosaurus <- read_cellosaurus_xml(system.file("extdata",
"cellosaurus.xml",
package = "rcellosaurus"))
cell_lines <- cell_lines_all(cellosaurus)
# Filter for a particular accession number:
cell_lines_filter(cell_lines,
filter_by = "accession",
filter_term = "CVCL_E525",
filter_type = "equals")
# Filter for all cell-lines matching any of three sex categories:
cell_lines_filter(cell_lines,
filter_by = "sex",
filter_term = c("Mixed sex",
"Sex ambiguous",
"Sex undetermined"),
filter_type = "equals")
# Sequential filtering to match "disease contains dysplasia" AND
# "category contains stem cell":
dysplasia_lines <- cell_lines_filter(cell_lines,
filter_by = "disease",
filter_term = "dysplasia",
filter_type = "contains")
dysplasia_stem_lines <- cell_lines_filter(dysplasia_lines,
filter_by = "category",
filter_term = "stem cell",
filter_type = "contains")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.