Marker Simulation
Example 1
Summary: Runs the marker simulation process by opening a data table and running the simulation.
Code:
Open("data_table.jmp");
Marker Simulation();
Code Explanation:
- Open data table;
- Run marker simulation.
Example 2
Summary: Opens a data table and runs a marker simulation.
Code:
dt = Open("data_table.jmp");
dt << Marker Simulation();
Code Explanation:
- Open data table;
- Run Marker Simulation.
Example 3
Summary: Runs the simulation and re-opening of a data table in JMP, utilizing the Marker Simulation feature.
Code:
Open("data_table.jmp");
Marker Simulation();
dt = Open("data_table.jmp");
dt << Marker Simulation();
dt = Open("data_table.jmp");
Code Explanation:
- Open data table;
- Run Marker Simulation.
- Open data table;
- Run Marker Simulation on dataset.
- Open data table;
Marker Simulation using Select Where
Example 1
Summary: Runs a marker simulation analysis to predict disease status, utilizing predictor formulas and simulation parameters to generate a diversity plot.
Code:
dt = Open("data_table.jmp");
dt << Clear Select << Clear Row States;
dt << Select Where( :Father == 0 & :Mother == 0 & Row() <= 100 );
dt << Invert Row Selection << Exclude;
dt << Clear Select;
obj = dt << Marker Simulation(
Marker( Column Group( "Markers" ) ),
Predictor Formula(
:Pred Formula Trait1, :Pred Formula Trait2, :Pred Formula Trait3, :Pred Formula Trait4, :"Probability( Disease Status=1 )"n
),
Cross( :Sex ),
Unthreaded( 1 ),
Ploidy( 2 ),
Number of Generations( 2 ),
Number of Individuals per Cross( 10 ),
Set Random Seed( 12345 ),
Threshold to Make Line Plots( 2000 ),
Estimate Diversity( 1 ),
Show Diversity Plot( 0 )
);
obj << Show Diversity Plot( 1 );
obj << Redo Analysis;
Code Explanation:
- Open data table.
- Clear all selections.
- Select rows where Father and Mother are 0.
- Invert row selection.
- Exclude selected rows.
- Clear all selections.
- Run Marker Simulation.
- Define marker column group.
- Specify predictor formulas.
- Set simulation parameters.
- Show diversity plot.
- Redo analysis.
Example 2
Summary: Simulates marker data using JMP's Marker Simulation feature, configuring various parameters to generate a simulated table.
Code:
dt = Open("data_table.jmp");
dt << Clear Select << Clear Row States;
dt << Select Where( :Father == 0 & :Mother == 0 & Row() <= 100 );
dt << Invert Row Selection << Exclude;
dt << Clear Select;
test = Is Scriptable(
obj = dt << Marker Simulation(
Marker( Column Group( "Markers" ) ),
Predictor Formula(
:Pred Formula Trait1, :Pred Formula Trait2, :Pred Formula Trait3, :Pred Formula Trait4, :"Probability( Disease Status=1 )"n
),
Cross( :Sex ),
Unthreaded( 1 ),
Ploidy( 2 ),
Number of Generations( 2 ),
Number of Individuals per Cross( 10 ),
Select Best Individuals( 1 ),
Number of Selected Individuals( 2 ),
Number of Selected Crosses( 5 ),
Set Random Seed( 12345 ),
Threshold to Make Line Plots( 1000 ),
Estimate Diversity( 1 ),
Show Diversity Plot( 1 ),
Show Evaluation Plot( 1 ),
);
Close( Data Table("data_table"), NoSave );
obj << Save Simulated Table;
);
Code Explanation:
- Open data table.
- Clear row selection and states.
- Select rows where Father and Mother are 0.
- Invert row selection and exclude.
- Clear row selection again.
- Check if scriptable.
- Run Marker Simulation.
- Define marker column group.
- Set predictor formulas.
- Configure simulation parameters.
- Close simulated table without saving.
- Save simulated table.
Example 3
Summary: Simulates marker data using a custom script, generating a dataset with predicted traits and disease status.
Code:
dt = Open("data_table.jmp");
dtAnno = Open("data_table.jmp");
dt << Clear Select << Clear Row States;
dt << Select Where( :Father == 0 & :Mother == 0 & Row() <= 100 );
dt << Invert Row Selection << Exclude;
dt << Clear Select;
test = Is Scriptable(
dt << Marker Simulation(
Marker( Column Group( "Markers" ) ),
Predictor Formula(
:Pred Formula Trait1, :Pred Formula Trait2, :Pred Formula Trait3, :Pred Formula Trait4,
:"Probability( Disease Status=1 )"n
),
Cross( :Sex ),
Use Only Markers Found in Predictor Formula( 1 ),
Ploidy( 2 ),
Number of Generations( 2 ),
Number of Individuals per Cross( 10 ),
Set Random Seed( 12345 ),
Threshold to Make Line Plots( 1000 ),
Use Annotation Table(
1,
dtAnno,
Marker Variables( :Marker ),
Annotation Group( :Gene ),
Annotation Position( :Linkage Position ),
Go
)
)
);
Code Explanation:
- Open data_table data
- Open data_table data
- Clear selection and row states.
- Select rows where father and mother are zero.
- Invert row selection and exclude.
- Clear selection.
- Check if scriptable.
- Run marker simulation.
- Define marker column group.
- Set predictor formulas.
- Include sex cross.
- Use markers from predictor formula.
- Set ploidy to 2.
- Set number of generations to 2.
- Set number of individuals per cross to 10.
- Set random seed to 12345.
- Set threshold for line plots to 1000.
- Use annotation table.
- Specify annotation group and position.
- Execute annotation.
Example 4
Summary: Simulates marker inheritance in a pedigree data set, utilizing predictor formulas and annotation tables to generate a simulated dataset.
Code:
dtAnno = Open("data_table.jmp");
dt = Open("data_table.jmp");
dt << Clear Select << Clear Row States;
dt << Select Where( :Father == 0 & :Mother == 0 & Row() <= 100 );
dt << Invert Row Selection << Exclude;
dt << Clear Select;
test = Is Scriptable(
dt << Marker Simulation(
Marker( Column Group( "Markers" ) ),
Predictor Formula(
:Pred Formula Trait1, :Pred Formula Trait2, :Pred Formula Trait3, :Pred Formula Trait4, :"Probability( Disease Status=1 )"n
),
Cross( :Sex ),
Use Only Markers Found in Predictor Formula( 1 ),
Ploidy( 2 ),
Number of Generations( 2 ),
Number of Individuals per Cross( 10 ),
Set Random Seed( 12345 ),
Threshold to Make Line Plots( 1000 ),
Use Annotation Table(
1,
dtAnno,
Marker Variables( :Marker ),
Annotation Group( :Gene ),
Annotation Position( :Linkage Position ),
Go
)
)
);
Code Explanation:
- Open data_table data
- Open data_table data
- Clear selection and row states.
- Select individuals without parents.
- Invert row selection and exclude.
- Clear selection again.
- Check if scriptable.
- Run marker simulation.
- Define marker column group.
- Set predictor formulas.
Marker Simulation using Select Rows
Example 1
Summary: Runs a Marker Simulation to predict disease status, utilizing 'Markers' column group and predictor formulas with 'Sex' as a cross factor.
Code:
dt = Open("data_table.jmp");
dt << Clear Select << Clear Row States;
dt << Select Rows( Index( 21, 1000 ) ) << Exclude;
test = Is Scriptable(
dt << Marker Simulation(
Marker( Column Group( "Markers" ) ),
Predictor Formula(
:Pred Formula Trait1, :Pred Formula Trait2, :Pred Formula Trait3, :Pred Formula Trait4, :"Probability( Disease Status=1 )"n
),
Cross( :Sex ),
Unthreaded( 1 ),
Ploidy( 2 ),
Number of Generations( 2 ),
Number of Individuals per Cross( 10 ),
Set Random Seed( 12345 )
)
);
Code Explanation:
- Open data table.
- Clear selection and row states.
- Exclude rows 21 to 1000.
- Check if scriptable.
- Run Marker Simulation.
- Use "Markers" column group.
- Define predictor formulas.
- Include "Sex" as cross factor.
- Set unthreaded to 1.
- Set ploidy to 2.
Example 2
Summary: Runs the preparation and simulation of a marker-based genetic analysis, including data filtering, column creation, and random seed setting.
Code:
dt = Open("data_table.jmp");
dt << Clear Select << Clear Row States;
dt << Select Rows( Index( 21, 1000 ) ) << Exclude;
dt << New Column( "SampleID", Character, "Nominal", Formula( Char( :Pedigree ) || Char( :Sample ) ) );
test = Is Scriptable(
dt << Marker Simulation(
Marker( Column Group( "Markers" ) ),
Predictor Formula(
:Pred Formula Trait1, :Pred Formula Trait2, :Pred Formula Trait3, :Pred Formula Trait4, :"Probability( Disease Status=1 )"n
),
Sample ID( :SampleID ),
Cross( :Sex ),
Unthreaded( 1 ),
Ploidy( 2 ),
Number of Generations( 2 ),
Number of Individuals per Cross( 10 ),
Set Random Seed( 12345 )
)
);
Code Explanation:
- Open table.
- Clear selection.
- Clear row states.
- Select rows 21-1000.
- Exclude selected rows.
- Create new column "SampleID".
- Combine pedigree and sample into "SampleID".
- Check scriptability of Marker Simulation.
- Run Marker Simulation with specified parameters.
- Set random seed for reproducibility.
Marker Simulation using Name
Example 1
Summary: Runs marker simulation with specified parameters to analyze genetic data, utilizing JMP's built-in functionality for marker simulation and data manipulation.
Code:
dt = Open("data_table.jmp");
dt:Name( "Pred Formula Trait1" ) << Set Property( "Spec Limits", {LSL( 22.5 )} );
dt:Name( "Pred Formula Trait2" ) << Set Property( "Spec Limits", {USL( 25.5 )} );
dt:Name( "Probability( Disease Status=1 )" ) << Set Property( "Spec Limits", {USL( 0.3 )} );
dt << Clear Select << Clear Row States;
dt << Select Where( :Father == 0 & :Mother == 0 & Row() <= 100 );
dt << Invert Row Selection << Exclude;
dt << Clear Select;
test = Is Scriptable(
dt << Marker Simulation(
Marker( Column Group( "Markers" ) ),
Predictor Formula(
:Pred Formula Trait1, :Pred Formula Trait2, :Pred Formula Trait3, :Pred Formula Trait4, :"Probability( Disease Status=1 )"n
),
Cross( :Sex ),
Unthreaded( 1 ),
Ploidy( 2 ),
Estimate Diversity( 1 ),
Number of Generations( 2 ),
Number of Individuals per Cross( 10 ),
Set Random Seed( 12345 ),
Threshold to Make Line Plots( 1000 ),
)
);
Code Explanation:
- Open data_table data
- Set LSL for Pred Formula Trait1.
- Set USL for Pred Formula Trait2.
- Set USL for Probability(Disease Status=1).
- Clear selection and row states.
- Select first 100 rows with no parents.
- Invert and exclude selected rows.
- Clear selection.
- Check if scriptable.
- Run marker simulation with specified parameters.
Example 2
Summary: Sets up and simulates a marker-based genetic analysis, configuring specific trait limits and selecting relevant rows from a data table.
Code:
dt = Open("data_table.jmp");
dt:Name( "Pred Formula Trait1" ) << Set Property( "Spec Limits", {LSL( 22.5 )} );
dt:Name( "Pred Formula Trait2" ) << Set Property( "Spec Limits", {USL( 25.5 )} );
dt:Name( "Probability( Disease Status=1 )" ) << Set Property( "Spec Limits", {USL( 0.3 )} );
dt << Clear Select << Clear Row States;
dt << Select Where( :Father == 0 & :Mother == 0 & Row() <= 100 );
dt << Invert Row Selection << Exclude;
dt << Clear Select;
test = Is Scriptable(
dt << Marker Simulation(
Marker( Column Group( "Markers" ) ),
Predictor Formula(
:Pred Formula Trait1, :Pred Formula Trait2, :Pred Formula Trait3, :Pred Formula Trait4, :"Probability( Disease Status=1 )"n
),
Cross( :Sex ),
Unthreaded( 1 ),
Ploidy( 2 ),
Number of Generations( 1 ),
Number of Individuals per Cross( 10 ),
Set Random Seed( 12345 ),
Threshold to Make Line Plots( 1000 ),
Missing Marker Imputation Method( "Specified" ),
Imputation Value( 0 )
)
);
Code Explanation:
- Open data_table data
- Set LSL for Trait1.
- Set USL for Trait2.
- Set USL for Disease Status.
- Clear all selections and row states.
- Select rows with no parents and limit to 100.
- Invert and exclude selected rows.
- Clear all selections.
- Check scriptability for marker simulation.
- Run marker simulation with specified parameters.