Entering edit mode
floodking
•
0
@floodking-8748
Last seen 9.3 years ago
I want to select columns from phenoData of ExpressionSet in R. My data to be processes is teset.
class(teset)
[1] "ExpressionSet"
attr(,"package")
[1] "Biobase"
teset
ExpressionSet (storageMode: lockedEnvironment)
assayData: 19420 features, 253 samples
element names: exprs
protocolData: none
phenoData
sampleNames: TCGA-CV-7091-01A-11D-2012-08 TCGA-CJ-4875-01A-01D-1373-10 ...
TCGA-25-1626-01A-01W-0615-10 (253 total)
varLabels: time status ... Tumor_grade (7 total)
varMetadata: labelDescription
featureData
featureNames: 1060P11.3 A1BG ... ZZZ3 (19420 total)
fvarLabels: EntrezID Symbol Desc Synonyms
fvarMetadata: labelDescription
experimentData: use 'experimentData(object)'
Annotation:
covariates information of teset:
names(pData(teset))
[1] "time" "status" "Age" "Gender"
[5] "TCGA_tumor_type" "Tumor_stage" "Tumor_grade"
I only want a teset data without the first two columns in pData, namely all exprs data with pData(teset)[,-c(1,2)]. How can I do this? Thanks for help!!!
I am not sure what you are really asking for, as you don't use very exact language, and a naive interpretation of what you say doesn't make sense. In other words, the columns of the phenoData object each contain information about all of the samples in the study (for example the first column appears to have data pertaining to 'time', presumably time of collection or some such, and the time variable has one entry for each sample). Put another way, the rows of the phenoData object match up with the columns of the expression data, so wanting to exclude columns of the expression data based on columns of the phenoData doesn't make sense.
So you could be asking how to remove the first two columns from the phenoData object itself, but that isn't necessary in any scenario I can come up with. You can simply ignore the phenoData object altogether, or only use certain columns, or whatever you like.
But perhaps you want to exclude samples from the ExpressionSet based on some rule, based on what is in the first two columns of the phenoData object? If so, please note that ExpressionSets act just like matrices or data.frames when using the '[' function, so you can do something like