RWR_ShortestPaths: RWR Shortest Paths

View source: R/RWR_shortestpaths.R

RWR_ShortestPathsR Documentation

RWR Shortest Paths

Description

RWR_ShortestPaths Find shortest paths between genes in the given gene sets. These will be output as a table of edges. There are two ways to use this:

  1. provide one geneset (g) and you will get all shortest paths between genes in g.

  2. provide two genesets (g and p) and you will get the shortest paths between genes in g and genes in p.

Usage

RWR_ShortestPaths(
  data = NULL,
  source_geneset = NULL,
  target_geneset = NULL,
  outdir = ".",
  out_path = NULL,
  threads = 1,
  cyto = FALSE,
  verbose = FALSE,
  write_to_file = FALSE
)

Arguments

data

Path to the .Rdata file for your combo of underlying functional networks. This file is produced by RWR_make_MHobject.R

source_geneset

Path to the gene set file. If given with –target_geneset, find shortest paths between genes in –source_geneset and –target_geneset. Otherwise, find shortest paths among genes in –source_geneset only. It must have the following cols without heading: <setid> <gene>.

target_geneset

Path to the second geneset file. If it is not provided then the shortest paths will be calculated between genes in source_geneset.

outdir

Full path to the output file directory. Two output files will be generated with different suffixes. Default "."

out_path

Specify the full path for output. Ignore –outdir and –modname and use this instead.

threads

Number of threads to use.

cyto

Include this parameter if you wish to see the shortest paths in Cytoscape. Cytoscape must already be running first! If your geneset(s) are large (e.g. 100+) then loading all the shortest paths fully into cytoscape can take a while. Default FALSE

verbose

Verbose mode. Default FALSE

write_to_file

Also write the results to a file. Default FALSE

Value

Returns a data frame.

Examples


# An example of Running RWR_ShortestPaths

extdata.dir <- system.file("example_data", package = "RWRtoolkit")
multiplex_object_filepath <- paste(extdata.dir,
  "/string_interactions.Rdata",
  sep = ""
)
geneset1_filepath <- paste(extdata.dir, "/geneset1.tsv", sep = "")
geneset2_filepath <- paste(extdata.dir, "/geneset2.tsv", sep = "")
outdir <- "./rwr_shortestpath"

rwr_shortest_path_output <- RWR_ShortestPaths(
  data = multiplex_object_filepath,
  source_geneset = geneset1_filepath,
  target_geneset = geneset2_filepath,
  write_to_file = TRUE,
  outdir = outdir
)


dkainer/RWRtoolkit documentation built on Jan. 11, 2025, 3:26 a.m.