carlosproca / cdnormbio

R package: Condition-Decomposition Normalization for Biological Applications
MIT License
4 stars 2 forks source link

Could you explain concept of offset #1

Closed hackerzone85 closed 7 years ago

hackerzone85 commented 7 years ago

I do not understand these two commands i.e. concept of adding offset. Could you explain? Please..

offset.added <- rnorm( sample.n )
expr.data <- sweep( expr.data, 2, offset.added, "+" )
carlosproca commented 7 years ago

Hi Mahendra, offset.added simulates what would be the technical variation that needs to be detected and removed from the data. It is just a number for each sample, that is, for each column of the matrix expr.data. The sweep() call adds those numbers, by columns, to expr.data