A powerful web-based tool for generating synthetic genetic datasets for statistical genetics research.
SNAP (Simulation of Nuclear and Affected Pedigrees) is a web-based software tool developed to assist researchers in statistical genetics. Hosted at https://statgen.uni-koeln.de/, SNAP enables the simulation of genetic data for case-control studies, family-based studies, and other genetic analyses. By specifying study designs, sampling strategies, and genotype-phenotype models, users can generate synthetic datasets tailored to their research needs.
SNAP is designed to be user-friendly, with a web interface for input configuration and a robust backend for processing simulations. It produces settings files, data outputs, and logs, which are downloadable for approximately 24 hours.
Accepts JSON configurations via a web interface, allowing users to specify simulation parameters such as study design, phenotype type, and haplotype blocks.
Creates structured settings files with sections for general settings, study design, sex and age distributions, models, separators, and haplotype blocks.
Runs SNAP binaries (v3.1 or v2.6.1) to generate synthetic genetic data based on user inputs, producing data files and logs.
Provides download links for settings files, data outputs, modified settings logs, and a compressed archive, accessible for 24 hours.
Validates inputs, logs errors, and displays user-friendly messages for issues like invalid JSON or simulation failures.
Automatically deletes temporary files older than 24 hours to manage server disk space.
SNAP_JSON) for simulation parameters.individuals (case-control or joint) and nuclear-families (fixed or random).qualitative or quantitative..set), data (.dat), log (.log), and error (.txt) files.E_ALL)./var/www/html/statgen.uni-koeln.de/software/snap/.snap3.1, snap2.6.1) in snap/run/.snap/temp/.snap/run_error.log.The core of SNAP is a PHP backend script (run.php) that processes user inputs and executes simulations. Below is an overview of its structure:
run.php)logError: Logs errors to run_error.log.sanitizeFilename: Secures filenames.writeSection: Writes settings file sections.getArrayValue: Safely accesses array values.search_temp: Finds unique temp directories.generateSettingsFile: Creates settings file with sections: [General], [Design], [SexAge], [Model], [Separators], [Blocks].buildHTML: Processes JSON, runs SNAP, and generates output HTML.SNAP_JSON)JSON structure stored in localStorage, sent via AJAX:
SnapSettings: Filenames, output types, separators.DesignData: Study design, phenotype, sampling, counts.SexAgeData: Sex ratio, age distributions.ModelData: Genotype-phenotype models, penetrances.HaplotypeBloks: Haplotype block configurations.settings.set: Simulation parameters.data.dat: Simulated genetic data.settings_log.log: Modified settings.stderr.txt: SNAP errors/warnings.snap.tgz: Archive of all files.SNAP has been enhanced to improve reliability and alignment with user needs, based on feedback and example settings:
designFlag, penetranceFlag, modelFlag, blockFlag, and userSettingsFile_stderr by adding input validation in run.php.generateSettingsFile to match seven example settings, supporting:
individuals, nuclear-families.separate, joint.NumberOfCases, NumberOfIndividuals, TypeOfFamily.