Description Usage Arguments Value Author(s) Examples
View source: R/geo_characteristics.R
This function builds a data.frame from the GEO characteristics extracted for a given sample. The names of the of columns correspond to the field names. For a given SRA project, this information can be combined for all samples as shown in the examples section.
1 | geo_characteristics(pheno)
|
pheno |
A DataFrame-class as created by geo_info. |
A 1 row data.frame with the characteristic fields as column names and the values as the entries on the first row. If the authors of the study used the same names for all samples, you can then combine them using rbind.
Leonardo Collado-Torres
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## Load required library
library("SummarizedExperiment")
## Get the GEO accession ids
# geoids <- sapply(colData(rse_gene_SRP009615)$run[1:2], find_geo)
## The previous example code works nearly all the time but it
## can occassionally fail depending on how rentrez is doing.
## This code makes sure that the example code runs.
geoids <- tryCatch(
sapply(colData(rse_gene_SRP009615)$run[1:2], find_geo),
error = function(e) {
c(
"SRR387777" = "GSM836270",
"SRR387778" = "GSM836271"
)
}
)
## Get the data from GEO
geodata <- do.call(rbind, sapply(geoids, geo_info))
## Add characteristics in a way that we can access easily later on
geodata <- cbind(geodata, geo_characteristics(geodata))
## Explore the original characteristics and the result from
## geo_characteristics()
geodata[, c("characteristics", "cells", "shrna.expression", "treatment")]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.