View source: R/functions_expr_data.R
SRR_2_GSM | R Documentation |
Maps SRR identifiers to GSM identifiers using information from the SRA ftp server (see Details). Note that this function assumes that the command line tool grep has been installed to extract relevant information for the study.
SRR_2_GSM(counts, global.mapping.file, study.mapping.file)
counts |
[data.frame or matrix] raw counts with genes in rows and samples in columns |
global.mapping.file |
[character(1)] path to local copy of SRA_Accessions.tab |
study.mapping.file |
[character(1)] name of file to save study specific mapping information |
The global.mapping.file SRA_Accessions.tab has to be downloaded from https://ftp.ncbi.nlm.nih.gov/sra/reports/Metadata/SRA_Accessions.tab If study.mapping.file exists, it will be loaded without repeating the extraction process.
[data.frame or matrix] raw counts with colnames replaced by GSM identifiers
## Not run: # define temporary directory for storing file from recount temp.dir = tempdir() # get counts from recount library(recount) recount::download_study( project = "SRP057087", type = "counts-gene", outdir = temp.dir) counts = read.table( file.path(temp.dir, "counts_gene.tsv.gz"), header = TRUE, row.names = 29) # mapping counts.new = SRR_2_GSM( counts = counts, global.mapping.file = system.file( "extdata", "SRA_Accessions_example.tab", package = "harmonizeGeneExprData"), study.mapping.file = file.path(temp.dir, "mapping.rds")) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.