gG: create gGraph

gGR Documentation

create gGraph

Description

Wrapper that instantiates a gGraph object from a variety of different inputs.

Only select parameters combos need to be / should be specified simultaneously.

Usage

gG(
  genome = NULL,
  breaks = NULL,
  junctions = NULL,
  alignments = NULL,
  juncs = NULL,
  prego = NULL,
  jabba = NULL,
  cougar = NULL,
  weaver = NULL,
  remixt = NULL,
  rck = NULL,
  nodes = NULL,
  edges = NULL,
  walks = NULL,
  nodeObj = NULL,
  edgeObj = NULL,
  meta = NULL
)

Arguments

genome

seqlengths or seqinfo object around which to build an empty gGraph

breaks

GRanges around which to build a reference gGraph

junctions

BND vcf or bedpe file path, gGraph::Junctions object, or GRangesList specifying pairs of locations to reconnect (can be used in conjunction with breaks)

alignments

GRanges with fields $cigar $flag and $qname (e.g. output of bamUtils::read.bam or RSeqLib::BWA specifying alignments to a reference, the graph will then represent the (possibly multimapped) implicit nodes and edges representing an "end to end" walk of all queries lifted to the reference. Insertions are represented as 0-width nodes and multi-maps yield branches. The resulting graph can be walked to exhaustively or greedily enumerate all possible linear embeddings of the queries on the reference

prego

path to PREGO output file. if specified, instantiates a gGraph object from PREGO output with y.field "cn" specifying copy number

jabba

path to JaBbA .rds output file, if specified instantiates a gGraph object from JaBbA output with y.field "cn" specifying copy number

weaver

path to Weaver output. if specified, instantiates a gGraph object from Weaver output with y.field "cn" specifying copy number

remixt

path to RemiXT output, if specified, instantiates a gGraph object from ReMiXT output with y.field "cn" specifying copy number

rck

path to RCK output, if specified, instantiates a gGraph object from RCK output with y.field "cn" specifying total copy number

nodes

GRanges of unsigned intervals to be rejoined in gGRaph, used in conjunction with edges argument below

edges

data.table with field n1, n2, n1.side, n2.side with each row specifying an edge, i.e. which sides ("left" vs "right") of which integer node indices to connect in the gGRaph

walks

GRangesList or gWalk to build a "haplograph" around, see ?haplograph

nodeObj

gNode object to create a gGraph around (similar to nodes input above), except generated via the $nodes accessor of an existing gGraph object, used in cojunction with gEdge input to create a new gGnome object from an existing one

meta

list of metadata to associate with this gGraph object, for now mostly used to populate gTrack visualization parameters

edgeeObj

gEdge object to create a gGraph around (similar to edges input above), except generated via the $edges accessor of an existing gGraph object

Value

A new gGraph object that is the sum of the component gGraphs

Examples

mygenome = c('chr1' = 1e6, 'chr2' = 1e7)
myjuncs = system.file('extdata', "delly.final.vcf.gz", package = "gGnome") ## junctions
mybreaks = gr.tile(mygenome, 10000) ## 1kb tiles across my genome
myweaver = system.file('extdata', 'weaver', package='gGnome')
myremixt = system.file('extdata', 'remixt', package='gGnome')
myprego = system.file('extdata', 'intervalFile.results', package='gGnome')
myjab = system.file('extdata', 'jabba.simple.rds', package="gGnome")

gG(genome = mygenome)

## create a graph from junctions
gG(breaks = mybreaks, juncs = myjuncs)

## import a genome graph from popular callers
gG(jabba = myjab)
gG(weaver = myweaver)
gG(prego = myprego)
gG(remixt = myremixt)


## hard code a graph from GRanges and edges
nodes = c(GRanges("1",IRanges(1,100),"*"), GRanges("1",IRanges(101,200),"*"),
               GRanges("1",IRanges(201,300),"*"), GRanges("1",IRanges(301,400),"*"),
               GRanges("1",IRanges(401,500),"*"))
edges = data.table(n1 = c(3,2,4,1,3),
                   n2 = c(3,4,2,5,4),
                   n1.side = c(1,1,0,0,1),
                   n2.side = c(0,0,0,1,0))
gg = gG(nodes = nodes, edges = edges, meta = list(gr.colorfield = 'type'))

## mostly for developer use 
gG(nodeObj = gg$nodes, edgeObj = gg$edges)


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