When subsetting a qPCRset (e.g., for features), the sample names get lost. Assigning an expression set explicitly does not work as well. Let's say raw is a qPCRset:
rawSub <- raw[myFeatures, ] sampleNames(raw) # result is correct, e.g. "Sample1", "Sample2", ... sampleNames(rawSub) # result is just "1", "2", ...
When I try to assign an expression set explicitly, I get an error message:
es <- exprs(rawSub) colnames(es) <- sampleNames(raw) exprs(rawSub) <- es Error in assayDataElementReplace(object, "exprs", value, validate = TRUE) : unused argument (validate = TRUE)
In the current Bioconductor version (3.4) the function "assayDataElementReplace" indeed does not have an argument "validate". In previous versions this function had "validate" as an argument, and the default was TRUE. My guess is that now the error I mentioned above is also triggered but silently ignored when subsetting a qPCRset. I think that the HTqPCR package should be modified to remove the "validate" argument. Because "validate = TRUE" was the default in previous Bioconductor versions of assayDataElementReplace, HTqPCR would still work correctly even for those older Bioconductor versions.
Here are the source code locations which need to be changed:
qPCRset.R:32: function (object, value) assayDataElementReplace(object, "exprs", value, validate=TRUE) qPCRset.R:157: function (object, value) assayDataElementReplace(object, "featureCategory", value, validate=FALSE) qPCRset.R:184: function (object, value) assayDataElementReplace(object, "flag", value, validate=FALSE)
Regards
Henrik
Just saw that you used "validate=FALSE" for "featureCategory" and "flag", so removing the "validate" argument would change something for older Bioconductor versions. Not sure if this would be an issue.
Okay, the patch below makes it at least possible to assign modified expression sets to a qPCRset (so I can at least fix the sample names). But subsetting a qPCRset still removed sample names. So there seems to be more which requires a fix.
Patch removed, see answer.