Search
Question: remove NAs values from gset
0
gravatar for morteza.hadizade
8 days ago by
morteza.hadizade10 wrote:

Hi everyone

Sometimes in microarray analysis, “ex” matrix is contained any NA values, I remove NAs with “na.omit” command, after removing NAs from “ex” matrix, do I need to remove NAs from “gset”???

I would be very pleased if you could guide me.

 

gset <- getGEO(dataset, GSEMatrix =TRUE, AnnotGPL=TRUE, destdir = "C:/R Database /Data/")

if (length(gset) > 1) idx <- grep(platform, attr(gset, "names")) else idx <- 1

gset <- gset[[idx]]

ex <- exprs(gset)

> max(ex)

[1] NA

> dim(ex)

[1] 18999    24

> ex<- na.omit(ex)

> max(ex)

[1] 7.683

> dim(ex)

[1] 16764    24

> gset<- na.omit(gset)?????

ADD COMMENTlink modified 7 days ago by James W. MacDonald47k • written 8 days ago by morteza.hadizade10
1
gravatar for James W. MacDonald
7 days ago by
United States
James W. MacDonald47k wrote:

I don't believe there is a na.omit function that will dispatch correctly on an ExpressionSet, so you will need to do things slightly differently. But do note that an ExpressionSet is intended to act just like a matrix, so subsetting with the [ operator works just like you would think.

naind <- apply(exprs(gset), 1, function(x) any(is.na(x)))

gset <- gset[!naind,]
ADD COMMENTlink written 7 days ago by James W. MacDonald47k

Or probably faster

naind <- is.na(rowSums(exprs(gset)))

gset <- gset[!naind,]
ADD REPLYlink written 7 days ago by James W. MacDonald47k

Thank you so much for your valuable guidance, your answer was reasonable and accurate.

ADD REPLYlink written 6 days ago by morteza.hadizade10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 297 users visited in the last hour