- Manhattan plots and quantile–quantile (Q–Q) plots are two important graphical methods used to visualize and evaluate the results of genome-wide association studies (GWAS) and other large-scale genetic analyses. They help researchers identify genomic regions associated with biological traits, assess the distribution of statistical test results, detect potential population structure and technical biases, and evaluate whether an association analysis has produced reliable statistical evidence. Although both plots are commonly generated from GWAS results, they serve different purposes. Manhattan plots show the genomic locations and statistical significance of individual genetic variants, whereas Q–Q plots compare observed statistical results with the distribution expected under the null hypothesis of no association.
- In a typical GWAS, millions of single-nucleotide polymorphisms (SNPs) or other genetic variants are tested for association with a phenotype. Each variant receives a statistical result, usually including an effect estimate, standard error, test statistic, and p-value. The p-value indicates how incompatible the observed data are with the null hypothesis under the statistical model. Because a GWAS involves a very large number of tests, the results can be difficult to interpret in a conventional table. Manhattan and Q–Q plots provide visual summaries that help researchers examine the strength, distribution, and genomic organization of the association signals.
- A Manhattan plot is a graphical representation of GWAS association results in which each genetic variant is plotted according to its genomic position and statistical significance. The horizontal axis represents the position of variants across chromosomes, while the vertical axis represents the negative base-10 logarithm of the association p-value, written as (-\log_{10}(p)). This transformation is used because GWAS p-values can be extremely small and difficult to display on an ordinary numerical scale. Smaller p-values produce larger values on the transformed scale, so stronger statistical associations appear higher on the plot.
- For example, a p-value of 0.05 corresponds to approximately 1.30 on the negative logarithmic scale, while a p-value of (5\times10^{-8}) corresponds to approximately 7.30. This conventional threshold is widely used to indicate genome-wide significance in human GWAS. A horizontal reference line is often drawn at this value, allowing researchers to identify variants that meet the selected significance criterion. The threshold is not universal for every study and should be selected according to the number and nature of hypotheses tested, the study design, and the statistical correction procedure.
- The horizontal axis of a Manhattan plot usually displays chromosomes in genomic order. Each chromosome is assigned a separate section, and variants are positioned according to their physical genomic coordinates. Alternating colours are commonly used to distinguish neighbouring chromosomes and improve readability. In some plots, chromosomes are displayed using their numerical labels, while others include chromosome boundaries or separate panels. The vertical axis displays (-\log_{10}(p)), and peaks indicate genomic regions containing variants with strong statistical evidence of association.
- A major peak in a Manhattan plot may contain many significant variants clustered within a genomic region. This often occurs because nearby variants are correlated through linkage disequilibrium (LD). When one variant is associated with a phenotype, neighbouring variants inherited together with it may also show significant association signals. Therefore, a peak containing many significant SNPs does not necessarily represent many independent causal variants. Researchers may use LD analysis, conditional association testing, fine-mapping, and functional annotation to investigate the underlying genetic signal and identify candidate causal variants.
- Manhattan plots are useful for identifying genomic regions associated with complex traits and diseases. For example, a GWAS investigating type 2 diabetes may identify peaks near genes involved in insulin secretion, glucose metabolism, or pancreatic function. A study of height may reveal association signals in genomic regions containing genes involved in skeletal development and growth regulation. However, the presence of a nearby gene does not prove that it is responsible for the observed association. The causal variant may regulate a distant gene, affect gene expression, or act through a biological mechanism that is not immediately apparent from genomic location alone.
- A Manhattan plot can also help identify unexpected patterns in GWAS results. An unusually large number of significant variants across many chromosomes may indicate genuine widespread polygenic associations, but it may also reflect population stratification, cryptic relatedness, sample overlap, genotyping errors, batch effects, or inappropriate statistical modelling. Conversely, the absence of significant peaks does not necessarily mean that a phenotype has no genetic basis. The study may have insufficient sample size, low statistical power, poorly measured phenotypes, or limited representation of relevant genetic variants.
- A Q–Q plot is used to assess whether the distribution of observed association statistics is consistent with the distribution expected under the null hypothesis. In a GWAS, it compares the observed p-values with the p-values expected if none of the tested genetic variants were associated with the phenotype. The expected values are calculated from a theoretical null distribution, and the observed values are ordered from smallest to largest. These values are then plotted against each other, commonly on a negative logarithmic scale.
- If the null hypothesis is true for most tested variants and the statistical model is well calibrated, the observed values should approximately follow the diagonal reference line. A systematic departure from the diagonal indicates that the observed distribution differs from the expected null distribution. Deviations in the extreme tail may indicate genuine associations, whereas widespread deviation across much of the distribution may suggest statistical inflation or other problems. The interpretation requires care because complex traits are often highly polygenic, meaning that many variants may have small genuine effects. In such cases, a Q–Q plot can deviate from the null expectation even when the analysis is appropriately controlled.
- A Q–Q plot is particularly useful for detecting possible inflation in association test statistics. Population stratification, cryptic relatedness, uncorrected sample structure, technical artifacts, and other confounding factors can cause test statistics to be larger than expected under the null hypothesis. Such inflation can lead to an excess of small p-values and increase the risk of false-positive findings. Mixed models, genomic relationship matrices, principal component covariates, and other correction methods can help address some of these problems.
- The genomic inflation factor, commonly represented by (\lambda_{\mathrm{GC}}), is another measure used to assess inflation in GWAS test statistics. It is typically calculated as the ratio of the median observed association chi-square statistic to the expected median under the null distribution. A value close to one suggests that the median test statistic is consistent with the null expectation. Values substantially above one may indicate inflation, while values below one may indicate deflation or conservative testing. However, (\lambda_{\mathrm{GC}}) can increase with sample size and the polygenic architecture of a trait, even when population structure is adequately controlled. It should therefore not be interpreted as a definitive measure of confounding without considering the study’s sample size and genetic architecture.
- Manhattan plots and Q–Q plots complement each other because they answer different questions. A Manhattan plot identifies where significant association signals occur in the genome and how strongly individual variants are associated with the phenotype. A Q–Q plot evaluates the overall distribution of association statistics and helps assess whether the statistical results are appropriately calibrated. A GWAS may contain a small number of strong, localized peaks in its Manhattan plot while its Q–Q plot follows the expected line across most of the distribution and deviates only in the extreme tail. This pattern can be consistent with a well-calibrated analysis containing genuine association signals. In contrast, widespread upward deviation in a Q–Q plot may indicate that the statistical model requires further investigation.
- Both plots are commonly generated after association analysis using tools such as PLINK, R packages, and Python visualization libraries. Popular R packages include qqman, CMplot, and ggplot2. In Python, researchers can use matplotlib, seaborn, and specialized GWAS visualization libraries. Some GWAS software also generates Manhattan and Q–Q plots directly from association results. The choice of tool depends on dataset size, desired customization, file format, and the analytical workflow.
- The following Python example demonstrates how to create a basic Manhattan plot from a GWAS results file. The input file is assumed to contain chromosome, base-pair position, SNP identifier, and p-value columns. The example uses illustrative data and calculates cumulative genomic positions so that chromosomes can be displayed consecutively on the horizontal axis.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Illustrative GWAS results
data = pd.DataFrame({
“CHR”: [1, 1, 1, 2, 2, 3, 3, 4],
“BP”: [100000, 250000, 500000, 120000, 400000,
150000, 350000, 200000],
“SNP”: [“rs1”, “rs2”, “rs3”, “rs4”,
“rs5”, “rs6”, “rs7”, “rs8”],
“P”: [0.02, 1e-5, 2e-9, 0.04, 1e-6,
0.001, 5e-8, 0.03]
})
# Remove invalid p-values
data = data[
data[“P”].notna() &
(data[“P”] > 0) &
(data[“P”] <= 1)
].copy()
# Sort by chromosome and genomic position
data = data.sort_values([“CHR”, “BP”])
# Calculate cumulative chromosome positions
chromosomes = sorted(data[“CHR”].unique())
offset = 0
cumulative_positions = []
chromosome_centers = []
for chromosome in chromosomes:
chromosome_data = data[data[“CHR”] == chromosome]
positions = chromosome_data[“BP”] + offset
cumulative_positions.extend(positions)
chromosome_centers.append(
(positions.min() + positions.max()) / 2
)
offset = positions.max()
data[“cumulative_position”] = cumulative_positions
data[“minus_log10_p”] = -np.log10(data[“P”])
# Create Manhattan plot
plt.figure(figsize=(12, 5))
for chromosome in chromosomes:
subset = data[data[“CHR”] == chromosome]
plt.scatter(
subset[“cumulative_position”],
subset[“minus_log10_p”],
s=18,
label=f”Chromosome {chromosome}”
)
# Conventional human GWAS threshold
threshold = -np.log10(5e-8)
plt.axhline(
threshold,
linestyle=”–“,
label=”Genome-wide significance”
)
plt.xticks(chromosome_centers, chromosomes)
plt.xlabel(“Chromosome”)
plt.ylabel(“-log10(p-value)”)
plt.title(“Illustrative Manhattan Plot”)
plt.tight_layout()
plt.show()
- This example demonstrates the basic construction of a Manhattan plot. In a production GWAS workflow, chromosome lengths should be obtained from the relevant reference genome assembly, and cumulative offsets should be calculated using those lengths rather than only the maximum position observed among tested variants. This ensures that chromosome boundaries and spacing are represented consistently, even when some regions contain no tested markers. Researchers should also handle chromosome naming conventions, non-autosomal chromosomes, multi-allelic variants, zero or underflowed p-values, and genomic build differences appropriately.
- The following Python example demonstrates how to create a Q–Q plot from observed GWAS p-values. The expected p-values are calculated from the ordered ranks of the tests under the null hypothesis.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Illustrative GWAS p-values
p_values = np.array([
0.80, 0.65, 0.50, 0.35, 0.20,
0.10, 0.05, 0.01, 0.001, 1e-5
])
# Remove invalid p-values
p_values = p_values[
np.isfinite(p_values) &
(p_values > 0) &
(p_values <= 1)
]
# Sort observed p-values
observed = np.sort(p_values)
# Calculate expected p-values under the null
n = len(observed)
expected = (np.arange(1, n + 1) – 0.5) / n
# Transform values
expected_log = -np.log10(expected)
observed_log = -np.log10(observed)
# Create Q-Q plot
plt.figure(figsize=(6, 6))
plt.scatter(expected_log, observed_log, s=25)
# Diagonal reference line
maximum = max(expected_log.max(), observed_log.max())
plt.plot([0, maximum], [0, maximum], linestyle=”–“)
plt.xlabel(“Expected -log10(p-value)”)
plt.ylabel(“Observed -log10(p-value)”)
plt.title(“Illustrative GWAS Q-Q Plot”)
plt.tight_layout()
plt.show()
- The expected p-value calculation in this example provides a basic visual comparison. For large-scale GWAS, the complete set of valid association p-values should be used, and the expected values should be calculated consistently with the statistical testing procedure. When extremely small p-values are reported as zero because of numerical underflow, researchers should use appropriate test statistics or higher-precision calculations rather than attempting to take the logarithm of zero.
- In R, the qqman package is widely used to generate Manhattan and Q–Q plots. The following example demonstrates both plots using a GWAS results table.
library(qqman)
# Illustrative GWAS results
gwas_data <- data.frame(
SNP = paste0(“rs”, 1:8),
CHR = c(1, 1, 1, 2, 2, 3, 3, 4),
BP = c(100000, 250000, 500000, 120000,
400000, 150000, 350000, 200000),
P = c(0.02, 1e-5, 2e-9, 0.04,
1e-6, 0.001, 5e-8, 0.03)
)
# Manhattan plot
manhattan(
gwas_data,
chr = “CHR”,
bp = “BP”,
snp = “SNP”,
p = “P”,
genomewideline = -log10(5e-8),
main = “Illustrative Manhattan Plot”
)
# Q-Q plot
qq(
gwas_data$P,
main = “Illustrative GWAS Q-Q Plot”
)
- For large GWAS datasets, PLINK and other association-analysis tools can produce result files that are suitable for visualization. The exact column names depend on the software and version. Researchers should inspect the output file before plotting and confirm that the p-value column contains valid association p-values rather than adjusted p-values or another statistical measure. They should also ensure that all variants refer to the same reference genome assembly and that chromosome coordinates are interpreted correctly.
- Manhattan plots are often used in conjunction with regional association plots. A regional plot focuses on a selected genomic interval and displays the association strength of variants together with their LD relationships to a lead variant. It may also include nearby genes, recombination rates, and functional annotations. Tools such as LocusZoom can produce regional association plots that help researchers investigate the structure of an association signal. These plots provide more detailed information than a genome-wide Manhattan plot and are useful when examining candidate loci.
- The interpretation of both plots requires consideration of the GWAS design and statistical model. Population stratification may create widespread inflation, while cryptic relatedness can cause correlated test statistics if it is not adequately modelled. Mixed models and genomic relationship matrices can help account for genetic similarities among individuals. Principal component covariates can capture major axes of ancestry variation. Genotype quality control, phenotype quality control, imputation accuracy, sample identity checks, and batch-effect assessment are also essential before interpreting association plots.
- Multiple-testing correction is closely connected to Manhattan plots because the significance threshold determines which association signals are considered statistically significant. The conventional human GWAS threshold of (5\times10^{-8}) is commonly represented by a horizontal line on the plot. However, studies involving multiple phenotypes, genetic models, ancestry groups, interaction tests, or different types of variants may involve additional hypotheses. Researchers should define the testing burden and use an appropriate correction procedure rather than automatically applying one threshold to every analysis.
- A Q–Q plot should also be interpreted in the context of polygenicity. Many complex traits are influenced by numerous variants, each with a small effect. In a sufficiently large GWAS, this can produce a systematic deviation from the null expectation even when population structure and relatedness are appropriately controlled. Therefore, deviation from the diagonal is not always evidence of a flawed analysis. Researchers may examine the distribution of test statistics, genomic inflation factor, linkage disequilibrium score regression intercept, model diagnostics, and other evidence to distinguish polygenic signal from confounding. No single diagnostic measure provides a complete assessment.
- Manhattan and Q–Q plots are also useful beyond traditional GWAS. In gene expression studies, a Manhattan-style plot can display the genomic or gene-based distribution of association results, while Q–Q plots can help assess the calibration of statistical tests. In epigenome-wide association studies, Manhattan plots can display associations across CpG sites, and Q–Q plots can help evaluate the distribution of methylation association statistics. Similar visualizations can be applied to proteomic, metabolomic, microbiome, and other high-dimensional datasets, provided that the horizontal axis and statistical interpretation are adapted to the data type.
- For reproducible bioinformatics research, the plotting procedure should be documented alongside the statistical analysis. Researchers should report the genome assembly, variant filtering criteria, association model, number of tested variants, significance threshold, and software used to generate the figures. The Q–Q plot should be accompanied by relevant information about test-statistic calibration and population-structure correction. Figures should have clear axis labels, readable chromosome labels, an appropriate significance line, and sufficient resolution for publication. The underlying association results should also be made available where possible so that other researchers can inspect and reproduce the visualizations.
- Manhattan plots and Q–Q plots are essential tools for interpreting GWAS and other large-scale biological association studies. Manhattan plots identify genomic regions with strong statistical associations, while Q–Q plots evaluate the overall distribution of observed test results against the null expectation. Used together with multiple-testing correction, quality control, relatedness correction, and appropriate statistical models, they help researchers distinguish potentially meaningful biological signals from statistical artifacts. Their correct interpretation is an important step toward reliable genetic discovery and reproducible bioinformatics research.