find_all_subs {protti} | R Documentation |
Find all sub IDs of an ID in a network
Description
For a given ID, find all sub IDs and their sub IDs etc. The type of relationship can be selected too. This is a helper function for other functions.
Usage
find_all_subs(
data,
ids,
main_id = id,
type = type,
accepted_types = "is_a",
exclude_parent_id = FALSE
)
Arguments
data |
a data frame that contains relational information on IDs (main_id) their sub
IDs (sub_id) and their relationship (type). For ChEBI this data frame can be obtained by calling
|
ids |
a character vector of IDs for which sub IDs should be searched. |
main_id |
a character or integer column containing IDs. Default is |
type |
a character column that contains the type of interactions. Default is |
accepted_types |
a character vector containing the accepted_types of relationships that should be considered for the search. It is possible to use "all" relationships. The default type is "is_a". A list of possible relationships for e.g. ChEBI IDs can be found here. |
exclude_parent_id |
a logical value that specifies if the parent ID should be included in the returned list. |
Value
A list of character vectors containing the provided ID and all of its sub IDs. It contains one element per input ID.