Produce a tidygraph network for a given cluster
Source:R/produceNetwork.R
produceNetworkForCluster.Rd
Produce a tidygraph network for a given cluster
Arguments
- ingres.object
The ingres object containing the relevant data.
- cluster.id
The id of the cluster for which the network is to be produced.
Examples
# Create an ingres object with viper slot
ing <- createIngresObjectFromSeurat(
small_blca_wang, "RNA", "data", network_genes, network
)
ing@viper <- viper_results
#> Error in eval(expr, envir, enclos): object 'viper_results' not found
ing <- computePbnByCluster(ing)
#> Error in select(., c(1, 2)): Can't subset columns past the end.
#> ℹ Locations 1 and 2 don't exist.
#> ℹ There are only 0 columns.
network <- produceNetworkForCluster(ing, "1")
#> Error in filter(., .data$cluster == cluster.id): Problem while computing `..1 = .data$cluster == cluster.id`.
#> Caused by error in `.data$cluster`:
#> ! Column `cluster` not found in `.data`.
print(network)
#> # A tbl_graph: 30 nodes and 110 edges
#> #
#> # A directed multigraph with 1 component
#> #
#> # Node Data: 30 × 3 (active)
#> kind rule id
#> <chr> <chr> <chr>
#> 1 input "" DNAdamage
#> 2 input "" GrowthInhibitors
#> 3 fate "CyclinE1 or CyclinA" Proliferation
#> 4 fate "E2F1_2 or TP53" Apoptosis
#> 5 fate "p21CIP or RB1 or RBL2" Growth_Arrest
#> 6 gene "SPRY and not FGFR3 and not GRB2" EGFR
#> # … with 24 more rows
#> #
#> # Edge Data: 110 × 3
#> from to sign
#> <int> <int> <chr>
#> 1 8 30 positive
#> 2 14 3 positive
#> 3 15 3 positive
#> # … with 107 more rows