3  Data, references and public archives

An analysis needs three things: your reads, a reference genome, and a description of each sample. This chapter explains the file formats you will meet, how to choose a reference genome, and how to use public data safely.

NoteIn this chapter you will learn
  • which file formats hold reads, alignments, peaks, signal and methylation;
  • what an assembly, an analysis set, an annotation and a blacklist are;
  • how GEO, SRA and ENA store public data, and how their accession numbers are linked;
  • what to check in each public sample before you analyse it;
  • how to import public data and upload your own files in EpiNexus.

3.1 The question

Do you have the right files, the right reference, and a correct description of each sample? Small mistakes at this stage spread through the whole analysis. For example, a sample labelled with the wrong condition, or reads aligned to the wrong genome version, give results that look normal but are wrong.

3.2 File formats

The analysis reads and writes files in a few standard formats.

Table 3.1: Common file formats.
Format What it holds Made by
FASTQ (.fastq.gz) Raw reads: the sequence of each read and a quality score for each base The sequencer
BAM (.bam) Aligned reads: where each read sits in the genome, and how sure the aligner is The aligner (Li et al. 2009)
BED, narrowPeak, broadPeak Regions, such as peaks: chromosome, start, end, and scores The peak caller
bigWig (.bw) Signal along the genome, for viewing in a browser Coverage tools (Kent et al. 2010)
Bismark coverage (.cov) Methylation per CpG: position, percent methylated, and counts of methylated and unmethylated reads Bismark

FASTQ files are where the analysis starts. For paired-end sequencing, there are two files per sample: one for each end of the fragments (often called R1 and R2).

A BAM file stores each aligned read with its position and a mapping quality. The mapping quality says how sure the aligner is that the read belongs at that position (Chapter 5).

A peak file lists regions. The narrowPeak format adds a signal value, a p-value, a q-value and the position of the summit to each region.

A bigWig file stores the signal along the genome in a compact form. Genome browsers can read only the part they need, so even large files load quickly (Kent et al. 2010).

3.3 Reference genomes

Assemblies

A reference genome is the DNA sequence of a species, assembled into chromosomes. The reference genome of a species can have several versions, called assemblies. For example, human has hg19 (GRCh37) and hg38 (GRCh38), and mouse has mm10 (GRCm38) and mm39 (GRCm39). The same gene has different coordinates in different assemblies.

Use one assembly for the whole analysis. If you compare your results with published results, use the same assembly as the publication, or convert the coordinates with a tool made for this.

Analysis sets

Some assemblies contain extra sequences: alternative versions of some regions, and pieces that are not placed on any chromosome. If a region appears twice in the reference, a read from that region aligns equally well to both copies. The aligner then gives the read a low mapping quality, and the read is removed later (Chapter 5). To avoid this, analysis pipelines use an analysis set: a version of the assembly without the alternative copies.

Annotation

The annotation lists genes, transcripts and their start sites. For human and mouse, GENCODE is the most widely used annotation (Frankish et al. 2023). Because annotations are updated often, use the same version throughout one analysis, and report it.

Blacklists

A blacklist (or exclusion list) is a list of regions of the genome that give a strong signal in almost every experiment, whatever the target. Amemiya and colleagues describe them as regions “that have anomalous, unstructured, or high signal in next-generation sequencing experiments independent of cell line or experiment” (Amemiya et al. 2019). They are often repeats or regions near centromeres. Reads in these regions “should be identified and filtered before application of any threshold, normalization, or peak calling as they can dramatically bias the results” (Amemiya et al. 2019).

NoteIn EpiNexus 1.4

EpiNexus supports 17 genomes. Only installed genomes are shown when you create a project.

  • Human (hg38): the UCSC analysis set, with GENCODE v46 genes and the ENCODE unified exclusion list.
  • Human (hg19): the UCSC analysis set, with GENCODE v46lift37 genes and the ENCODE Blacklist v2.
  • Mouse (mm10, mm39): GENCODE genes (vM25, vM35), with the ENCODE Blacklist v2 (mm10) or the excluderanges list (mm39).
  • Other animals: UCSC RefSeq genes. Blacklists exist for ce11 and dm6.
  • Arabidopsis (tair10): Ensembl Plants, with the excluderanges list.

For genomes without a blacklist, the run tells you that blacklisted regions were not removed. Each run records the exact reference it used: the sequence file, the annotation and the blacklist, with their checksums.

3.4 Public data

Public archives hold data from thousands of published studies. You can use them to compare with your own data, to test a method, or to reanalyse a study.

  • GEO (Gene Expression Omnibus) holds the description of each study and sample, and often the processed results (Barrett et al. 2013). GEO accession numbers start with GSE (a study, or “series”) or GSM (a sample).
  • SRA (Sequence Read Archive) and ENA (European Nucleotide Archive) hold the raw reads (Katz et al. 2022; Burgin et al. 2023). They share their data with each other. Their accession numbers start with SRR or ERR (a sequencing run), SRX or ERX (an experiment) and PRJNA or PRJEB (a project).

