Hey All I Want to generate in silico replicates for my samples. The Expression values from 5 samples are stored in data frame I wrote one function which is adding noise into my data which is quite reasonable but when I look at the summary of Replicates the median values for replicates are bit high than original.
> Summary(noise1)
A B C
Min. : 13.86 Min. : 12.09 Min. : 12.37
1st Qu.: 104.79 1st Qu.: 129.96 1st Qu.: 97.08
Median : 177.39 Median : 205.46 Median : 177.97
Mean : 434.74 Mean : 631.65 Mean : 424.75
3rd Qu.: 246.47 3rd Qu.: 309.99 3rd Qu.: 249.52
Max. :29194.97 Max. :34088.19 Max. :35463.34
D E
Min. : 17.77 Min. : 18.4
1st Qu.: 130.78 1st Qu.: 115.9
Median : 210.35 Median : 191.9
Mean : 551.05 Mean : 346.9
3rd Qu.: 294.92 3rd Qu.: 265.0
Max. :29059.16 Max. :16107.5
My Original Data
Summary(d1)
A B C
Min. : 3.831 Min. : 5.33 Min. : 4.58
1st Qu.: 9.248 1st Qu.: 22.50 1st Qu.: 9.55
Median : 19.387 Median : 48.73 Median : 18.49
Mean : 306.192 Mean : 507.19 Mean : 298.91
3rd Qu.: 62.902 3rd Qu.: 164.72 3rd Qu.: 68.70
Max. :29062.144 Max. :33955.38 Max. :35251.71
D E
Min. : 5.454 Min. : 5.454
1st Qu.: 18.021 1st Qu.: 20.747
Median : 40.747 Median : 32.089
Mean : 419.879 Mean : 217.255
3rd Qu.: 138.000 3rd Qu.: 81.630
Max. :29010.870 Max. :15940.595
Function:
fc<-data.frame(d1)
n<-data.frame(fc)
addNoise <- function(mtx)
{
# if (!is.matrix(mtx)) mtx <- matrix(mtx, byrow = TRUE, nrow = 1)
random.stuff <- matrix(runif(prod(dim(mtx)), min = 5, max = 250), nrow = dim(mtx)[1])
random.stuff + mtx
}
noise1<-addNoise(mtx = n)
Second Question
If I want to add noise by first talking row mean for each row and then add normally distributed noise in a reasonably small interval can any body suggest me how I can I do that?
Best
Adnan Javed
look at your data before you do this. It's very skewed. Wouldn't it be more appropriate for you to multiply the geometric mean of your data by a lognormal variable?