gW: create gWalk

gWR Documentation

create gWalk

Description

Wrapper that instantiates a gWalk object from a variety of different inputs. If a gGraph is provided as input (in conjunction with sedge.id, snode.id, or grl input) then will check for existence of the provided walks in the provided graph, and will error out if those walks do not exist).

Usage

gW(
  snode.id = NULL,
  sedge.id = NULL,
  grl = NULL,
  graph = NULL,
  meta = NULL,
  circular = NULL,
  drop = FALSE,
  disjoin = FALSE
)

Arguments

snode.id

list of (possibly negative) integer signed node ids in a gGraph

sedge.id

list of (possibly negative) integer signed edge ids in a gGraph,

grl

GRangesList of walks in the genome, each walk is a (stranded) GRangesList, if graph is NULL will build a gGraph from the provided GRangesLists

graph

an existing graph from which to build a graph (used in conjunction with snode.id, sedge.id, or grl), if used with grl will attempt to match up the provided grl's with edges in the graph, if the GRL walks non-existent edges, then will error out

drop

logical flag only relevant when snode.id is specified indicating whether to drop any walks that refer to non-existent edges

disjoin

relevant for grl input when graph is NULL. If TRUE (default FALSE) will create a graph taking the GRanges disjoin of the GRanges comprising the provided GRL

Value

gWalk object of provided walks, with pointers back to the graph to which they refer.

Examples


## read in GRangesList of walks
walks.grl = readRDS(system.file('extdata', 'gw.grl.rds', package = "gGnome"))

## read in gGraph
gg = readRDS(system.file('extdata', 'walks.gg.rds', package="gGnome"))

## create gWalks from GRangesList - creates graph in which walks are disconnected, i.e. phased,
## so there may be several intervals per reference region
gW(grl = walks.grl)

## disjoin graph from GRangesList, these refer to a single disjoint graph
## where there is one interval per reference region
gW(grl = walks.grl, disjoin = TRUE)

## thread GRangesList onto existing graph
gW(grl = walks.grl, graph = gg)

## from lists of signed node ids
nid.list = list(c(-888, 322, 324, 325, 325), c(-708, 699, -706, 701, 702, 702))
gW(snode.id = nid.list, graph = gg)

## from lists of signed edge ids
eid.list = list(c(-1462, 1461), c(-133, -132, -134))
gW(sedge.id = eid.list, graph = gg)


mskilab/gGnome documentation built on May 8, 2024, 4:25 p.m.