Tutorials › Statistical Genetics › Sample Identity and Duplicate Checks

Genotyping Data and Quality Control · Tutorial 96 of 989

Sample Identity and Duplicate Checks

Use identifiers, metadata, and pairwise genotype comparisons to flag identity inconsistencies and decide what needs investigation.

Beginner 9 min read

What You'll Learn

  • Distinguish identifier and metadata checks from genotype-based identity checks
  • Calculate concordance and discordance using only jointly called genotypes
  • Identify what high and low pairwise concordance can—and cannot—establish
  • Investigate candidate duplicates, sample swaps, and mismatched records systematically
  • Recognize how missing calls and marker choice affect identity comparisons

Why Check Sample Identity?

Before interpreting genotypes, confirm that each genotype record belongs to the intended sample and that the sample's identifiers and metadata are internally consistent. A label attached to the wrong genotype profile can misassign a phenotype, a batch, or a reported sex to genetic data. Two records from the same biological sample can also be mistaken for two independent samples. Either problem can distort downstream analyses even when the genotype calls themselves are technically reliable.

Identity checking combines two kinds of evidence. First, inspect identifiers and metadata for missing, duplicated, or inconsistent records. Second, compare genotype calls across samples or against a trusted reference profile. Genotype comparison can flag pairs that merit investigation, but it does not by itself establish a person's identity or explain how a discrepancy arose.

Definition: A sample identifier is the label used to distinguish a sample record. Metadata are recorded attributes associated with that sample, such as collection code, processing batch, or reported sex. Genotype concordance for two samples is the fraction of their jointly called genotypes that match exactly at the loci included in the comparison.

Checking Identifiers and Metadata First

Begin by checking whether identifiers are present, unique where required, and consistently represented across the genotype data and the sample sheet. Differences in capitalization, whitespace, prefixes, or separators can create apparent mismatches between files. Standardizing a format can help reveal these differences, but preserve the original values and document any transformation: two differently formatted identifiers should not be silently assumed to refer to the same sample.

Then compare metadata fields that ought to agree across records or data sources. For example, a sample's collection code may differ between a laboratory sheet and an analysis file, or a sample may be assigned to an unexpected processing batch. Such a mismatch is a reason to trace the record back to its source, not proof of a genotype swap. Earlier material on sex-chromosome ploidy and sex-concordance QC provides one example of checking a metadata field against genetic evidence.

A useful distinction is between a duplicate identifier and a duplicate biological sample. Repeated identifiers may arise from a data-entry or file-joining problem, while two different identifiers may refer to the same biological sample because of a technical replicate, relabeling, or accidental duplication. The genotype comparison helps investigate the second possibility; it does not make the identifiers interchangeable.

Worked Example: A Formatting Difference and a Genotype Check

Suppose a hypothetical sample sheet lists the identifier Q17-A, while the genotype file lists q17-a with a trailing space. The study team suspects that the records might refer to the same sample. At 10 selected loci, both records have called genotypes at all 10 loci; 9 genotype pairs match exactly and 1 does not. Calculate their concordance.

After trimming the trailing space and standardizing capitalization for the comparison, the two labels have the same normalized text, Q17-A. This supports a formatting explanation for the label difference, but the original identifiers should remain auditable.

The number of jointly called loci is \(M=10\), and the number of exact genotype matches is \(C=9\). Thus,

$$ \widehat{C}=\frac{C}{M}=\frac{9}{10}=0.900 $$

The observed concordance is 90.0% across these 10 loci, with one discordance. That is not enough to conclude that the records are the same sample: the comparison is small, and a single genotype discrepancy could reflect a call error, a data issue, or genuinely different samples. The next step is to verify the sample-sheet history and compare a larger, suitable set of loci.

Pairwise Genotype Concordance

For two samples \(i\) and \(j\), compare genotypes at the same loci using the same allele coding. Include a locus only when both samples have a called genotype there. A missing genotype in either sample contributes neither a match nor a mismatch. Let \(M_{ij}\) be the number of jointly called loci and \(C_{ij}\) the number of those loci with exactly matching diploid genotypes. The observed concordance is \(C_{ij}/M_{ij}\), provided \(M_{ij}>0\). The discordance proportion is the fraction of jointly called loci with different genotypes.

$$ \widehat{C}_{ij}=\frac{C_{ij}}{M_{ij}}, \qquad \widehat{D}_{ij}=\frac{M_{ij}-C_{ij}}{M_{ij}} =1-\widehat{C}_{ij} $$

An exact genotype match means that the two samples have the same called genotype at that locus, not merely that they share one allele. For example, \(A/A\) and \(A/G\) are discordant genotypes. The comparison must use aligned allele coding; a strand or allele-coding inconsistency can make matching biological calls appear different. Missingness also matters: the denominator is the number of jointly called loci, not the total number of loci in the file.

Why the Concordance Formula Uses Joint Calls

The comparison asks what fraction of loci that can actually be compared have matching genotypes. At a locus called in only one sample, there is no observed pair of genotypes to classify as a match or mismatch. Let \(I_k=1\) if the two samples' genotypes match at jointly called locus \(k\), and \(I_k=0\) if they differ. Summing these indicators over the \(M_{ij}\) comparable loci gives the match count: \(C_{ij}=\sum_k I_k\). Dividing by the number of comparable loci yields the mean of these zero-or-one match indicators, which is the observed matching fraction. The discordant count is \(M_{ij}-C_{ij}\), so its fraction is \(1-C_{ij}/M_{ij}\).

