read_metadata: Read the metadata files

View source: R/read_metadata.R

read_metadataR Documentation

Read the metadata files

Description

This function reads in the recount3 metadata files into R. You can first locate the files using locate_url() then download it to your computer using file_retrieve().

Usage

read_metadata(metadata_files)

Arguments

metadata_files

A character() with the local path to recount3 metadata files.

Value

A data.frame() with all lower case column names for the sample metadata.

See Also

Other internal functions for accessing the recount3 data: annotation_ext(), create_rse_manual(), file_retrieve(), locate_url_ann(), locate_url(), project_homes(), read_counts()

Examples


## Download the metadata files for project ERP110066
url_ERP110066_meta <- locate_url(
    "ERP110066",
    "data_sources/sra"
)
local_ERP110066_meta <- file_retrieve(
    url = url_ERP110066_meta
)

## Read the metadata
ERP110066_meta <- read_metadata(local_ERP110066_meta)
dim(ERP110066_meta)
colnames(ERP110066_meta)

## Read the metadata files for a project in a collection
## Note: using the test files since I can't access collections right now
## for this collection
ERP110066_collection_meta <- read_metadata(
    metadata_files = file_retrieve(
        locate_url(
            "ERP110066",
            "collections/geuvadis_smartseq",
            recount3_url = "http://snaptron.cs.jhu.edu/data/temp/recount3"
        )
    )
)
dim(ERP110066_collection_meta)
## New columns for this collection
colnames(ERP110066_collection_meta)[!colnames(ERP110066_collection_meta) %in% colnames(ERP110066_meta)]

## Read the metadata for a mouse project
DRP002367_meta <- read_metadata(
    metadata_files = file_retrieve(
        locate_url("DRP002367", "data_sources/sra", organism = "mouse")
    )
)
dim(DRP002367_meta)

## Locate and read the GTEx bladder metadata
gtex_bladder_meta <- read_metadata(
    file_retrieve(
        locate_url("BLADDER", "data_sources/gtex")
    )
)

dim(gtex_bladder_meta)
colnames(gtex_bladder_meta)

LieberInstitute/recount3 documentation built on Dec. 11, 2024, 8:35 p.m.