# Human and pig DNA similarity: ProteinIQ's Ensembl 116 analysis

Analysis date: October 29, 2026. This is a descriptive analysis of Ensembl's public comparative genomics data for the guide [How much DNA do humans share with pigs?](https://www.proteiniq.io/guides/human-pig-dna-similarity). It extends the [human and animal analysis](../human-animal-dna-similarity/README.md) and reuses its gene-level table, so the denominators, release and counting rules are the same.

## Findings

Against 20,107 human protein-coding genes (Ensembl 116, GRCh38 reference chromosomes):

| Measure | Pig | Chimpanzee | Mouse |
| --- | ---: | ---: | ---: |
| Human genome inside the pairwise alignment | 48.5% | 91.4% | 32.5% |
| Human coding-exon bases aligned | 94.6% | 99.6% | 92.0% |
| Identical letters among aligned coding-exon bases | 86.7% | 99.0% | 83.1% |
| Human genes with any ortholog | 87.5% | 91.2% | 87.9% |
| Human genes with a one-to-one ortholog | 80.6% | 84.2% | 81.1% |
| Median protein identity, one-to-one orthologs | 89.1% | 99.3% | 86.9% |
| One-to-one proteins 100% identical | 2.0% | 18.5% | 1.8% |
| One-to-one proteins at least 95% identical | 25.1% | 89.5% | 20.6% |

Gene-by-gene comparisons ([summary.json](summary.json)), counting only human genes with a one-to-one ortholog in both species:

- Pig against chimpanzee, 15,053 genes: the chimpanzee protein is closer to the human protein for 92.5%, the pig protein for 5.5%, tied 2.0%.
- Pig against rhesus macaque, 15,060 genes: macaque closer for 89.5%, pig 8.4%, tied 2.1%.
- Pig against mouse, 15,367 genes: pig closer for 71.4%, mouse 25.1%, tied 3.5% (the same value as the human-animal analysis).

The distribution of one-to-one protein identity for chimpanzee, pig and mouse is in [identity-bins.csv](identity-bins.csv). Identity for the seven human transgenes in the 69-edit donor pig of Anand et al. (2023) and other genes discussed in the article is in [genes-of-interest.csv](genes-of-interest.csv), with each gene's percentile among the 16,216 pig one-to-one orthologs.

## Inputs

- `../human-animal-dna-similarity/human-gene-orthologs.csv.gz`: one row per human gene with its Ensembl 116 relationship type and one-to-one protein identity in 21 species. See that folder's README for how it was built.
- `ensembl_compara_116.method_link_species_set_tag` on `ensembldb.ensembl.org` (anonymous MySQL), queried October 29, 2026: the statistics Ensembl stores for each human-referenced LASTZ net alignment ("Hsap-X LastZ (on Hsap)"). Raw tags are in [lastz-tags.json](lastz-tags.json).

## Definitions

Protein identity is Ensembl's `perc_id` for the human member of each one-to-one pair: identical amino acids divided by the length of the human canonical protein, so gaps and unaligned ends count as differences. Isoform choice affects it; a short canonical protein in either species lowers the value.

Genome in alignment is `ref_genome_coverage / ref_genome_length`. The denominator (3,099,750,718 bases) includes about 151 million bases of gaps in GRCh38.

Coding-exon identity is `ref_matches / (ref_matches + ref_mis_matches)`: among human coding-exon bases aligned to a pig base, the fraction aligned to an identical base. It ignores exon bases aligned to gaps or left uncovered. Ensembl stores this only for coding exons, so there is no comparable whole-genome identity. The human-animal README notes that this ratio looks unreliable for bonobo and gorilla; for pig, horse, mouse and macaque it follows the expected order.

## Limitations

- Every number depends on the pig assembly (Sscrofa11.1) and its annotation. A 2025 USDA study found assembly or annotation errors in 41 to 53% of the 6,135 pig genes it checked manually across three recent pig builds.
- Medians describe one-to-one orthologs only. Pig genes with duplicates, such as the two pig copies matched to human CD46, are outside the identity measure.
- Protein identity is not DNA identity. Synonymous changes and non-coding DNA are not counted.
- Values are specific to Ensembl 116.

## Reproduction

```bash
python analyze_pig.py --out <new directory>                  # gene-level figures
python analyze_pig.py --out <new directory> --lastz          # also query Ensembl; needs pymysql
python analyze_pig.py --out <new directory> --lastz-json lastz-tags.json
```

Python 3.10 or later. The gene-level part uses the standard library only.
