GEO2R Gene Expression
1
1
Entering edit mode
nkline ▴ 10
@nkline-15239
Last seen 4.2 years ago

Hello,

I would like to automate the following process that uses GEO2R to analyze gene expression. For each contig I provide, this is the workflow I follow:

1. browse to https://www.ncbi.nlm.nih.gov/geo/geo2r/?acc=GSE36545
2. click Profile Graph
3. Enter ID: assembledIsotigs_Contig9526
4. click Set
5. click Sample Values
6. copy results from pop-up window:

Instead of going through the above workflow for each contig, is it possible to automate the process using something like the getGEO() function ?

Thanks!

geoquery • 695 views
1
Entering edit mode
@sean-davis-490
Last seen 1 day ago
United States

​library(GEOquery)
g = getGEO('GSE36545')[[1]]
barplot(exprs(g)['assembledIsotigs_Contig9526', ], horiz = TRUE, las=2, cex.names = 0.5)

Tinker with the plot to order samples as you see fit. For example, to order by tumor status:

barplot(exprs(g)['assembledIsotigs_Contig9526', order(pData(g)[, 'tumor status:ch1'])], horiz = TRUE, las=2, cex.names = 0.5)

0
Entering edit mode

Thanks Sean. Now I know how to create a bar plot. Ultimately, I would like the result as a tab-delimited file with sample, title, and value (just like it appears in the image above). Any idea how to make that happen with getGEO()?

0
Entering edit mode
tabler = function(g, gene_id) {
vals = exprs(g)[gene_id, ]
pd = pData(g)
return(data.frame(sample = sampleNames(g), title=pd\$title, values = vals ))
}
tabler(g, "assembledIsotigs_Contig9526")