hdng / clonevol

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

infer.clonal.models - bug with alternate cluster column names #40

Open iryxie opened 4 years ago

iryxie commented 4 years ago

In the function infer.clonal.models(), there is the option to specify cluster.col.name (default = 'cluster'), which I've been naming 'cluster_id'. But in the code where infer.clonal.models() calls on generate.boot, cluster.col.name isn't specified and then defaults to 'cluster':

        else if (subclonal.test == "bootstrap") {
            if (is.null(boot)) {
                boot = generate.boot(variants, vaf.col.names = vaf.col.names, 
                  depth.col.names = depth.col.names, vaf.in.percent = vaf.in.percent, 
                  num.boots = num.boots, bootstrap.model = subclonal.test.model, 
                  cluster.center.method = cluster.center, weighted = weighted, 
                  random.seed = random.seed)

Leading to this error:

Error in generate.boot(variants, vaf.col.names = vaf.col.names, depth.col.names = depth.col.names,  : 
  Input error: cluster column name does not appear in variants file.

I think the cluster.col.name=cluster.col.name option is missing from generate.boot()? Changing my column name to the default 'cluster' fixes this error.

Thanks for a very useful package!