geo_characteristics {recount} | R Documentation

## Build a data.frame from GEO's charactersitics for a given sample

### Description

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.

### Usage

    geo_characteristics(pheno)

### Arguments

`pheno` | A DataFrame-class as created by geo_info.

### Value

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.

### Author(s)

Leonardo Collado-Torres

### Examples

    ## 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")]

[Package recount version 1.14.0 Index]