Main Bubbletree Functions
BubbleTree model and diagram
BubbleTree is a model based on three valid assumptions: 1) the paired normal specimen expresses the common diploid state, 2) variant sites are bi-allelic, and 3) genome segments (rather than the whole genome) with homogeneous copy number ratio and BAFs, exist in the profiled tumor genome. The first two assumptions generally hold, whereas the last homogeneity assumption can also be satisfied even in the case of a complex tumor clonal structure.
As the three assumptions are all generally plausible, we therefore developed a model for the BubbleTree diagram. For one homogenous genomic segment (x:y;p), we have,
Expected copy number, (CN)=2×(1-p)+(x+y)×p
Copy Ratio, R=(CN)/2=(1-p)+(x+y)/2×p (1)
B allele frequency, BAF=(y×p+1×(1-p))/((x+y)×p+2×(1-p))
and the homozygous-deviation score (HDS),
HDS= ∣BAF-0.5∣=(p×∣y-x∣)/(2×[(x+y)×p+2×(1-p)]) (2)
Based on equations (1) and (2), we are able to calculate an R score (copy ratio) and HDS for a segment (x:y; p). For example, (0:1; 0.75) will provide 0.625 and 0.3 for the R scores and HDS, respectively.
These calculations are performed by the getRBD() function
library(BubbleTree)
data(hetero.gr)
data(cnv.gr)
rbd=getRBD(snp.gr=hetero.gr,cnv.gr=cnv.gr)
## Segments with high SD:
## [1] seg.id hds.median hds.sd num.mark seg.mean chr
## [7] start end cyto.band
## <0 rows> (or 0-length row.names)
head(rbd)
## seg.id hds.median hds.sd num.mark seg.mean chr start end
## 1 1 0.12270 0.07103365 553 0.5339 chr1 762098 3440694
## 2 2 0.13615 0.05958364 5351 0.4673 chr1 3447666 49118903
## 3 3 0.29650 0.06771401 4272 -0.6061 chr1 49128694 121310027
## 4 8 0.25810 0.04683305 1188 1.0343 chr1 150418684 155954980
## 5 9 0.02815 0.04344431 6934 0.0513 chr1 155979184 247835485
## 6 10 0.28095 0.05170589 65 -0.6147 chr1 247875098 249210700
## cyto.band
## 1 p36.33
## 2 p36.32
## 3 p33
## 4 q21.3
## 5 q22
## 6 q44
A plot of R score and HDS at various ploidy states forms the branches of a BubbleTree plot which can be generated as follows. Normally, this function is called internally by the plotBubbles() function.
drawBranches()
The above figure introduces the relationship between HDS and R score (copy number ratio), both used to elucidate the tumor cell prevalence, ploidy state, and clonality for a tumor sample. Generally, the R score indicates the copy number change, ranging from 0 (homozygous deletion) to 3 (hexaploidy) or higher, while the HDS represents LOH, ranging from values of 0 to 0.5 (i.e., LOH with 100% prevalence). Each branch in the diagram starts at the root (1,0), a value of HDS=0 and R score=1. Namely, a diploid heterozygous genotype segment has a copy number ratio, or R score of 1 (tumor DNA copies=2; normal DNA copies=2, so 2/2=1) with no LOH (HDS=0) and is indicated with a genotype of AB, where the A allele is from one parent and the B allele is from the other parent presumably. Then from the root (1,0), the segment prevalence values are provided in increasing increments of 10%, with each branch representing a different ploidy state. As the values increase along the y-axis, the occurrence of LOH increases, such that on the AA/BB branch at HDS=0.5 and R score=1, this indicates a disomy state with LOH and 100% prevalence for the segment.
Generally, the branches mark the projected positions of segments at the given integer copy number ploidy states and prevalence. The plot clearly highlights how high prevalence values create distinct separation between branches (i.e., ploidy states), while as prevalence approaches zero, the branches are non-distinguishable. The ploidy states of Φ, AABB, and AAABBB all have HDS scores of 0, which indicate no LOH at increasing or decreasing R scores from a value of 1, and therefore differ most from the copy number neutral heterozygous disomy state (AB) by R score only. These three ploidy states indicate homozygous deletion (Φ) or amplifications (AABB=1 DNA copy number gain each allele, AAABBB=2 DNA copy number gains each allele). Other ploidy states such as ABB (brown), ABBB (blue), ABBBB (green), or ABBBBB (purple) share a piece of the same branch (i.e., the indistinguishable branches), suggesting the existence of multiple likely combinations of prevalence and ploidy states for that region. A tumor clone usually has more than one SCNA, so the abundance of the clone can still be inferred from other distinguishable branches.
Adding Leaves to the Tree
Along with the branches from the prediction of the model, bubbles (i.e., the leaves) are depicted on the basis of the real data, where the size of the bubbles are proportional to the length of the homogenous segments.
Using example data loaded above, we can regenerate the plot including leaves for this tumor sample
plotBubbles(rbd)
A bubble (i.e., the homogenous SCNA segment) represents the HDS and R score as measured from the assay, such as WES or WGS data. The location of the bubble determines the allele copy number(s) and prevalence for the SCNA segment. A close proximity between a bubble and branch indicates an integer copy-number (e.g. 15q11.2-14), whereas any deviation between the bubble and branch (e.g, 7q21.11-21.12) is due to either variation in the measurement or a non-integer copy-number – something that occurs with multiple clones harboring different SCNAs over the same region.
Tumor Purity
The purity, or prevalence of tumor cells within the tumor, can be determined from the SCNA segments at the highest HDS values, assuming the tumor cells all harbor some proportion of SCNAs or LOH.
The calc.prev() function can be used to extract tuor prevalence information from the plot.
pur <- calc.prev(rbdx=rbd,heurx=FALSE,modex=3,plotx="prev_model.pdf")
# extract the genotype (branch) and frequency for each segment
head(pur[[1]]$ploidy_prev)
## [,1]
## a "AAAAAB/ABBBBB_22"
## a "AAAAAB/ABBBBB_20"
## a "A/B_72"
## a "AAAAB/ABBBB_70"
## a "AAAAA/BBBBB_2"
## a "A/B_70"
# tumor purity
pur[[2]][nrow(pur[[2]]),2]
## [1] 71.2+/-8.4
## Levels: 30.7+/-5.5 5.6+/-2.4 71.2+/-8.4