Is mean adjusted for purity?
1
0
Entering edit mode
twtoal • 0
@twtoal-15473
Last seen 6 months ago

You previously indicated that the C values in the PureCN output have been adjusted for purity.  Does this also hold true for the "mean" values for mean log ratios?  It appears to me that they are adjusted for purity (but are still log mean ratios, not actual mean ratios and not twice the ratio to give a copy number value).

PureCN mean ratio • 623 views
ADD COMMENT
0
Entering edit mode
@markusriester-9875
Last seen 28 days ago

All the log-ratios are standard log2 tumor vs normal coverage (of course after normalization for total sequencing coverage). Exactly what you would get from any other copy number tool that does not do any purity/ploidy adjustment like CNVkit, GATK4 etc. So no purity adjustment.

If you need purity adjustment of log-ratios for some reason, for example when downstream tools like GISTIC expect log2 ratios, you can follow https://www.nature.com/articles/ng.2760 (section Impurity-corrected GISTIC).

Feel free to add a GitHub issue if you think that some of the output is not clearly documented in the main vignette (mainly Tables 1-5).

ADD COMMENT
0
Entering edit mode

Thanks, that was a helpful reference.  However, I see that it has a mistake in its equation for R'(x).  I believe the correct equation should be:

R'(x) = q(x)/T = [atR(x) + 2(1-a)R(x) - 2(1-a)] / aT

T = tau, a = alpha, q(x) = integer CN in cancer cells, R(x) = observed CN ratio, R'(x) = CN ratio in tumor cells

His derivation:

  R(x) = (aq(x)+2(1-a))/D
D = aT + 2(1-a)
q(x) = DR(x)/a - 2(1-a)/a
R'(x) = q(x)/T = R(x)/a - 2(1-a)/aT

where:

  R'(x) = adjusted coverage ratio
R(x) = raw coverage ratio
q(x) = integer copy number in cancer cells
D = average ploidy across all cells of tumor (of sample)
a = purity
T = tumor ploidy

However, in the last step where he substituted q(x) in q(x)/T, he did the algebra wrong.  The correct algebra is:

R'(x) = q(x)/T = DR(x)/aT - 2(1-a)/aT = (aT + 2(1-a))R(x)/aT - 2(1-a)/aT
= R(x) + 2(1-a)R(x)/aT - 2(1-a)/aT
= [aTR(x) + 2(1-a)R(x) - 2(1-a)]/aT

As a test, say that purity = a = 0.5, tumor ploidy = T = 2, and raw coverage ratio is 1.5.  Then we expect the adjusted coverage ratio to be 2 (tumor segment is 2X amplify (4 copies) and this becomes raw ratio of 1.5 when purity is 1/2:   [0.5*4 + 0.5*2] / 2 = 1.5).

His: R'(x) = 1.5/0.5 - 2(0.5)/(0.5 * 2) = 3 - 2(0.5) = 2 (correct)
​Mine: R'(x) = [0.5*2*1.5 + 2(0.5)1.5 - 2(0.5)] / (0.5*2) = 1.5 + 1.5 - 1 = 2 (correct)

But now suppose that tumor ploidy = T = 4, and we still have purity=a=0.5.  Say raw coverage ratio = 1.0, which means there is no tumor amplification, the number of copies at any locus is the same as the mean number of copies, in both the 2X normal and 4X tumor tissue.  Then we expect the adjusted coverage ratio to also be 1.

His: R'(x) = 1/0.5 - 2(0.5)/(0.5 * 4) = 2 - 2(0.5)/2 = 2 - 1/2 = 1.5 (wrong)
Mine: R'(x) = [0.5*4*1 + 2(0.5)1 - 2(0.5)] / (0.5 * 4) = [2 + 1 - 1] / 2 = 2 / 2 = 1 (correct)
ADD REPLY
0
Entering edit mode

Not sure, I looked into this more than 2 years ago. I used the following and believe it's correct:

rds <- readRDS("Sampleid.rds")

r <- rds$results[]  r$seg$seg.mean.adjusted <- r$seg$seg.mean/r$purity - 2*(1-r$purity)/(r$purity*r$ploidy) I haven't used it much though because I found little benefit in GISTIC and for everything else you usually want the absolute copy numbers. ADD REPLY 0 Entering edit mode Your equation above matches the one in the paper you cited, which is incorrect. Your seg.mean is his R(x), your purity is his a, your ploidy is his T. I found that PureCN:::.calcExpectedRatio() is doing it correctly (it is doing the inverse operation, computing R(x) from R'(x)). However, in runAbsoluteCN(), I find this line:  opt.C <- (2^(seg$seg.mean + log.ratio.offset) *  total.ploidy)/p - ((2 * (1 - p))/p)

and since C = ratio * ploidy, the above equation is the paper's (incorrect) R'(x) * ploidy.  It seems to be wrong.  Please check it.  Maybe I'm missing something, but to me it looks like a definite algebra mistake.

ADD REPLY
0
Entering edit mode

I think I'll go ahead and open an issue on the PureCN github project for this.

ADD REPLY

Login before adding your answer.

Traffic: 459 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
{"ft_lang_label":"__label__en","ft_lang_prob":0.9405274,"math_prob":0.99376667,"size":2540,"snap":"2021-04-2021-17","text_gpt3_token_len":767,"char_repetition_ratio":0.11159306,"word_repetition_ratio":0.021691974,"special_character_ratio":0.31299213,"punctuation_ratio":0.15177065,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9965838,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-04-21T13:33:24Z\",\"WARC-Record-ID\":\"<urn:uuid:5b481007-1419-4796-b313-2225e404053b>\",\"Content-Length\":\"27205\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:00c7559e-c19f-4061-ab4b-ead17af5369b>\",\"WARC-Concurrent-To\":\"<urn:uuid:35d3abaa-1ae2-4ea2-ae29-85bc16396967>\",\"WARC-IP-Address\":\"54.164.10.157\",\"WARC-Target-URI\":\"https://support.bioconductor.org/p/109478/\",\"WARC-Payload-Digest\":\"sha1:PFMU46EDY5JMX34XRAO7X7PRBSTVDJI4\",\"WARC-Block-Digest\":\"sha1:WAZG3BYBYONVJFMGEETNP6BVXH4GQP64\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-17/CC-MAIN-2021-17_segments_1618039544239.84_warc_CC-MAIN-20210421130234-20210421160234-00106.warc.gz\"}"}