Closed jungminchoilab closed 6 years ago
A couple of things went wrong:
The following code should work with your current data.
library(clonevol)
# read clustering, prepare data for clonevol
x = read.table('YLR107_clonevol_clean.input', header=T, stringsAsFactors=F, sep='\t')
vaf.col.names = grep('.vaf', colnames(x), value=T)
colnames(x) = gsub('.vaf', '', colnames(x))
vaf.col.names = gsub('.vaf', '', vaf.col.names)
# make sure cluster are continuous integer starting at 1
x$cluster[x$cluster == 0] = max(x$cluster) + 1
# let clonevol decide colors
clone.colors = NULL
# plot cluster of variants to make sure clustering is good
pdf('box.pdf', width = 5, height = 5, useDingbats = FALSE, title='')
pp <- plot.variant.clusters(x,
cluster.col.name = 'cluster',
show.cluster.size = FALSE,
cluster.size.text.color = 'blue',
vaf.col.names = vaf.col.names,
vaf.limits = 70,
sample.title.size = 20,
violin = FALSE,
box = FALSE,
jitter = TRUE,
jitter.shape = 1,
jitter.color = clone.colors,
jitter.size = 1,
jitter.alpha = 1,
jitter.center.method = 'median',
jitter.center.size = 1,
jitter.center.color = 'darkgray',
jitter.center.display.value = 'none',
highlight = 'is.driver',
highlight.shape = 21,
highlight.color = 'blue',
highlight.fill.color = 'green',
highlight.note.col.name = 'gene',
highlight.note.size = 2,
order.by.total.vaf = FALSE)
dev.off()
# infer tree
y = infer.clonal.models(variants = x,
cluster.col.name = 'cluster',
vaf.col.names = vaf.col.names,
sample.groups = NULL,
cancer.initiation.model='monoclonal',
subclonal.test = 'bootstrap',
subclonal.test.model = 'non-parametric',
num.boots = 1000,
founding.cluster = 1,
cluster.center = 'mean',
ignore.clusters = NULL,
clone.colors = NULL,
min.cluster.vaf = 0.01,
sum.p = 0.05,
alpha = 0.05)
# always need to run this to prepare tree for plotting
y = convert.consensus.tree.clone.to.branch(y)
# now plot
plot.clonal.models(y,
box.plot = TRUE,
fancy.boxplot = TRUE,
fancy.variant.boxplot.highlight = 'is.driver',
fancy.variant.boxplot.highlight.shape = 21,
fancy.variant.boxplot.highlight.fill.color = 'red',
fancy.variant.boxplot.highlight.color = 'black',
fancy.variant.boxplot.highlight.note.col.name = 'gene',
fancy.variant.boxplot.highlight.note.color = 'blue',
fancy.variant.boxplot.highlight.note.size = 2,
fancy.variant.boxplot.jitter.alpha = 1,
fancy.variant.boxplot.jitter.center.color = 'grey50',
fancy.variant.boxplot.base_size = 12,
fancy.variant.boxplot.plot.margin = 1,
fancy.variant.boxplot.vaf.suffix = '.VAF',
clone.shape = 'bell',
bell.event = TRUE,
bell.event.label.color = 'blue',
bell.event.label.angle = 60,
clone.time.step.scale = 1,
bell.curve.step = 2,
merged.tree.plot = TRUE,
tree.node.label.split.character = NULL,
tree.node.shape = 'circle',
tree.node.size = 30,
tree.node.text.size = 0.5,
merged.tree.node.size.scale = 1.25,
merged.tree.node.text.size.scale = 2.5,
merged.tree.cell.frac.ci = FALSE,
merged.tree.clone.as.branch = TRUE,
mtcab.event.sep.char = ',',
mtcab.branch.text.size = 1,
mtcab.branch.width = 5,
mtcab.node.size = 3,
mtcab.node.label.size = 1,
mtcab.node.text.size = 1.5,
cell.plot = TRUE, num.cells = 100,
cell.border.size = 0.25,
cell.border.color = 'black',
clone.grouping = 'horizontal',
scale.monoclonal.cell.frac = TRUE,
show.score = FALSE,
cell.frac.ci = TRUE,
disable.cell.frac = FALSE,
out.dir = 'output', out.format = 'pdf',
overwrite.output = TRUE,
width = 11, height = 7,
panel.widths = c(3,4,2,4,4))
The results should look like this.
Btw, don't forget to install the latest version of clonevol. I've just pushed lots of updates.
This is great!
Thank you so much for your prompt help.
Hi Ha,
Archive.zip Thanks for distributing the software. I appreciate your generosity. I generated the input for the Clonevol using pyclone (attached here) and ran the scripts following your instructions until step 4 as shown below without outputting the errors (RData files is also attached).
Now when I tried to plot the trees, i am getting the errors that other users have been reporting which I could not fix even after following the suggestions from you.
I would appreciate it if you can spend time looking into my data and suggest how to fix it. Please let me know if you need additional information.
Best, Jungmin Choi