This function expands the SRA attributes stored in sra.sample_attributes variable in the colData() slot of a RangedSummarizedExperiment-class produced by create_rse().

expand_sra_attributes(rse)

Arguments

rse

A RangedSummarizedExperiment-class object created by create_rse() or create_rse_manual().

Value

A RangedSummarizedExperiment-class object with expanded metadata columns.

Details

Note that this function will work on projects available from SRA only. Furthermore, SRA attributes are project-specific. Thus, if you use this function in more than one RSE object, you won't be able to combine them easily with cbind() and will need to manually merge the colData() slots from your set of RSE files before being able to run cbind().

Author

Andrew E Jaffe modified by Leonardo Collado-Torres.

Examples


## Find all available human projects
human_projects <- available_projects()
#> 2025-05-15 15:31:28.447533 caching file sra.recount_project.MD.gz.
#> 2025-05-15 15:31:28.920122 caching file gtex.recount_project.MD.gz.
#> 2025-05-15 15:31:29.406467 caching file tcga.recount_project.MD.gz.

## Find the project you are interested in
proj_info <- subset(
    human_projects,
    project == "SRP009615" & project_type == "data_sources"
)

## Create a RSE object at the gene level
rse_gene_SRP009615 <- create_rse(proj_info)
#> 2025-05-15 15:31:31.054281 downloading and reading the metadata.
#> 2025-05-15 15:31:31.466973 caching file sra.sra.SRP009615.MD.gz.
#> 2025-05-15 15:31:31.945732 caching file sra.recount_project.SRP009615.MD.gz.
#> 2025-05-15 15:31:32.448182 caching file sra.recount_qc.SRP009615.MD.gz.
#> 2025-05-15 15:31:33.043516 caching file sra.recount_seq_qc.SRP009615.MD.gz.
#> 2025-05-15 15:31:33.494239 caching file sra.recount_pred.SRP009615.MD.gz.
#> 2025-05-15 15:31:33.554898 downloading and reading the feature information.
#> 2025-05-15 15:31:33.958526 caching file human.gene_sums.G026.gtf.gz.
#> 2025-05-15 15:31:34.316052 downloading and reading the counts: 12 samples across 63856 features.
#> 2025-05-15 15:31:34.717869 caching file sra.gene_sums.SRP009615.G026.gz.
#> 2025-05-15 15:31:34.852585 constructing the RangedSummarizedExperiment (rse) object.

## Expand the SRA attributes (see details for more information)
rse_gene_SRP009615 <- expand_sra_attributes(rse_gene_SRP009615)