Entering edit mode
I would like to know how I can rename the phenotypic variables of an ExpressionSet object (names(pData(ExpressionSet)). As well as of a data object SummarizedExperiment::RangedSummarizedExperiment); . The following text does not work, something to be expected since it should modify the Set Expression or SummarizedExperiment object
names(pData (microarray))[1]<- "NEW_VAR" or names(colData ( SummarizedExperiment::RangedSummarizedExperiment);)) [1] <- "NEW_VAR"
thanks... Javi
names(pData(microarray))[1]<- "NEW_VAR"
works, what is the error you have ?names(pData(microarray))[1]<- "NEW_VAR"
It doesn't work, it gives the following error:
invalid (NULL) left side of assignment
you cannot rename phenotypic variables in this way. I understand that it is not possible because you must change the slot of the S4 object (ExpressionSet) where the phenotypic variables are located. also. But I don't see any way to rename these phenotypic variables. Exists?
Could you share an example of your dataset(
dput(...)
) ? I tried with a random ExpressionSet andnames(p(Data(dataset))[1] <- "New_VAR"
works so your dataset might not be correctly formattedExcuse me, but I have had some personal issues that have not allowed me to put on.
I started to test and I think it is a problem of how R manages the objects, not of the S4 ExpressionSet object. If you create your own object where you add a atribute that is your ExpressionSet, you cannot use the typical get_, set_ functions to update values inside that object. You must work directly with the attribute and not through the get_ function.
OP1 fails, giving the indicated error since it tries to assign the value "NEW_VAR" to the function "get_" and not to the object it retrieves. OP2 works and modifies the name of the phenotypic variable.
Thanks for everything. I hope that it would be useful to someone. PS: The versions I work with: