-
Notifications
You must be signed in to change notification settings - Fork 1
Description
library(SimpleMating)
1.Loading the dataset.
data(generic_GenMap) # Genetic Map
Map.In = generic_GenMap
Map.In_res <- Map.In[,c(1,3)]
data(generic_MrkEffects) # Additive effects
data(generic_Geno) # Markers
data(generic_Phasedgeno) # Phased haplotypes
2. Parents
Parents <- rownames(generic_Geno)
3.Creating the mating plan
plan <- planCross(TargetPop = Parents,
MateDesign = "half")
4. Creating a relationship matrix based on markers
relMat <- (generic_Geno %*% t(generic_Geno)) / ncol(generic_Geno)
5. A simple estimation of linkage disequilibrium matrix. You can use a better way to estimate it.
linkDesMat <- (t(generic_Geno) %*% generic_Geno) / ncol(generic_Geno)
==== Option one: With phased haplotypes and a genetic map
usef_one <- getUsefAD(MatePlan = plan,
Markers = generic_Phasedgeno,
addEff = generic_MrkEffects[, 1],
domEff = generic_MrkEffects[, 3],
Map.In = generic_GenMap,
K = relMat,
propSel = 0.05,
Method = "Phased")
==== Option two: With phased haplotypes and a linkage disequilibrium matrix
usef_two <- getUsefAD(MatePlan = plan,
Markers = generic_Phasedgeno,
addEff = generic_MrkEffects[, 1],
domEff = generic_MrkEffects[, 3],
Map.In = Map.In_res, ###***
linkDes = linkDesMat, ###***
K = relMat,
propSel = 0.05,
Method = "Phased")
==== Option three: With non phased haplotypes and a genetic map
usef_three <- getUsefAD(MatePlan = plan,
Markers = generic_Geno,
addEff = generic_MrkEffects[, 1],
domEff = generic_MrkEffects[, 3],
Map.In = generic_GenMap,
K = relMat,
propSel = 0.05,
Method = "NonPhased") ###***
==== Option four: With non phased haplotypes and a linkage disequilibrium matrix
usef_four <- getUsefAD(MatePlan = plan,
Markers = generic_Phasedgeno,
addEff = generic_MrkEffects[, 1],
domEff = generic_MrkEffects[, 3],
Map.In = Map.In_res, ###***
linkDes = linkDesMat, ###***
K = relMat,
propSel = 0.05,
Method = "NonPhased") ###***