hdng / clonevol

Inferring and visualizing clonal evolution in multi-sample cancer sequencing
GNU General Public License v3.0
141 stars 45 forks source link

Monoclonal Fishplot Failure #16

Closed RaphaelHablesreiter closed 4 years ago

RaphaelHablesreiter commented 6 years ago

Hello, I have similar data to the example dataset of clonevol, but I am not able to create a FishPlot as shown in the readme-file. The problem is that the infer.clonal.models()-function scales low vaf-values so that they are in total 100% (see figure).

clonevol

How can I change the infer.clonal.models()-function, to be able to create a FishPlot as in the example.

Thanks in advance.

hdng commented 6 years ago

What errors did you get? Can you send a long the data and code that produced the errors?

RaphaelHablesreiter commented 6 years ago

I am using this dataset and we know that the disease is monoclonal: AML_07.txt

and use this code to produce the plots: FishPlot copy.txt

For this I am getting three different models, where the first one looks like this:

clonevol

and the fishplot:

fishplot

hdng commented 6 years ago

Okay I see what the problem is. Here is the quick dirty fix. If you insert the following code after generateFishplotInputs, it will scale the cell.frac according to VAF.

vafs = estimate.clone.vaf(clonevol_model$variants, vaf.col.names=vaf.col.names) scales = vafs[vafs$cluster == 1, vaf.col.names]/max(vafs[vafs$cluster == 1, vaf.col.names]) for (i in 1:length(fishplot_input$cell.fractions)){ fishplot_input$cell.fractions[[i]] = (fishplot_input$cell.fractions[[i]] * as.matrix(scales[rep(1,nrow(fishplot_input$cell.fractions[[i]])),])) }

You also need to change the shape param in fishPlot to "spline":

fishPlot( fishplot_layout,

shape = "bezier",

    shape = "spline",
    cex.title = 0.7,
    vlines = seq(1, length(input_names)),
    vlab = input_names,
    pad.left = 0.5

)

RaphaelHablesreiter commented 6 years ago

Thank you!