This is a descriptive comparison, not a test with a universal significance threshold. Its interpretation depends on the loci compared, the quality and coding of calls, the number of joint calls, and the genetic similarity of the samples. A high value is evidence of similar observed genotypes at the compared loci; it is not, alone, proof of a duplicate or of a particular identity.

Worked Example: Accounting for Missing Calls

In a hypothetical comparison of samples \(R\) and \(S\) across 100 loci, \(R\) is missing at 2 loci and \(S\) is missing at 4 loci. One locus is missing in both. Among the remaining jointly called loci, 92 genotypes match and 3 differ. Calculate concordance and discordance, and state how missingness affects the calculation.

There are \(2+4-1=5\) loci missing in at least one sample; the subtraction avoids counting the locus missing in both twice. Therefore, the number of jointly called loci is \(100-5=95\). The observed match and mismatch counts sum to this denominator: \(92+3=95\).

$$ \widehat{C}_{RS}=\frac{92}{95}=0.9684, \qquad \widehat{D}_{RS}=\frac{3}{95}=0.03158 $$

The samples have 96.84% genotype concordance and 3.158% discordance among their 95 jointly called loci. The five loci missing in at least one sample are excluded; treating them as mismatches would incorrectly change the comparison. The result should be reported with its denominator, since 92 matching calls among 95 comparable loci convey more information than the same percentage based on only a few loci.

Interpreting Candidate Duplicates and Identity Inconsistencies

A pair with unusually high concordance may be a technical replicate or duplicate biological sample, but it may also be a pair of very closely related individuals or a comparison driven by uninformative loci. Conversely, unexpectedly low concordance can arise from different samples, a sample swap, incompatible allele coding, poor calls, or another data-processing problem. A single statistic does not distinguish these explanations.

Use the comparison as a flag for a structured review. Check that both records were compared over enough jointly called, appropriately coded loci; inspect the discordant genotypes and missingness; and verify the identifiers and metadata against source records. If a trusted reference genotype profile exists, compare each questionable record with that reference using the same principles. A record that matches a different expected profile may suggest a swap, but the evidence and record trail should be checked before changing labels.

Worked Example: Locating a Candidate Duplicate Pair

Three hypothetical samples \(A\), \(B\), and \(C\) are compared across a set of loci. The pairwise results are: \(A\) and \(B\) have 48 jointly called loci, of which 48 match; \(A\) and \(C\) have 49 jointly called loci, of which 44 match; and \(B\) and \(C\) have 48 jointly called loci, of which 43 match. Calculate each concordance and identify which pair should be investigated first. The sample sheet says \(A\) and \(B\) have different identifiers and were logged as separate collections.

For \(A\) and \(B\),

$$ \widehat{C}_{AB}=\frac{48}{48}=1.000 $$

For \(A\) and \(C\),

$$ \widehat{C}_{AC}=\frac{44}{49}=0.8980 $$

For \(B\) and \(C\),

$$ \widehat{C}_{BC}=\frac{43}{48}=0.8958 $$

The first pair, \(A\) and \(B\), is the clearest candidate for an identity or duplicate-record investigation because every one of their 48 jointly called genotypes matches. Their distinct identifiers and collection records make it especially important to check whether a technical replicate, relabeling, or record-joining error explains the result. The calculation does not prove that they are duplicates, and 48 loci may not be sufficient for a definitive conclusion. Investigators should review the underlying calls, available collection records, and a larger informative comparison if available.

A Practical Review Sequence

1
Audit the labels.
Check for missing, repeated, or inconsistently formatted identifiers. Preserve original values and document any normalization used to compare them.
2
Check the metadata.
Look for contradictions between sample records and source documentation. Treat discrepancies as leads to investigate, not as automatic evidence of a swap.
3
Compare genotypes.
Calculate pairwise exact-genotype concordance on jointly called loci, and report both the proportion and its denominator.
4
Trace flagged pairs.
Inspect call quality, allele coding, missingness, and collection or processing records. Resolve a discrepancy only when the supporting evidence is documented.

Common Mistakes and Why This Matters

  • Counting missing genotypes as mismatches. A missing call has no observed genotype to compare. Exclude loci missing in either sample and report the number jointly called.
  • Treating a high percentage as proof of identity. Concordance describes the compared calls; it does not certify that two records belong to one person. Consider the marker set, call quality, sample relationship, and documentary evidence.
  • Assuming different identifiers mean different biological samples. Separate labels can be attached to replicate material or duplicated records. Investigate high-concordance pairs even when identifiers differ.
  • Ignoring allele coding. Inconsistent strand or allele representation can produce apparent discordance. Confirm that genotypes are coded compatibly before interpreting the comparison.
  • Reporting only the proportion. A concordance value without the number of jointly called loci hides how much data support it. Report both, such as 92 matches out of 95 joint calls.

These checks protect the link between genotype and sample record. They should flag questions for resolution, not silently rewrite data or substitute for evidence from sample provenance. There is no universal concordance cutoff that settles every case; interpretation must account for the comparison design and data quality.

Check Your Understanding

Try these questions without looking back.

  1. Two samples are compared at 120 loci, with 4 loci missing in the first sample, 6 missing in the second, and 2 missing in both. How many loci are jointly called?
  2. At 90 jointly called loci, two samples have 87 matching genotypes. Calculate concordance and discordance.
  3. Why should a high pairwise concordance be treated as a candidate duplicate signal rather than proof of identity?
  4. A sample identifier differs only by capitalization and whitespace across two files. What should be preserved and documented when standardizing it for comparison?
  5. Give two reasons, other than a sample swap, that could produce unexpectedly low genotype concordance.
Clinical Biostats