Skip to content

pyNBS.network_propagation.network_kernel_propagation

Justin Huang edited this page Jan 25, 2018 · 4 revisions

This function performs the random-walk based network propagation of a binary somatic mutation profiles over a given molecular network when a network kernel is pre-computed using the network_propagation function. The final propagation profile of each tumor is then simply the row sums of all genes marked as mutated in each tumor, rather than having to perform the full network propagation step again after each subsampling of the data. Re-propagating at each subsampling step can be time consuming due to the matrix inversion calculation required by our implementation of the network propagation algorithm.


Function Call:

network_kernel_propagation(network, binary_matrix, alpha=0.7, verbose=True, **save_args)

Parameters:

  • network (required, Networkx.Graph): Networkx object loaded from network file.
  • binary_matrix (required, pandas.DataFrame): Binary somatic matrix loaded from file. May also be an identity matrix if attempting to construct network propagation kernel.
  • alpha (optional, float, default=0.7): Propagation constant to use in the propagation of mutations over molecular network. Range is 0.0-1.0 exclusive. See above for more details.
  • verbose (optional, bool, default=False): Verbosity flag for reporting on function progress.
  • **save_args (optional, dict, default=None): Dictionary of strings for saving results.
    • save_args['outdir']: A string containing the directory path of which to save the resulting propagated profiles (or network kernel). If this parameter is given within **save_args, the function will automatically write the graph laplacian as a .csv to this location.
    • save_args['job_name']: A string containing a file prefix for the propagated profiles saved in save_args['outdir']. Otherwise the base file name will default to prop.csv
    • save_args['iteration_label']: A string containing a file indicator for the propagated profiles saved in save_args['outdir'] to keep track of which pyNBS iteration this propagation profile corresponds to. Otherwise all propagated profile matrices may be saved with the same name. Can pass the name 'kernel' as well to this function to indicate that the function is saving a network kernel instead of propagated profiles.

Returns:

  • prop_data_df (pandas.DataFrame): The network-smoothed somatic mutation profiles. The rows are patients/samples and the columns are genes in the network.

Additional notes about this function:
  • Similarly to the network_propagation function, we first separate the molecular network into each connected component and then perform network propagation for each connected component and concatenate the resulting propagated matrices along the diagonal for each subgraph.
Clone this wiki locally