Here we transplant a subgraph (eg representing an event) into a recipient graph. The transplant operation will (1) fix the donor ALT junction copy numbers (2) leave the subgraph node copy numbers unconstrained (3) minimize the loose ends of the resulting balanced graph

Donor and recipient graph should both have $cn field defined on nodes and edges. Donor can also just be junctions, in which case the junction shadow will be taken as the footprint, or a footprint can be manually provided. The footprint will then provide a region where the copy number constraints are relaxed while loose ends strictly enforced.

Currently transplant is only well defined for haploid / unphased graphs ie those where there is at most a single interval representing a given reference genomic regions.

transplant(gg, donor, footprint = NULL, lambda = 1000, L0 = FALSE)

Arguments

gg

"haploid" gGraph with field $cn

donor

donor (haploid) gGraph or Junction object with field $cn

footprint

if gGraph not provided then footprint can be directly provided

lambda

loose end penalty to apply to balance operation (1000) to nodes within the donor region

L0

flag whether to use L0 penalty (FALSE)

Value

balanced gGraph with donor junctions incorporated at their donor cn

Author

Marcin Imielinski