uclahs-cds / package-CancerEvolutionVisualization

Publication Quality Phylogenetic Tree Plots
https://cran.r-project.org/web/packages/CancerEvolutionVisualization/
GNU General Public License v2.0
2 stars 0 forks source link

Dendrogram mode fails edge case with many clones #133

Closed whelena closed 1 month ago

whelena commented 4 months ago

The dendrogram mode was tested with a simulated sample with 1000 subclones. This seems to break the node collision prevention algorithm. The resulting plot seems to not have any optimization applied. Specifiying specific angle or spread param in the dataframe does not change the result.

test tsv: /hot/software/package/public-R-CancerEvolutionVisualization/development/hwinata-manuscript/data/multi-sample/phylogeny-1000.tsv

code:

phy1000.dt <- fread(test.tsv, header = TRUE, sep = '\t');
phy1000.dt[, `:=`(
    mode = 'dendrogram',
    length.1 = 10,
    connector.type = 'solid',
    connector.col = 'black',
    connector.width = 3
    )];
phy1000.dt[parent == which(label == '1'), spread := 5];

plt <- SRCGrob(
    phy1000.dt,
    horizontal.padding = 1.5,
    yaxis1.label = 'Distance (# of SNV)',
    add.normal = TRUE,
    use.radians = FALSE,
    draw.nodes = FALSE
    );

Resulting plot:

Screenshot 2024-07-22 at 10 36 07 AM