rapids_singlecell.tl.draw_graph#
- rapids_singlecell.tl.draw_graph(adata, *, init_pos=None, max_iter=500, random_state=0)[source]#
Force-directed graph drawing [FR91, JVHB14].
Uses cugraph’s implementation of Force Atlas 2. This is a reimplementation of scanpys function for GPU compute.
- Parameters:
- adata
AnnData annData object with ‘neighbors’ field.
- init_pos
str|bool|None(default:None) 'paga'/True,None/False, or any valid 2d-.obsmkey. Use precomputed coordinates for initialization. IfFalse/None(the default), initialize randomly.- max_iter
int(default:500) This controls the maximum number of levels/iterations of the Force Atlas algorithm. When specified the algorithm will terminate after no more than the specified number of iterations. No error occurs when the algorithm terminates in this manner. Good short-term quality can be achieved with 50-100 iterations. Above 1000 iterations is discouraged.
- random_state
int|None(default:0) Random state to use when initializing layout and generating samples. Defaults to 0. If
Noneis passed, a hash of process id, time, and hostname is used bycugraph.
- adata
- Return type:
- Returns:
updates
adatawith the following fields.- X_draw_graph_layout_fa
adata.obsm Coordinates of graph layout.
- X_draw_graph_layout_fa