Get Cnet node set by connected Sets, using nodeType to delineate the two types of nodes in the graph.
Arguments
- g
igraphobject specifically containing Cnet plot data, with node attribute"nodeType"that has valuesc("Gene", "Set").- set_nodes
charactervector, default NULL, used to subset the returned data to nodes which are connected to these 'Set' nodes. of one or more set names, which are defined here as the names of the nodes withnodeType="Set"to which each node withnodeType="Gene"is connected. For exampleset_nodes=c("A", "B")will return all Gene nodes that are connected only to Set nodes"A"and"B". Ifset_nodes=NULLthen this function returns alistwith all set_nodes observed.- sep
characterstring used as a delimited when combiningset_nodesinto a name.- filter_set_only
logicaldefault TRUE, whether to exclude Set nodes, with vertex attribute nodeType='Set', from being members of nodegroups. In principle, 'Gene' nodes are typically members of Cnet nodesets, and 'Set' nodes do not usually share the same 'Gene' nodes with other 'Set' nodes, and therefore are not included.- ...
additional arguments are ignored.
Value
list named by nodeset, with character vectors of
node names in each nodeset. When filter_set_only=TRUE by default,
the nodes will not contain 'Set' nodes.
The list is named by nodes connected by nodes in each node group,
using sep as delimiter.
Details
This function operates on a Cnet igraph object,
distinguished by node attribute 'nodeType' with
values: 'Gene' for Gene nodes, and 'Set' for Set nodes.
This function returns Gene nodes that are connected
to the Sets given by argument set_nodes. It is
useful to identify which genes are connected to
Set "A" and "B" for example, in other words the
Gene nodes in a specific subcluster of the Cnet
igraph.
When set_nodes is NULL, this function returns a list
containing character vectors, where each vector represents
Gene nodes that are connected to each combination of
Set nodes. This option is useful for obtaining all
possible Gene subclusters.
This function is also called by adjust_cnet_nodeset() in
order to manipulate all nodes in a subcluster as a group,
for example calling nudge_igraph_node() on the whole set
of nodes.
Note that when input data do not contain vertex attribute 'nodeType', data are still returned but cannot be filtered by 'Set' and 'Gene', and so will contain all possible node-connection groupings.
See also
Other jam igraph utilities:
color_edges_by_nodegroups(),
color_edges_by_nodes(),
color_nodes_by_nodegroups(),
jam_igraph(),
launch_shinycat(),
subgraph_jam()
Other jam cnet utilities:
adjust_cnet_nodeset(),
adjust_cnet_set_relayout_gene(),
apply_nodeset_spacing(),
bulk_cnet_adjustments(),
get_cnet_nodeset_vector(),
launch_shinycat(),
make_cnet_test(),
relayout_nodegroups()
Examples
cnet1 <- make_cnet_test()
get_cnet_nodeset(cnet1)
#> $SetA
#> [1] "AB" "AO" "AV" "AW" "BE" "F" "H" "J" "K" "M" "O" "Q" "R" "W" "X"
#> [16] "Y"
#>
#> $`SetA,SetB`
#> [1] "BH" "BT" "BU"
#>
#> $`SetA,SetB,SetC,SetD`
#> [1] "CL" "CM" "CN" "CO" "CP"
#>
#> $`SetA,SetB,SetD`
#> [1] "BZ" "CD" "CI"
#>
#> $`SetA,SetC`
#> [1] "BR" "BS" "BY"
#>
#> $`SetA,SetC,SetD`
#> [1] "CB" "CC" "CE" "CF" "CG" "CJ" "CK"
#>
#> $`SetA,SetD`
#> [1] "BK" "BL" "BN" "BQ"
#>
#> $SetB
#> [1] "AK" "AL" "AP" "AR" "AS" "AT" "BC" "C" "D" "E" "I" "P" "V" "Z"
#>
#> $`SetB,SetC`
#> [1] "BG" "BM" "BO" "BV"
#>
#> $`SetB,SetC,SetD`
#> [1] "CA" "CH"
#>
#> $`SetB,SetD`
#> [1] "BF" "BJ" "BP" "BW" "BX"
#>
#> $SetC
#> [1] "A" "AC" "AD" "AE" "AH" "AI" "AN" "AU" "AX" "AY" "AZ" "BA" "BB" "G" "L"
#> [16] "N" "T" "U"
#>
#> $`SetC,SetD`
#> [1] "BI"
#>
#> $SetD
#> [1] "AA" "AF" "AG" "AJ" "AM" "AQ" "B" "BD" "S"
#>
get_cnet_nodeset(cnet1, c("SetB,SetD"))
#> $`SetB,SetD`
#> [1] "BF" "BJ" "BP" "BW" "BX"
#>