> For the complete documentation index, see [llms.txt](https://help.connected.illumina.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.connected.illumina.com/dragen/dragen-v4.6/product-guides/dragen-v4.6/dragen-reference-support/hg19-configurations.md).

# hg19 Reference Configurations

This guide provides recipes for building custom hg19 reference genomes with different configurations. You can customize the standard hg19 reference by adding PAR (Pseudoautosomal Region) masking, replacing the mitochondrial contig with the hg38 version, or combining both modifications.

## Overview and comparison

The following table compares the key components of different hg19 and hs37d5 reference:

| Component                   | hg19 (default)         | PAR-masked hg19        | hg19-rCRS              | PAR-masked hg19-rCRS   | hs37d5 (default)    | hs37d5\_chr (default) |
| --------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | ------------------- | --------------------- |
| **Autosomal contigs**       | chr1-chr22             | chr1-chr22             | chr1-chr22             | chr1-chr22             | 1-22                | chr1-chr22            |
| **Sex chromosomes**         | chrX, chrY             | chrX, chrY             | chrX, chrY             | chrX, chrY             | X, Y                | chrX, chrY            |
| **Mitochondrial contig**    | NC\_001807.4           | NC\_001807.4           | NC\_012920.1 (rCRS)    | NC\_012920.1 (rCRS)    | NC\_012920.1 (rCRS) | NC\_012920.1 (rCRS)   |
| **Y chromosome PAR masked** | No                     | Yes (Mask-BED)         | No                     | Yes (Mask-BED)         | Yes (Hard)          | Yes (Hard)            |
| **Decoy contigs**           | Auto-added             | Auto-added             | Auto-added             | Auto-added             | Included            | Included              |
| **EBV contig**              | Auto-added             | Auto-added             | Auto-added             | Auto-added             | Included            | Included              |
| **ALT contigs**             | Included (Auto-masked) | Included (Auto-masked) | Included (Auto-masked) | Included (Auto-masked) | None                | None                  |
| **Unplaced contigs**        | Included               | Included               | Included               | Included               | None                | None                  |
| **Random contigs**          | Included               | Included               | Included               | Included               | None                | None                  |

## Step 1: Prepare the resources

Before building the hg19 references, download the pangenome reference collection from the [DRAGEN Software Support Site](https://support.illumina.com/sequencing/sequencing_software/dragen-bio-it-platform/product_files.html). Choose the collection that matches your DRAGEN version.

Extract the collection into its own folder:

```bash
# Replace with the collection file you downloaded
COLLECTION=hg19-pangenome-reference-collection-<version>.tar.gz

mkdir -p hg19-collection
tar -xzf $COLLECTION -C hg19-collection
```

The collection contains the reference FASTA and all resource files needed by the recipes below. To confirm the version you extracted, read `info.json`:

```bash
cat hg19-collection/info.json
```

Point the recipe variables at the extracted files. This keeps the recipes version agnostic: the file names inside the collection are stable across versions, so only the downloaded collection file changes.

```bash
COLLECTION_DIR=hg19-collection

REF_FASTA=$COLLECTION_DIR/hg19.fa
MASK_BED=$COLLECTION_DIR/hg19-ht_mask_bed-v1.bed
PANGENOME_VCF=$COLLECTION_DIR/hg19-graph_ms_vcf_encrypted-v1.bin
EXCLUSION_BED=$COLLECTION_DIR/hg19-graph_excl_bed-v1.bed
INDSUP_BED=$COLLECTION_DIR/hg19-ht_hapdb_pop_alt_insdup_bed-v1.bed.gz
```

The default variables above build a standard hg19 reference. The following steps are optional. Apply the ones that match the flavor you want, then run the build command. Each step updates a variable so the build command stays the same regardless of flavor.

## Step 2 (optional): Mask the chromosome Y PAR regions

Mask the chromosome Y PAR (Pseudoautosomal Region) so reads map to the chromosome X copy. This produces the PAR-masked hg19 flavor.

Create a BED file with the chromosome Y PAR intervals, then append it to the mask BED from the collection:

```bash
cat > chrY_par.bed << 'EOF'
chrY	10001	2649520	PAR1
chrY	59034050	59363566	PAR2
EOF

cat $MASK_BED chrY_par.bed > hg19-ht_mask_bed-w-PAR.bed
cat $EXCLUSION_BED chrY_par.bed > hg19-graph_excl_bed-w-PAR.bed 

# Point the build at the PAR-masked BED
MASK_BED=hg19-ht_mask_bed-w-PAR.bed
# Point the build to the PAR-excluded graph exclusion BED file
EXCLUSION_BED=hg19-graph_excl_bed-w-PAR.bed 
```

## Step 3 (optional): Replace the mitochondrial contig with rCRS

The default hg19 mitochondrial contig is `chrM` (NC\_001807.4). Replace it with the revised Cambridge Reference Sequence (rCRS, NC\_012920.1) to produce the hg19-rCRS flavor.

Download the rCRS sequence and rename its contig to `chrMT`:

```bash
# Download rCRS (NC_012920.1) from NCBI
curl -s "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&id=NC_012920.1&rettype=fasta&retmode=text" \
  | sed '1s/.*/>chrMT/' > rCRS_chrM.fa

# Replace the hg19 chrM with rCRS
samtools faidx $REF_FASTA \
  $(cut -f1 $REF_FASTA.fai | grep -v '^chrM$') > hg19-rCRS.fa
cat rCRS_chrM.fa >> hg19-rCRS.fa
samtools faidx hg19-rCRS.fa

# Point the build at the rCRS reference
REF_FASTA=hg19-rCRS.fa
```

## Step 4: Build the reference

Run the build command. The variables set above determine the flavor: default hg19, PAR-masked, hg19-rCRS, or PAR-masked hg19-rCRS.

```bash
dragen \
  --build-hash-table true \
  --ht-reference $REF_FASTA \
  --ht-mask-bed $MASK_BED \
  --ht-graph-msvcf-file $PANGENOME_VCF \ # Pangenome reference ONLY
  --ht-graph-exclusion-bed $EXCLUSION_BED \ # Pangenome reference ONLY
  --ht-graph-extra-kmer-bed $EXTRA_KMER_BED \ # Pangenome reference ONLY
  --ht-hapdb-pop-alt-insdup-bed $INDSUP_BED \ # Pangenome reference ONLY
  --ht-hapdb-fitler-pop-alt-insdup true \ # Pangenome reference ONLY
  --ht-hapdb-mm2-index $REF_FASTA \ # Pangenome reference ONLY
  --output-directory $OUTPUT_DIR \
  --ht-num-threads 32
```

### Note

See [Prepare a Reference Genome](/dragen/dragen-v4.6/product-guides/dragen-v4.6/dragen-reference-support/prepare-a-reference-genome.md) for options to build a reference that supports CNV, RNA, HLA, and Methylation.

## Common options

| Option                             | Description                                                                                                                               |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `--build-hash-table`               | Set to `true` to build a hash table.                                                                                                      |
| `--ht-reference`                   | Path to the reference genome FASTA file.                                                                                                  |
| `--ht-mask-bed`                    | Path to the BED file defining regions to mask.                                                                                            |
| `--ht-graph-msvcf-file`            | Path to the multi-sample VCF file for pangenome reference.                                                                                |
| `--ht-graph-exclusion-bed`         | Path to the BED file defining regions to exclude from the pangenome reference.                                                            |
| `--ht-graph-extra-kmer-bed`        | Path to the BED file defining regions where extra k-mers are added to the pangenome reference.                                            |
| `--ht-hapdb-pop-alt-insdup-bed`    | Path to the BED file to identify population alternate insertion/duplication regions from which to exclude population alternative contigs. |
| `--ht-hapdb-fitler-pop-alt-insdup` | Set to `true` to filter population alternate contigs in the insertion/duplication regions.                                                |
| `--ht-hapdb-mm2-index`             | Path to the reference FASTA used to identify whether population alternate contigs are homologous to the insertion/duplication regions.    |
| `--output-directory`               | Directory where hash table output files are written.                                                                                      |
| `--ht-num-threads`                 | Number of worker threads for hash table construction (default=8, max=32).                                                                 |

## See also

* [Prepare a Reference Genome](/dragen/dragen-v4.6/product-guides/dragen-v4.6/dragen-reference-support/prepare-a-reference-genome.md) — Detailed hash table builder options and advanced tuning.
* [DRAGEN Reference Support](/dragen/dragen-v4.6/product-guides/dragen-v4.6/dragen-reference-support.md) — Reference recommendations by pipeline.
* [DRAGEN Software Support Site](https://support.illumina.com/sequencing/sequencing_software/dragen-bio-it-platform/product_files.html) — Download pre-built references and pangenome resources.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.connected.illumina.com/dragen/dragen-v4.6/product-guides/dragen-v4.6/dragen-reference-support/hg19-configurations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
