jtleek / sva-devel

28 stars 46 forks source link

Potential issue with sva_network #61

Open s-a-nersisyan opened 4 months ago

s-a-nersisyan commented 4 months ago

Hello,

The first line of sva_network function applies SVD transformation to mean-centered (over columns, i.e., genes) expression matrix:

ss<-svd(dat - colMeans(dat))

I think dat - colMeans(dat) is not the correct code for mean-centering columns of the data frame or matrix – instead of subtracting the mean of the column from all rows of the column, it does the job with a vector recycling approach.

You can easily see that by using the bladder cancer dataset from the documentation – printing the result of colMeans(dat - colMeans(dat)) shows that the means are not zero.