-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTutorial.Rmd
43 lines (36 loc) · 1.87 KB
/
Tutorial.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
title: "Tutorial"
author: "Szu-Ping,Chen"
output: pdf_document
---
In this tutorial, we will explore the step-by-step process of using EHPGS package to evaluate hybrid performance. The dataset used for demonstration is the pumpkin dataset published by Wu et al. (2019).
## Data requirements
Before evaluation, there are three, please ensure that you have the following data available:
1. training set's genotype: It is a numeric matrix representing the training set, where each row represents an individual and each column represents a single SNP.
2. training set's phenotype: A numeric vector of phenotype of training set.
3. parental lines' genotype: It is a numeric matrix representing the parental lines, where each row represents an individual and each column represents a single SNP.
```{r,echo=FALSE}
library(EHPGS)
data(train.geno)
data(train.pheno)
data(parent.geno)
```
```{r}
print(train.geno[1:5,1:5])
```
```{r}
print(train.pheno[1:5,])
```
```{r}
print(parent.geno[1:5,1:5])
```
## Evaluation hybrid performance
Please select the desired prediction method and configure the relevant parameters to proceed. If the training set includes hybrids, kindly provide the names of the hybrids in the following format: two parents separated by a colon (e.g., A:B) and run EHPGS; then we can get the output of best hybrids and parental lines.
```{r}
parent.geno = parent.geno[1:10,]
hybrid.name = combn(row.names(parent.geno), 2, paste, collapse = ":")
tr.test = intersect(row.names(train.geno),combn(row.names(parent.geno), 2, paste, collapse = ":"))
result = EHPGS(num.F1=15,num.P=5,train.pheno=train.pheno$F1.weight,train.geno = train.geno,parent.geno = parent.geno,train.in.test = tr.test,method= 'BGS',mu.ini=NULL,ga.ini = 0,gd.ini = 0,vE.ini = 1,vA.ini = 0.5,vD.ini = 0.5,iter = 100,m = 1)
print(result)
```
The result shows the prediction value of the top 15 hybrids and 5 parental lines.