Friends,
I have about 22000 genes in rows and 100 samples in column in my microarray normalized file. I was going to remove genes with 0 standard deviation then I did like below,
I opened rstudio,
setwd("E:/normalization")
RMA <- read.delim("E:/normalization/RMA.txt", header=FALSE)
mycounts <- read.table("RMA.txt", sep="\t", header=TRUE)
Mat_sd <-apply(mycounts, 1,sd)
ids <- which(Mat_sd<0.1)
mycounts <- mycounts[-ids,]
write.table(mycounts, file = "RMAsd.txt", dec = ".", sep = "\t", quote = FALSE)
but the output file is empty, means I have only samples name in column and nothing in rows anymore. Then what was my fault in the above code? Even I tried for sd<1
but again empty rows.
why is the "ids" variable negative?
it's not negative. indexing with negative integer vectors removes those. op wanted to remove rows with sd < 0.1, that's the opposite of your solution.
Sorry Michael,
won't you tell me a solution? because really i can't get what i should do