2
$\begingroup$

I have the raw counts for RNA-Seq data. I converted counts data to logCPM using edgeR package.

Lets say I have a dataframe A with 15000 genes as rows and 100 samples as columns with counts data. I have used following code from edgeR tutorial.

logCPM <- cpm(A, prior.count=2, log=TRUE)
head(logCPM)[1:5,1:5]
               Sample1          Sample2          Sample3         Sample4
A1BG          -1.019429        0.8333739        -1.192960       -0.6717287
A2M            7.622280        7.8057767         7.932570        8.6409077
A2ML1          1.004541        1.0909119         5.462613        6.4149348
A4GALT         2.126502        1.8403954         5.322601        2.9469345
AAAS           5.785888        5.1639501         5.259789        5.3248026
               Sample5
A1BG          0.3121975
A2M           9.1949911
A2ML1         9.4740594
A4GALT        2.9214979
AAAS          4.3708063

After converting counts to logCPM I see there is another command for scaling which is used for heatmaps.

logCPM <- t(scale(t(logCPM)))

It is given there that scaling each row (each gene) to have mean zero and standard deviation one in page 15 edgeR

Is this nothing but z-score? or Is there any otherway to calculate z-score from logCPM data?

thanq

$\endgroup$

1 Answer 1

1
$\begingroup$

Yes this is nothing but a z-score. The scale function calculates column z-scores, but since you use t (transpose), it is actually performed on rows. There are many other ways to calculate z-scores, but if done correctly they will all give the same results.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.