+ - 0:00:00
Notes for current slide

Presenter notes contain extra information which might be useful if you intend to use these slides for teaching.

Press P again to switch presenter notes off

Press C to create a new window where the same presentation will be displayed. This window is linked to the main window. Changing slides on one will cause the slide to change on the other.

Useful when presenting.

Notes for next slide



Single-cell Formats and Resources



last_modification Updated:   purlPURL: gxy.io/GTN:S00123

Tip: press P to view the presenter notes | arrow-keys Use arrow keys to move between slides
1 / 27

Presenter notes contain extra information which might be useful if you intend to use these slides for teaching.

Press P again to switch presenter notes off

Press C to create a new window where the same presentation will be displayed. This window is linked to the main window. Changing slides on one will cause the slide to change on the other.

Useful when presenting.

Requirements

Before diving into this slide deck, we recommend you to have a look at:

2 / 27

question Questions

  • What does single-cell data look like?

  • What are the common single-cell formats?

  • Where can public single-cell data be found?

3 / 27

objectives Objectives

  • Learn the basic structure of single-cell data

  • Be able to recognise different types of single-cell metadata

  • Learn the common data formats used for storing single-cell data

  • Become familiar with some popular sources for public single-cell data

4 / 27

Breakdown of single-cell data

How is single-cell data structured?

5 / 27

Overview of single-cell data

  • Single-cell data consists of 4 main components:

    • Gene expression matrix
    • Cell metadata (barcodes)
    • Gene metadata (features)

    • Unstructured metadata

Basic structure of single-cell data

6 / 27

Single-cell data consists of 4 main components:

  • gene expression data
  • metadata about each cell
  • metadata about each gene
  • unstructured metadata about the data collected

All complex single-cell data formats will contain these 4 main sections, it's important to understand what these components are, how to identify them, and their importance in single-cell analysis

Gene expression matrix (Matrix)

  • 2D matrix of expression values

    • Rows represent genes
    • Columns represent cells
    • Values represent gene expression per cell
  • Can be in a full or sparse matrix form

Basic structure of single-cell data with the matrix section highlighted

7 / 27

The core component of single-cell data is the gene expression matrix. This is a 2D matrix representing the gene expression values for each gene in the sequenced cells.

Typically each row of the matrix represents the genes and the columns represent the cells. However, it is important to note that this is not always the case and some matrices may need to be transposed before further processing.

The matrix can come in two different forms: full or sparse.

Full matrices act as one large table where every entry contains a value, including genes that were not sequenced (in which case their value will be 0). This is the simplest format but can be inefficient to store as many of the values in the matrix are redundant.

A more compact method to store these values is with a sparse matrix. This is a compressed representation of the matrix that removes all values that contain no useful information whilst keeping track of the overall structure of the matrix.

Cell metadata (Barcodes)

  • Cell identifiers/barcodes

  • Patient/sample metadata

  • Quality control metrics



  • Example barcodes:
    • AAACCTGAGTCT
    • TGCATTAGGGA
    • CCGTTGACCTAC-0
    • GATCGATCGTCA-0

Basic structure of single-cell data with the cells section highlighted

8 / 27

The first section of metadata that will be explored is the cell metadata, commonly referred to as barcodes when stored in a file. This contains metadata on each cell. This metadata includes the cell identifiers/barcodes, data on the origin of each cell, and quality control metrics generated with further analysis tools.

Cell barcodes consist of the 4 nucleotide letters and occasionally suffixed with a dash and a number (which has various meanings). If a file contains a column containing data in this format, then you are likely looking at cell metadata!

Gene metadata (Features)

  • Gene identifiers/Ensembl IDs

  • Expression metrics

  • Quality control metrics



  • Example gene identifiers:
Gene Symbol Ensembl ID
AIF1 ENSG00000204472
ACOXL-AS1 ENSG00000204581
RPS27P25 ENSG00000233247
AGR2 ENSG00000106541

Basic structure of single-cell data with the genes section highlighted

9 / 27

The next section of metadata to explore is the gene metadata. Commonly referred to as features when stored in a file. This contains metadata about each gene that was sequenced. This metadata includes gene identifiers/ensembl IDs, expression metrics and quality control metrics, both generated with additional analysis tools.

