I have an ExpressionSet object composed of 37 samples for HCC and cirrhosis situation and I would like to subset it according to names that I specified in two vectors. As a result, I want to have 2 expression arrays (one set is for HCC and other is for cirrhosis) after I subset this ExpressionSet. In order to subset the ExpressionSet, I have tried several methods but I could not get the samples and features at the same time.
expset_forall is ExpressionSet and names_HCC and names_cirr are the character vectors containing the names of samples.
This is expset_forall:
ExpressionSet (storageMode: lockedEnvironment) assayData: 20962 features, 37 samples protocolData sampleNames: GSM437457.CEL.gz GSM437458.CEL.gz ... GSM437493.CEL.gz (37 total)...
I have tried:
eset_forHCC = expset_forall[, sampleNames(expset_forall) %in% names_HCC]
it gives error of
"incorrect number of dimensions"
then I tried:
eset_forHCC= exprs(expset_forall[expset_forall@protocolData$sampleNames==names_HCC,] dim(eset_forHCC)  0 37
At last, I tried to subset it by reaching via pData:
As eset_forHCC, I expect the output:
ExpressionSet (storageMode: lockedEnvironment) assayData: 20962 features, 17 samples element names: exprs, se.exprs protocolData sampleNames: GSM437458.CEL.gz GSM437459.CEL.gz ... GSM437493.CEL.gz (17 total)
As eset_forcirr, I expect the output:
ExpressionSet (storageMode: lockedEnvironment) assayData: 20962 features, 17 samples element names: exprs, se.exprs protocolData sampleNames: GSM437460.CEL.gz GSM437459.CEL.gz ... GSM437491.CEL.gz (17 total)