filter_extra_attrs: Filter interactions by extra attribute values

filter_extra_attrsR Documentation

Filter interactions by extra attribute values

Description

Filter interactions by extra attribute values

Usage

filter_extra_attrs(data, ..., na_ok = TRUE)

Arguments

data

An interaction data frame with extra_attrs column.

...

Extra attribute names and values. The contents of the extra attribute name for each record will be checked against the values provided. The check by default is a set intersection: if any element is common between the user provided values and the values of the extra attribute for the record, the record will be matched. Alternatively, any value can be a custom function which accepts the value of the extra attribute and returns a single logical value. Finally, if the extra attribute name starts with a dot, the result of the check will be negated.

na_ok

Logical: keep the records which do not have the extra attribute. Typically these are the records which are not from the resource providing the extra attribute.

Value

The input data frame with records removed according to the filtering criteria.

See Also

  • extra_attrs

  • has_extra_attrs

  • extra_attrs_to_cols

  • with_extra_attrs

  • extra_attr_values

Examples

cl <- post_translational(
    resources = "Cellinker",
    fields = "extra_attrs"
)
# Only cell adhesion interactions from Cellinker
filter_extra_attrs(cl, Cellinker_type = "Cell adhesion")

op <- omnipath(fields = "extra_attrs")
# Any mechanism except phosphorylation
filter_extra_attrs(op, .SIGNOR_mechanism = "phosphorylation")


saezlab/OmnipathR documentation built on Nov. 10, 2024, 11:02 p.m.