Gene identifiers typically consist of a sequence of letters and numbers. If a column in your file contains these types of values then your likely looking at the gene metadata! (If you're unsure, performing an internet search on one of the potential gene names will likely reveal whether that string represents a gene)

Unstructured metadata

  • Batch/replicate information

  • Sequencing platform

  • Data / time

  • Tissue source



  • Example sequencing platforms:

    • 10X Chromium

    • Smart-Seq

    • inDrop

    • Cell-Seq

Basic structure of single-cell data with the other metadata section highlighted

10 / 27

The last section of metadata to explore is the unstructured metadata. This is data that is not associated with an individual cell or gene but instead the data as a whole. Because of this, the metadata contained here can vary, but may include information such as when the cells were sequenced, what sequencing platform was used, the source of the cell samples, etc.

Common single-cell data formats

What are the different formats for storing single-cell data?

11 / 27

Overview of the most common single-cell data formats

  • Tabular

  • Matrix Market (MTX)

  • AnnData

  • Loom

  • Seurat

  • Single Cell Experiment (SCE)

  • CellDataSet (CDS)

12 / 27

Basic single-cell formats

13 / 27

The following formats are fairly basic and only store sections of single-cell data (expression matrix, metadata, etc.)

Tabular

  • Most basic format

  • Stores all data in a single file

  • Contains:

    • Gene identifiers
    • Cell identifiers
    • Expression values



  • File extensions:
    • .csv
    • .tsv
    • .txt

Example of some single-cell data in tabular format

14 / 27

Tabular files are the most basic format for storing single-cell data. This format stores: expression matrix, cell identifiers, and gene identifiers in a single file. The data is separated with either commas (for .csv) or tabs (for .tsv/Tabular).

Whilst being simplistic and easy to read, the tabular format does have limitations, mainly its inability to store any additional metadata outside of the gene or cell identifiers.

Matrix Market (MTX)

  • Sparse matrix format

  • More compact way to store larger matrices with many 0 values

  • Doesn't include any metadata



  • File extensions:
    • .mtx
    • .mm

Basic structure of single-cell data with the matrix section highlighted

15 / 27

The Matrix Market format (MTX) is common for storing the gene expression matrix. This stores the expression data in the more compressed sparse matrix form. This type of file will likely be found alongside two additional files for the cell metadata (barcodes) and the gene metadata (features).

Complex single-cell formats

16 / 27

The following formats/objects are more complex and can all support storing all 4 core sections of single-cell data:

  • Gene expression matrix
  • Cell metadata
  • Gene metadata
  • Unstructured metadata

AnnData

  • Python-based single-cell format

  • Cell metadata (obs)

  • Gene metadata (var)



  • File extensions:
    • .h5ad

Diagram showing an overview of the AnnData format

17 / 27

The AnnData format is a Python-based single-cell object built upon the HDF5 format. The primary library for performing single-cell analysis with AnnData objects is Scanpy.

It's important to note that AnnData does not support sparse matrices, therefore large single-cell files with many expression values of zero will not be very efficient to store in memory.

Supported languages: Python

Supported packages: anndata

Loom

  • Based on HDF5 standard
  • Efficient for large datasets

  • Supports sparse matrices and hierarchical data

  • Graph objects for graphs and clusters



  • File extensions:
    • .loom

Basic structure of single-cell data

18 / 27

Loom is another format based on HDF5. Loom objects are supported in various different programming languages and supports sparse matrices making it efficient for large data files.

Supported languages:

  • Python
  • R
  • MATLAB
  • Mathematica
  • C
  • C++
  • Java
  • Ruby

Supported packages:

  • LoomPy (Python)
  • LoomR (R)

Seurat

  • R-based format used by the Seurat package

  • Allows for easy integration with the suite of Seurat tools



  • File extensions:
    • .rds
    • .rda
    • .rdata

Basic structure of single-cell data

19 / 27

Seurat is an R-based format that is commonly used with the Seurat package (the naming convention is a bit confusing!). This is a software package that contains various processing and analysis tools for single-cell data.

Supported languages: R

Supported packages: seurat

Single Cell Experiment (SCE)

  • R-based format provided by the Bioconductor package SingleCellExperiment

  • Integrates well with the Bioconductor ecosystem



  • File extensions:
    • .rds
    • .rda
    • .rdata

Basic structure of single-cell data

20 / 27

Single Cell Experiment (SCE) is another R-based format that is widely used within the Bioconductor ecosystem of tools for both processing and analysis of single-cell data.

Supported languages: R

Supported packages: SingleCellExperiment

CellDataSet (CDS)

  • R-based format used by the Monocle package

  • Integrates well with the Monocle package for various types of analysis



  • File extensions:
    • .rds
    • .rda
    • .rdata

Basic structure of single-cell data

21 / 27

CellDataSet (CDS) is the last of the R-based formats that is commonly used within the Monocle package which contains tools for performing various types of analysis.

Supported languages: R

Supported packages: monocle

Sources of single-cell data

Where are some sources to acquire public single-cell data?

22 / 27

Data sources

Repository Link to resource
NCBI https://www.ncbi.nlm.nih.gov/
Human Cell Atlas: Data Explorer https://explore.data.humancellatlas.org/projects
CellXGene Collection https://cellxgene.cziscience.com/datasets
Single Cell Portal https://singlecell.broadinstitute.org/single_cell
EBI Single Cell Expression Atlas https://www.ebi.ac.uk/gxa/sc/home
23 / 27

There are many publicly available sources for reusable single-cell data. The table shows some common sources for acquiring this data.

This table is not extensive and there are many other resources available!

Compressed Files

  • Some files may be compressed/archived

  • Requires decompression/extraction to process the data

  • May receive errors if left compressed



  • File extensions:
    • .zip
    • .gz
    • .tar
    • .tar.gz

Basic structure of single-cell data

24 / 27

It is common for single-cell data to be stored in a compressed format in order to reduce filesizes and make transferring the data simpler. It is important to recognise when a file is compressed as using compressed data in downstream tools may cause errors to occur.

There are two forms of compression that are common:

  • Individual file compression
  • Archive of multiple files

Individual files are typically compressed with zip (.zip) or gzip (.gz) and should be unzipped prior to processing.

When data is stored in multiple files/folders they may be archived into a single file (commonly called a tarball), this is done with the TAR tool (.tar). Like individual file compression, you will need to untar/extract the .tar file before further processing.

Finally, it is also common for multiple files/folders to both be compressed and archived into a single file, this is indicated with the extension .tar.gz. In this case the data will need to be both unzipped and then extracted before the data is available in it's original form.

keypoints Key points

  • Single-cell data consists of four main sections

  • Single-cell data can come in a variety of formats

  • Different data formats are required for different languages and packages

  • There are various public single-cell atlases that consist of useful data

25 / 27

curriculum Do you want to extend your knowledge?

Follow one of our recommended follow-up trainings:

26 / 27

Thank You!

This material is the result of a collaborative work. Thanks to the Galaxy Training Network and all the contributors!

Galaxy Training Network

Tutorial Content is licensed under Creative Commons Attribution 4.0 International License.

27 / 27

Requirements

Before diving into this slide deck, we recommend you to have a look at:

2 / 27
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow