View source: R/adjacency_score.R

Given the adjacency matrix of a graph and a set of features on that graph, ranks given pairs of those features (f and g) by the equation f((e^cA-I)/c)g, which measures how much those features are colocalized in the graph. Calculates the p-value of this score by permuting the columns of the feature matrix.

1 2 | ```
adjacency_score(adj_matrix, f, f_pairs, c, num_perms = 1000, num_cores = 1,
perm_estimate = F, groupings = F, verbose = T)
``` |

`adj_matrix` |
a (preferrably sparse) binary matrix of adjacency between the columns of f |

`f` |
a numeric matrix specifying one or more features defined for each node of the graph. Each column is a node of the graph and each row is a feature over the nodes. |

`f_pairs` |
a 2 column matrix where each row specifies the indices or names of a pair of features on which the score will be computed |

`c` |
constant used to determine width of diffusion, must be 0 <= c |

`num_perms` |
number of permutations used to build the null distribution for each feature. By default is set to 1000. |

`num_cores` |
integer specifying the number of cores to be used in the computation. By default only one core is used. |

`perm_estimate` |
boolean indicating whether normal distribution parameters should be determined from num_perms permutations to estimate the p-value. By default is set to FALSE. |

`groupings` |
boolean indicating whether features are binary and mutually exclusive indicated each point's inclusion in some group. Allows for p-value computation from a parameterized hypergeometric null distribution. By default is set to FALSE. |

`verbose` |
print time taken to create permutation matrices and compute adjacency score |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.