Skip to content

Commit

Permalink
Merge pull request #56 from mskilab/rel2abs_in_jabba.simple.png
Browse files Browse the repository at this point in the history
transform with rel2abs before saving jabba.simple.png plot
  • Loading branch information
zining01 authored Nov 25, 2021
2 parents 5db9153 + 1f5de6f commit ecbe5e7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/JaBbA.R
Original file line number Diff line number Diff line change
Expand Up @@ -1478,12 +1478,17 @@ jabba_stub = function(junctions, # path to junction VCF file, dRanger txt file o

tmp.cov = sample(coverage, pmin(length(coverage), 5e5))
tmp.cov = gr.fix(tmp.cov, jabd$segstats)
# add ncn values
tmp.cov = tmp.cov %$% kag$segstats[,'ncn']
# transform using rel2abs
tmp.cov$cn = rel2abs(tmp.cov, purity = jab$purity, ploidy = jab$ploidy,
field = field, field.ncn = 'ncn')

y1 = pmax(5, max(jabd$segstats$cn)*1.1)
jabd$gtrack$y1 = y1
jabd.simple$gtrack$y1 = y1

td.cov = gTrack(tmp.cov, y.field = field, col = alpha('black', 0.2), name = 'Cov', y1 = (y1 + jab$gamma)/jab$beta)
td.cov = gTrack(tmp.cov, y.field = 'cn', col = alpha('black', 0.2), name = 'Cov', y1 = (y1 + jab$gamma)/jab$beta)

if (verbose)
{
Expand Down

0 comments on commit ecbe5e7

Please sign in to comment.