The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Getting started with seqout

seqout is an R client for seqout.org. It finds the metadata of studies and samples in these public genomic archives:

Installation

Install the package with pak:

# install.packages("pak")
pak::pak("saketlab/seqout/R")

The default backend is the REST API. An API key or a local setup is not necessary for the REST API.

library(seqout)

Search the archives

Find studies

SeqoutSearch() finds studies in all the archives. You can give free text, filters, or the two together.

SeqoutSearch("cervical cancer single cell", db = "geo", limit = 5)

Find samples (cohorts)

SampleSearch() finds samples in all the studies. It uses the harmonized metadata as filters, for example tissue, disease, and age.

liver <- SampleSearch(
  organism = "Homo sapiens",
  tissue = "liver",
  age_min_years = 50,
  limit = 5
)
liver[, c("sample", "study_accession", "tissue", "disease", "sex", "age")]

For the query operators and the filters, refer to Search.

Use the pipe

The first argument of each function is its subject. The subject is an accession, a seqout_counts table, or a list of cohort filters. If a function has no other subject, the subject is the connection. You can connect the calls with the native pipe of R.

# A PubMed ID or a DOI, told apart by the value, to the datasets that cite it
"34764296" |>
  Paper() |>
  nrow()

list(tissue = "liver", organism = "Homo sapiens") |>
  SampleSearch(limit = 3) |>
  subset(select = c(sample, study_accession, disease))

In all the other functions, con is the last argument.

Get the metadata of a study

SeqoutGet() gets the metadata for the accession of a study, a sample, or a run. It also shows the related records in the other archives.

When you read a field for the first time, seqout gets it from the API and keeps a copy.

d <- SeqoutGet("GSE168652")
d
d$meta$title
c(samples = nrow(d$samples), runs = nrow(d$runs), papers = nrow(d$pubs))

Harmonized sample attributes

The enriched field shows the harmonized labels for each sample and each cell:

d$enriched[, c("sample", "tissue", "disease", "assay")]

For the metadata fields, refer to Metadata.

Read the counts matrices

seqout finds the processed supplementary files of GEO. It downloads these files and reads them into R matrices.

Show the counts files

SeqoutListCounts() shows the matrix units for a GEO accession. It does not download the matrix files. A unit is the smallest group of files that seqout can read as one matrix. Examples are a 10x triplet, or one .h5, .h5ad, or .rds file.

counts <- SeqoutListCounts("GSE297547")
m <- counts

nrow(m)
head(m[, c("unit", "sample", "format", "preferred", "has_metadata")], 4)

Read a matrix

SeqoutMatrix() reads one unit into a list of X, obs, and var.

rna <- SeqoutMatrix(counts, sample = "GSM8994520")
dim(rna$X)

Make a Seurat object

Seqout2Seurat() accepts one of these inputs:

It sends the other arguments to CreateSeuratObject().

obj <- Seqout2Seurat("GSE297547", sample = "GSM8994520", min.cells = 3, min.features = 200)

For the selection of units and for Seurat workflows, refer to Counts.

Change old gene IDs and repair Excel errors

SeqoutGeneNames() uses the genevintage package. It selects an annotation and changes the gene IDs to gene names. SeqoutCorrectNames() repairs the gene symbols that Excel changed. It compares the symbols with a reference that you give. The two functions do not change the expression values. They keep a record of each change, and SeqoutGeneReport() shows this record.

# GSE52529: original Ensembl IDs, FPKM not raw counts
old <- SeqoutListCounts("GSE52529") |>
  SeqoutMatrix(sample = "GSE52529_fpkm_matrix.txt.gz")
named <- old |> SeqoutGeneNames()
named$gene_annotation[[1]]$annotation

# GSE101942: verified Excel-damaged gene names
damaged <- SeqoutListCounts("GSE101942") |>
  SeqoutMatrix(sample = "GSE101942_IPSC_rawCounts.txt.gz")
repaired <- damaged |> SeqoutCorrectNames(species = "human", release = 116)
report <- SeqoutGeneReport(repaired)
report[report$status != "unchanged", ]

For GSE52529, genevintage selects GENCODE 17 on GRCh37. A version argument is not necessary. For examples that you can run, and to compare old symbols with new symbols, refer to Gene names: old identifiers and Excel errors.

Download the data files

Three functions download raw files and processed files:

Each function puts the files in a directory with the name of the accession. It does a check of the checksums. It does not download a file again if the file is on the disk.

Before you download, look at the supplementary field:

head(d$supplementary, 4)
DownloadSupplementary("GSE168652", "GSE168652")
DownloadRuns("SRR12012336", "SRR12012336")
DownloadBAMs("ERP117016", "ERP117016")

For the download modes and the checksums, refer to Downloads.

Select a backend

Backend Method Use
"api" (default) Sends queries to the REST API of seqout.org over HTTP. Usual workflows.
"parquet" Sends queries to the published Parquet dump with DuckDB. Offline workflows, large batch queries, and SQL analysis.

To use the Parquet backend, you must give "parquet" to SeqoutConnect(). A query to the REST API does not scan the full dump.

con <- SeqoutConnect("parquet", quiet = TRUE)

Query("SELECT count(*) AS n FROM geo_series", con = con)

Give the connection to con. Or, to make it the default for the session, use SeqoutDefault(con).

To close the Parquet connection, use SeqoutClose():

SeqoutClose(con)

For downloads of the Parquet dump, refer to Downloads.

Next steps

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.