makeGraphDf {shazam} | R Documentation |
Build a data.frame from a ChangeoClone and an igraph object containing a clonal lineage
Description
makeGraphDf
creates a data.frame from a ChangeoClone and an
igraph graph
object containing a B cell lineage tree and associated sequence data.
The data.frame contains the original fields and additions such as each sequence's parent in the
lineage tree, the lineage germline, and additional rows for inferred sequences.
Usage
makeGraphDf(
curCloneGraph,
curCloneObj,
objSeqId = "sequence_id",
objSeq = "sequence"
)
Arguments
curCloneGraph |
an igraph |
curCloneObj |
ChangeoClone object used to generate the lineage. |
objSeqId |
name of the sequence identifier field in |
objSeq |
name of the nucleotide sequence field in |
Value
A data.frame
with sequence and lineage information, including the
the parent nucleotide sequence in the lineage tree(parent_sequence
),
an internal parent identifier (parent
), and additional rows for germline
sequence and inferred intermediate sequences.
Values in the sequence_id
field are renamed to numeric values,
prefixed with the clonal grouping identifier and labeled as either "Inferred"
or "Germline"
if they are not an observed sequence. For example, for a lineage
with clone_id = 34
the new identifiers would be of the form:
"34_Germline"
, "34_Inferred1"
, "34_1"
, "34_2"
, etc.
Note that the original sequence identifier is preserved in the orig_sequence_id
field
and the original parent sequence identifier is retained in orig_parent
.
See Also
See observedMutations to calculate mutation frequencies using
parent_sequence
as the reference germline. See ChangeoClone,
buildPhylipLineage, and graph for details on the
input objects.
Examples
# Load and subset example data
data(ExampleDb, package = "alakazam")
data(ExampleTrees, package = "alakazam")
graph <- ExampleTrees[[17]]
db <- subset(ExampleDb, clone_id == graph$clone)
clone <- alakazam::makeChangeoClone(db)
# Extend data with lineage information
df <- makeGraphDf(graph, clone)