calebclass / NanoTube

Easy NanoString data analysis
GNU General Public License v3.0
1 stars 2 forks source link

pc.scalefactors are not identical to results from positiveQC #5

Closed chunxuan-hs closed 11 months ago

chunxuan-hs commented 12 months ago

I am a bit confused about the postive control steps.

In the codes

dta <- processNanostringData(nsFiles       = path_data,
                             sampleTab     = path_meta,
                             normalization = "nSolver",
                             idCol         = "RCC_Name",
                             output.format = "list")

It gives warning that

Identified positive scale factor outside recommended range
                    (0.3-3).
Check samples prior to conducting analysis.

And indeed in the dta$pc.scalefactors, there are small values.

However, when I run the positiveQC, I got the different scale values.

posQC <- positiveQC(dta)

Actually I expect them to be identical. Any insights are appreciated. Thanks!

Update: The R codes show that the scale factor in positiveQC are calculated on log scale, while scale factor in processNanostringData is calculated in raw scale? Regarding the recommended range (0.3-3), which approach is better?

calebclass commented 11 months ago

Thank you for raising this issue! NanoString recommends using the geometric mean of the raw counts to compute the scale factor. That means processNanostringData with normalize_pos_controls is working properly, while positiveQC is incorrect.

I will work on pushing a fix to positiveQC soon, but please use the scale factors from processNanostringData for now (ideally, I should get positiveQC to use normalize_pos_controls, but I'm not sure how easy that will be). I believe positiveQC is calculating R-squared correctly for Observed vs. Expected, because NanoString recommends for this statistic to be calculated from log2 values. But I will double-check to make sure.

chunxuan-hs commented 11 months ago

Many thanks for the updates!