Learn R Programming

SRAdb (version 1.30.0)

sraConvert: Cross-reference between GEO data types

Description

A common task is to find all the SRA entities of one type associated with another SRA entity (eg., find all SRA samples associated with SRA study 'SRP001990'). This function provides a very fast mapping between entity types to facilitate queries of this type.

Usage

sraConvert(in_acc, out_type = c("sra", "submission", "study", "sample", "experiment", "run"), sra_con)

Arguments

in_acc
Character vector of SRA accessions and should be of same SRA data type, either one of SRA submission, SRA study, SRA sample, SRA experiment and SRA run'
out_type
Character vector of the following SRA data types: 'sra', 'submission','study','sample','experiment','run'; if 'sra' is in out_type, out_type will be c("submission", "study", "sample", "experiment", "run")
sra_con
Connection to the SRAmetadb SQLite database

Value

A data.frame containing all matched SRA accessions.

See Also

getSRA, listSRAfile, getSRAinfo

Examples

Run this code
if(file.exists('SRAmetadb.sqlite')) {

	library(SRAdb)
	sra_dbname <- 'SRAmetadb.sqlite'	
	sra_con <- dbConnect(dbDriver("SQLite"), sra_dbname)

	## Convert SRA experiment accessions to other types
	a <- sraConvert( in_acc=c(" SRR000137", "SRR000138 "), out_type=c('sample'), sra_con=sra_con )
	b <- sraConvert (in_acc=c("SRX000089"), sra_con=sra_con) 

} else {
  	print("use getSRAdbFile() to get a copy of the SRAmetadb.sqlite file
and then rerun the example")
}

Run the code above in your browser using DataLab