One GEO sample (GSM) usually links to one experiment (SRX), which may have several runs (SRR).

Check what the data really are

Archive descriptions are written by people, and they are not always clear. Before you analyse public data, check each sample:

  1. The assay. GEO and SRA list a library strategy for each sample, such as ChIP-Seq, ATAC-seq or DNase-Hypersensitivity. However, CUT&RUN and CUT&Tag are often listed as “ChIP-Seq” or “OTHER”.
  2. The target. Find the antibody in the sample description. Inputs and IgG controls are often named only in the sample title.
  3. The condition and the replicate. Read the sample characteristics, not only the title.
  4. The tissue or cell type. Note where each sample comes from. EpiNexus uses this information to check, after the run, that each sample looks like its tissue (Chapter 6).
  5. The genome. Check the species, and check whether the authors’ processed files use an older assembly.
WarningPitfall: the wrong part of a study

Large studies are often split into several GEO series, one per assay, linked by a “SuperSeries”. While preparing this book, we imported GSE132292 and expected CUT&RUN data. However, it was the study’s DNase-seq series. The CUT&RUN data are in GSE132290. The analysis ran without error, and the results looked plausible. Only the library strategy in the archive showed the mistake. Always check the assay of each sample before you start.

NoteIn EpiNexus 1.4

On the Upload Data page, open the tab From a public repository (GEO / SRA / ENA).

  • Enter up to 20 accessions: GSE, GSM, SRP, SRX, SRR, PRJNA or SAMN numbers, and their forms at ENA and at the DNA Data Bank of Japan (DDBJ). Studies with controlled access, in the database of Genotypes and Phenotypes (dbGaP) or the European Genome-phenome Archive (EGA), cannot be imported.
  • Click Look up. EpiNexus shows the samples and the files it would import. It fills in the target, the condition, the replicate and the tissue from the archive text, and suggests a reference tissue. It recognises replicate numbers written in the titles as “rep1”, “replicate 1” or “#1” (the last form since version 1.2.7). Check every field. These values are guesses from free text. Mark inputs as “input” and IgG controls as “IgG”.
  • Click Import N sample(s). The files go directly from ENA to your project. EpiNexus checks each file against ENA’s MD5 checksum and refuses a damaged file. If ENA has no FASTQ for a sample, EpiNexus downloads the sample’s reads from NCBI SRA and converts them.
  • One import can hold up to 200 samples. Imported files count towards your storage quota of 100 GB.

When a sample’s library strategy in the archive does not match the assay of your run, the Review step of the run wizard shows a note.

Your own files

NoteIn EpiNexus 1.4

On the Upload Data page, the tab From my computer accepts the files listed in Table D.1: FASTQ files, BAM files, peak files, Bismark coverage files (.cov) and a few others. Files are sent in 50 MB pieces. If the connection breaks, the upload continues where it stopped. After the upload, EpiNexus checks that the transfer was complete and that the file looks like the format that its name indicates. A file that passes both checks shows Transfer verified · format check passed.

3.5 Pitfalls

WarningPitfall: mixing assemblies

Peaks called on hg19 and genes from hg38 do not match. The error is silent: genes are simply assigned to the wrong regions. Use one assembly for everything.

WarningPitfall: trusting sample titles

A title such as “H3K27ac_Control_rep1” can mean an H3K27ac sample from the control condition, not a control sample. Read the sample characteristics, and set the target and condition yourself.

Key points

  • FASTQ files hold raw reads, BAM files aligned reads, peak files regions, bigWig files the signal along the genome, and Bismark coverage files the methylation at each CpG.
  • Use one assembly and one annotation version for the whole analysis: the same gene has different coordinates in different assemblies.
  • An analysis set leaves out the alternative copies of regions, so that reads from these regions do not get a low mapping quality and are not removed.
  • Reads in blacklisted regions should be removed before normalisation and peak calling, because these regions give a strong signal in almost every experiment.
  • GEO holds the descriptions of studies and samples, whereas SRA and ENA hold the raw reads.
  • Archive descriptions and sample titles can mislead: check the assay, target, condition, replicate, tissue and genome of each public sample before you analyse it.

3.6 Further reading

  • Amemiya et al. (2019): why blacklists are needed and how they were made.
  • Frankish et al. (2023): GENCODE, the main gene annotation for human and mouse.
  • Barrett et al. (2013), Katz et al. (2022) and Burgin et al. (2023): GEO, SRA and ENA.