# NOT RUN {
# Preprocess clone
db <- subset(ExampleDb, CLONE == 3138)
clone <- makeChangeoClone(db, text_fields=c("SAMPLE", "ISOTYPE"),
num_fields="DUPCOUNT")
# Run PHYLIP and process output
dnapars_exec <- "~/apps/phylip-3.69/dnapars"
graph <- buildPhylipLineage(clone, dnapars_exec, rm_temp=TRUE)
# Plot graph with a tree layout
library(igraph)
plot(graph, layout=layout_as_tree, vertex.label=V(graph)$ISOTYPE,
vertex.size=50, edge.arrow.mode=0, vertex.color="grey80")
# To consider each indel event as a mutation, change the masking character
# and distance matrix
clone <- makeChangeoClone(db, text_fields=c("SAMPLE", "ISOTYPE"),
num_fields="DUPCOUNT", mask_char="-")
graph <- buildPhylipLineage(clone, dnapars_exec, dist_mat=getDNAMatrix(gap=-1),
rm_temp=TRUE)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab