cloneArborescence: Function to calculate the arborescence for a fully connected...

View source: R/cloneArborescence.R

cloneArborescenceR Documentation

Function to calculate the arborescence for a fully connected graph of B cell clone members.

Description

Function to calculate the arborescence for a fully connected graph of B cell clone members.

Usage

cloneArborescence(
  clone,
  cloneID,
  columnSeqID,
  columnSubclass,
  tree,
  outputFolder,
  plotFormat = "png",
  colourSpecification = list(colours = list(M = "#FF0000", IgA1 = "#9999CF", IgA2 =
    "#000088", IgG1 = "#326600", IgG2 = "#58B200", IgG3 = "#8BFF19", IgG4 = "#CBFF99"),
    germlineColour = "#AAAAAA")
)

Arguments

clone

Matrix / data frame holding the clone information.

cloneID

Identifier of clone.

columnSeqID

Name of the column holding the ID of the observation.

columnSubclass

Name of the column holding the isotype subclass (see manual page of function getArborescence for a list of allowed levels in this column).

tree

Character, filename of the phylogenetic tree.

outputFolder

Folder, where the arborescence data and plot are to be stored.

plotFormat

Either 'png' or 'pdf'. (default: 'png')

colourSpecification

List of colours, a meaningful default is set.

Value

A list with the following elements:

graph

igraph object holding the arborescence tree.

table

A data.frame object holding the edgelist of the arborescence tree.

lineage_plot

ggplot object of a lineage plot where sequences are ordered by their distance from the germline and coloured by isotypes. See vignette for more details.

csr_events

data.frame showing edges in the tree which switches isotype, and an estimated distance-from-germline of this switching event. This is defaulted as the mean distance-from-germline of the two nodes connected by the said edge.


Fraternalilab/BrepPhylo documentation built on Jan. 3, 2025, 10:03 a.m.