Skip to content

How to get the variance for trait AD #6

@marcopxt

Description

@marcopxt

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") ###***

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions