quadbio / Pando

Multiome GRN inference.
https://quadbio.github.io/Pando/
MIT License
110 stars 21 forks source link

Question: How to customize GRN plot with metadata #31

Closed mitchTwoTimes closed 1 year ago

mitchTwoTimes commented 1 year ago

Hi, Thanks for developing this tool. I was wondering if you could help me understand how to make a plot like the one in 2C from the pando publication.. image

I'd like to know how to add data to a graph object output from NetworkGraph so I can update my plot aesthetics.

## # A tbl_graph: 10 nodes and 16 edges
## #
## # A directed simple graph with 1 component
## #
## # Node Data: 10 x 2 (active)
##   name  centrality
##   <chr>      <dbl>
## 1 DLX5      0.0915
## 2 EMX2      0.180 
## 3 ID3       0.118 
## 4 MSX1      0.0412
## 5 OTX2      0.0923
## 6 PAX6      0.127 
## # … with 4 more rows
## #
## # Edge Data: 16 x 12
##    from    to estimate n_regions n_genes n_tfs regions    pval   padj from_node
##   <int> <int>    <dbl>     <int>   <int> <int> <chr>     <dbl>  <dbl> <chr>    
## 1     1     8  -0.0223        14       9    14 chr4-1… 0.00217 0.0156 DLX5     
## 2     2     3   0.0503        10      12     7 chr1-2… 0.0104  0.0545 EMX2     
## 3     2     5   0.120          9      12     6 chr14-… 0.00395 0.0254 EMX2     
## # … with 13 more rows, and 2 more variables: to_node <chr>, dir <dbl>

Thanks!

joschif commented 1 year ago

You can achieve more custom plots similar to those in the paper by using tidygraph to manipulate the graph object returned by NetworkGraph. You can for instance join these graph objects with metadata if you like. For details please refer to the tidygraph docs