seqout is an R client for seqout.org. It finds the metadata of
studies and samples in these public genomic archives:
Install the package with pak:
The default backend is the REST API. An API key or a local setup is not necessary for the REST API.
SeqoutSearch() finds studies in all the archives. You
can give free text, filters, or the two together.
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.
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.
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.
The enriched field shows the harmonized labels for each
sample and each cell:
For the metadata fields, refer to Metadata.
seqout finds the processed supplementary files of GEO.
It downloads these files and reads them into R matrices.
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.
SeqoutMatrix() reads one unit into a list of
X, obs, and var.
Seqout2Seurat() accepts one of these inputs:
SeqoutListCounts()It sends the other arguments to
CreateSeuratObject().
For the selection of units and for Seurat workflows, refer to Counts.
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.
Three functions download raw files and processed files:
DownloadSupplementary() downloads the processed files
of a dataset. Examples are counts matrices, annotations, and
archives.DownloadRuns() downloads the raw sequence reads in
FASTQ or SRA format.DownloadBAMs() downloads the BAM alignment files of the
submitter.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:
DownloadSupplementary("GSE168652", "GSE168652")
DownloadRuns("SRR12012336", "SRR12012336")
DownloadBAMs("ERP117016", "ERP117016")For the download modes and the checksums, refer to Downloads.
| 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():
For downloads of the Parquet dump, refer to Downloads.