get_hyper_randomwalk: get_hyper_randomwalk

View source: R/get_hyper_randomwalk.R

get_hyper_randomwalkR Documentation

get_hyper_randomwalk

Description

get_hyper_randomwalk uses the transition possibility matrix, the mutation data to perform random walk with restart on hypergraph theta is the restart probability at every step of the random walk. output of get_hyper_randomwalk is a list which combines the Importance of the genes and the distance of vectors between one iteration

Usage

get_hyper_randomwalk(P, Mutation, theta = 0.2)

Arguments

P

the transition possibility matrix

Mutation

the mutation data, rows represent genes and columns represent samples

theta

the restart probability at every step of the random walk

Examples


###the transition possibility matrix P is calculated by get_P(Mutation,vertex_W) 
###and some relevant data should be calculated

###the example mutation data is a Lung Squamous Cell Carcinoma Dataset from TCGA
###We will show how to get the result of random walk on hypergraph

library(DriverRWH)

########## load the example mutation data ##########
#you can also use your own mutation data
#rows represent genes and columns represent samples
#rownames and colnames of mutation data cannot be omitted
data(luscExampleMutation)

##########     load the network data      ##########
#you can use HumanNet or STRINGv10 by loading HumanNet.rda or STRINGv10.rda
#you can also use your own network data
#the network data should have at least two columns
#the first two elements of each row are considered two vertices of an unweighted edge.
#Other elements in the row will be omitted
data(HumanNet)

##########   get the graph from HumanNet  ##########
graph=graph.data.frame(HumanNet)

####  get the vertex weight of the hypergraph   ####
W=get_vertex_W(Mutation=luscExampleMutation,graph=graph)

####  get the transition possibility matrix P   ####
P=get_P(Mutation=luscExampleMutation,vertex_W=W)

#### get the result of randomwalk on hypergraph ####
#the default value of theta is 0.2
out=get_hyper_randomwalk(P=P,Mutation=luscExampleMutation)


ShandongUniversityZhanglab/DriverRWH documentation built on May 10, 2022, 2:47 a.m.