I am using 'GEOquery' package to get GSE data. How can I fetch the "genotype/variation" column.
gset <- getGEO('GSE25205')[[1]]
sampleTitles = as.character(pData(gset)$characteristics_ch1.1)
> sampleTitles
[1] "genotype/variation: Caspase 1 null" "genotype/variation: Caspase 1 null" "genotype/variation: Caspase 1 null"
[4] "genotype/variation: wild-type" "genotype/variation: wild-type" "genotype/variation: wild-type"
[7] "genotype/variation: wild-type" "genotype/variation: ASC1 null" "genotype/variation: ASC1 null"
[10] "genotype/variation: ASC1 null"
mystrsplit = function(x) strsplit(x,split=': ', fixed=TRUE)[[1]][2]
sampleTitles = unlist(lapply(sampleTitles, mystrsplit))
Works fine, but I see that the column name for "genotype/variation" is not fixed (The name may be 'characteristics_ch1' or 'characteristics_ch1.2' and so on.. ) and in some cases (with difft GSEs) the column name is different. Is there any other way to fetch the the above information.
EDIT:
I have the following solution, but if there is some direct function, I would be happy to know that.
library(gdata)
pdata = phenoData(gset)@data
cols = which(startsWith(colnames(pdata), "characteristics_ch"))
#Find which columns corr to the column which contain "genotype/variation:"
for (l in 1:length(cols))
{
cvals = pdata[,cols[l]]
if(any(startsWith(cvals, "genotype/variation:")))
genoVariCol = cols[l]
}
genoVariCol #contains the
Hello,
Can you guide me how I can extract the required sample by applying multiple conditions?
c1=as.numeric(pData(eset)$characteristics_ch1.2=="name: metformin")
After this step c1 contains "1" for right samples, but I want to apply an additional constraint which is that cell line should be MCF7, hence I tried this:
c1=as.numeric(pData(eset)$characteristics_ch1.2=="name: metformin") && (pData(eset)$characteristics_ch1.7=="cell: MCF7")
But it is not working..! Can you guide me how I can do that?
I'd suggest writing a new question with the details, including code and error messages.
I have posted a question, kindly share your views about it.