Search
Question: Excluding columns of phenoData of ExpressionSet Data in R
0
gravatar for floodking
2.2 years ago by
floodking0
floodking0 wrote:

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!!!

ADD COMMENTlink written 2.2 years ago by floodking0

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

pheno <- pData(phenoData(teset))
## this next line is obviously just an example
filt <- pheno$time > 3 & pheno$status %in% "control"
## urgh. Edited
teset.filt <- teset[,filt]
ADD REPLYlink modified 2.2 years ago • written 2.2 years ago by James W. MacDonald45k
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: 226 users visited in the last hour