-
Notifications
You must be signed in to change notification settings - Fork 48
Multiclass Bayesian analysis
Hao Cheng edited this page Feb 23, 2026
·
7 revisions
Multi-class Bayesian Alphabet models are used when multiple genomic data are included in the model. For example, genome may be split into multiple regions and markers in each region will be fitted as one class with a class-specific prior.
Below we will split genome into 3 classes. This is used to demonstrate the multi-class analysis using JWAS. Users will assign markers to multiple groups given additional biological information.
# Step 1: Load packages
using JWAS,DataFrames,CSV,Statistics,JWAS.Datasets
# Step 2: Read data
phenofile = dataset("phenotypes.txt", dataset_name="demo_7animals")
pedfile = dataset("pedigree.txt", dataset_name="demo_7animals")
genofile1 = "genotypes_group1.csv" # provide your own genotype files split by group
genofile2 = "genotypes_group2.csv"
genofile3 = "genotypes_group3.csv"
phenotypes = CSV.read(phenofile,DataFrame,delim = ',',header=true,missingstring=["NA"])
pedigree = get_pedigree(pedfile,separator=",",header=true);
#3 groups
geno1 = get_genotypes(genofile1,separator=',',method="BayesA");
geno2 = get_genotypes(genofile2,separator=',',method="BayesB");
geno3 = get_genotypes(genofile3,separator=',',method="BayesC");
# Step 3: Build Model Equations
model_equation ="y1 = intercept + x1 + x2 + x2*x3 + ID + dam + geno1 + geno2 + geno3
y2 = intercept + x1 + x2 + ID + geno1 + geno2 + geno3
y3 = intercept + x1 + ID + geno1 + geno2 + geno3";
model = build_model(model_equation);
# Step 4: Set Factors or Covariates
set_covariate(model,"x1");
# Step 5: Set Random or Fixed Effects
set_random(model,"x2");
set_random(model,"ID dam",pedigree);
# Step 6: Run Analysis
out=runMCMC(model,phenotypes);
# Step 7: Check Results
out["EBV_y3"] # estimated breeding valuesJoint Analysis of Continuous, Censored and Categorical Traits
Integrating Phenotypic Causal Networks in GWAS
single trait and multiple trait GBLUP by providing the relationship matrix directly
User-defined Prediction Equation
Description of Mixed Effects Model
Constraint on variance components