---
title: "GWAS and Gene Set Analysis in OmicsBox"
canonical: "https://help.biobam.com/space/OED0324/3525083994/GWAS%20and%20Gene%20Set%20Analysis%20in%20OmicsBox"
format: markdown
---
Introduction Performing GWAS using  GAPIT3  in OmicsBox simplifies the identification of genetic variants associated with complex traits. With OmicsBox, you can generate a covariate matrix, preprocess data, manage phenotypes, and execute the analysis in one environment. The platform also allows you to visualize and interpret results seamlessly. In this tutorial, we will perform a GWAS on tomato ( Solanum lycopersicum ) data using  GAPIT3  to identify SNPs associated with quantitative traits. Once the significant variants are detected, we will continue with a  Gene Set Analysis (GSA)  using  MAGMA , which groups SNPs by genes and functional categories to reveal underlying biological processes. This workflow combines statistical association testing and functional interpretation to better understand the biological meaning of the detected  variants . Dataset Description The dataset used in this tutorial is obtained from the  Sol Genomics Network  as part of the  Varitome Project , which explores genomic diversity in tomato ( Solanum lycopersicum ). It includes a  VCF file  containing several million variants across the tomato genome and a  traits file  with  14 quantitative phenotypic traits  describing fruit morphology and composition, such as pericarp area, columella size, and fruit weight. Additionally, a  gene set annotation file  maps  34725 tomato genes  to their corresponding  Gene Ontology (GO)  functional categories, enabling downstream gene- and pathway-level analyses. Bioinformatic Analysis Gwas Analysis To identify associations between genetic variants and the selected phenotypic traits, we will perform a  GWAS with GAPIT3 . This step will take the VCF and phenotype files as input, apply quality filters, correct for population structure, and fit a general linear model to detect significant SNP-trait relationships. Application The Genome-Wide Association Studies Tool can be found under  Genetic Variation → Genome Wide Association Study.  For further information, refer to the OmicsBox User Guide section  GWAS with GAPIT3 . Input VCF file : This file contains the genomic variants identified across all samples. Phenotypic Traits File : This table includes the quantitative measurements of the phenotypic traits corresponding to the same individuals present in the VCF file Parameters Before running the analysis, several filtering and normalization steps are applied to ensure data quality and reduce noise. SNP filtering SNPs are filtered according to population genetics and data quality criteria. Variants deviating from Hardy–Weinberg equilibrium (p < 0.0001) are removed, together with rare alleles (MAF < 0.001) and SNPs with more than 50 % missing data. Hardy-Weinberg Equilibrium P-value: 0.0001 MAF Threshold: 0.001 Missingness Threshold: 0.5 Sample filtering Samples with excessive missing data are also filtered out using a sample missingness threshold of 0.7 Sample Missingness Threshold: 0.7 Linkage Disequilibrium Pruning LD pruning is applied (r² = 0.9, window = 1000 kb) to remove highly correlated SNPs and reduce redundancy in the analysis Perform LD pruning: True Maximum Linkage Disequilibrium: 0.9 Window Size: 1000 Phenotype standardization Phenotypes are normalized, outlier removal is not applied. Normalize Phenotype Data: True Remove Phenotype Outliers: False GWAS Options A kinship matrix (VanRaden) and two PCA dimensions are used in a  GLM  to model SNP–trait associations. Attach Own Kinship Matrix: False Kinship Group: Mean Kinship Cluster: Average Kinship Algorithm: VanRaden Attach Own Covariate Matrix: False Number of Dimensions for PCA: 2 GWAS Model: General Linear Model (GLM) Execution Time 8 minutes. Figure 1.  GWAS classification results showing the distribution of analyzed traits and detected associations. Output The GWAS analysis generates several output files summarizing the association between SNPs and phenotypic traits.  The  GWAS Table  lists all variants tested for the selected phenotype, including their genomic positions and p-values (Figure 1). This table allows the identification of candidate regions potentially linked to trait variation.  GWAS Table The  Report  provides an overview of the analysis for all traits, showing the number of SNPs analyzed and the filtering statistics (Figure 2). It also includes a summary of the phenotypes used and highlights which ones display stronger genetic signals.  Report   Finally, the  Manhattan Plot  (Figure 3) shows the distribution of p-values across chromosomes for the selected trait ( COLUMELLA_AREA_MM2 ). Peaks above the significance threshold indicate variants that may be associated with the phenotype. Corrected Phenotypes Figure 2.  GWAS summary report displaying the number of SNPs per phenotype and filtering statistics. Figure 3.  Manhattan plot for  COLUMELLA_AREA_MM2  showing SNP significance across the tomato genome. Gene Set Analysis After identifying significant SNPs through GWAS, the next step is to interpret these results at the gene and pathway levels. For this purpose, OmicsBox integrates  MAGMA  (Multi-marker Analysis of GenoMic Annotation ) , a tool that aggregates SNP-level associations into gene-level statistics and then evaluates enrichment of functional gene sets. This approach provides a deeper understanding of the biological context underlying the GWAS signals, revealing pathways or processes that contribute to the observed phenotypic variation. Application The Gene Set Analysis Tool can be  found in the Side Panel of GWAS results, generated in the previous step, under  Actions → Enrichment Analysis .  For further information, refer to the OmicsBox User Guide section  GWAS Gene Set Analysis with MAGMA . Input VCF file : This file contains the genomic variants identified across all samples. GWAS Table The table generated in the previous step containing SNPs and their p-values. This table must be opened from the GWAS results panel rather than loaded manually as an input file. Annotation File   Defines gene coordinates and maps each SNP to its corresponding gene. Gene Set File Contains predefined gene sets, such as Gene Ontology (GO) categories or pathway databases . Parameters SNPs are assigned to genes within a 1.5 kb window to include nearby regulatory variants. The Mean SNPs Association Test is performed using p-values from the GWAS Table to calculate gene-level significance. Both competitive and self-contained tests are executed to assess gene set enrichment. Gene sets between 15 and 500 genes are included in the analysis. Phenotype: SLC_SLL_SP_COLUMELLA_AREA_.MM.2..FAM Window To Include SNPs in Gene (kb): 1.5 Gene Test Model: Mean SNPs Association Test Columns to Use in Gene Test: P-Value Make Self-Contained GSA: True Gene Sets Min Size: 15 Gene Sets Max Size: 500 Execution Time 4 minutes aprox. Figure 4.  Competitive MAGMA Table showing gene sets tested against the rest of the genome, with  xenobiotic transmembrane transporter activity  as the most significant term. Output The Gene Set Analysis produces two result tables and a summary chart.  The  Competitive MAGMA Table  (Figure 4) evaluates whether the genes within each  functional category (e.g., GO term or pathway) show stronger  overall associations than the average signal observed across the rest of the genome. Categories that display higher enrichment are considered significantly related to the analyzed trait. In this analysis,  xenobiotic transmembrane transporter activity  was the most significantly enriched category (FDR = 0.0012). Competitive MAGMA Table The  Self-Contained MAGMA Table  (Figure 5) evaluates each functional category independently, testing whether its genes show evidence of association without comparing it to the rest of the genome. Both analyses revealed a consistent enrichment pattern for transporter-related genes. Self-Contained MAGMA Table Finally, the  SNPs per Gene Chart  (Figure 6) shows that most genes contain only one or two SNPs, reflecting the variant distribution used in the analysis. SNPs per Gene Chart Figure 5.  Self-Contained MAGMA Table showing independent enrichment results for each gene set. Figure 6.  Distribution of SNPs per gene used in the MAGMA analysis. Most genes include one or two variants, while only a few contain higher SNP counts