plotGM: plotGM

Description Usage Arguments Details Value Author(s) References Examples

View source: R/MatingPrograms.R

Description

For plotting GA results. See examples.

Usage

1
plotGM(GMsols, type="3D", plotly = FALSE, idealsol=NULL, traitnum=1)

Arguments

GMsols

Output of getGaSolutionsMultiTrait of getGaSolutionsMultiTraitSinCross.

type

Options are "3D", "SOM", "SOM2".

plotly

Logical, default is FALSE. Uses plotly for 3D plot if plotly is inslalled.

idealsol

For coloring the plot. Defaults is NULL. Otherwise, a vector of the same length as the GMsols statistics.

traitnum

which trait (order of trait in the markereffectslist).

Details

See examples

Value

NULL

Author(s)

Deniz Akdemir, Julio Isidro Sanch\'ez, Hanna Haikka, Itaraju Baracuhy Brum

References

Akdemir, Deniz, and Julio I. Sanchez. ”Efficient Breeding by Genomic Mating.” Frontiers in Genetics 7 (2016).

Examples

 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
43
44
45
46
47
48
49
50
51
52
53
54
## Not run: 

library(GenomicMating)
#############
####for method 3 polyploid. Markers need to be coded between 0 and 1.
N=20
nmarkers=100
Markers<-c()
for (i in 1:N){
  Markers<-rbind(Markers,runif(nmarkers))
}


Markers2<-c()
for (i in 1:N){
  Markers2<-rbind(Markers2,runif(nmarkers))
}

markereffects<-rep(0,nmarkers)
markereffects[sample(1:nmarkers,nmarkers/2)]<-rnorm(nmarkers/2)
Markers[1:5,1:5]
#library(parallel)
K=Amat.pieces(rbind(Markers)*2-1, pieces=5) 

K2=Amat.pieces(rbind(Markers,Markers2)*2-1, pieces=5) 
K[1:5,1:5]
rownames(Markers)<-paste("l", 1:nrow(Markers),sep="_")
rownames(Markers2)<-paste("l", (nrow(Markers)+1):(nrow(Markers)+nrow(Markers2)),sep="_")
rownames(K2)<-colnames(K2)<-c(rownames(Markers),rownames(Markers2))
rownames(K)<-colnames(K)<-c(rownames(Markers))

which.max(Markers%*%markereffects)
markermap=as.matrix(data.frame(chr=rep(1,nmarkers),pos=seq(0,1,length=nmarkers)))

colnames(Markers)<-1:nmarkers


gasols4<-getGaSolutionsFrontier(Markers=Markers,Markers2=Markers2, K=K2,
markereffects,markermap=markermap,nmates=10,npopGA=100, nitGA=100,
                                mc.cores=1, mutprob=0.999, noself= TRUE, method=3,
                                type=2L, generation=1L, plotiters= TRUE)



###plot results

pairs(gasols4[[1]])

####Use plotGM.

plotGM(GMsols=gasols4, type="3D", traitnum=1)
plotGM(GMsols=gasols4, type="SOM", traitnum=1)

## End(Not run)

Example output

***********************************************************

     This is 'GenomicMating' package, v 2.0

Citation details with citation('GenomicMating')

Further information with help(GenomicMating)...

***********************************************************
           [,1]      [,2]      [,3]       [,4]       [,5]
[1,] 0.76574593 0.6951255 0.5527081 0.08250825 0.13718968
[2,] 0.09206527 0.6467927 0.6201827 0.67219005 0.87318734
[3,] 0.84111491 0.6968408 0.1389425 0.93799427 0.06274957
[4,] 0.23281507 0.1678291 0.4668302 0.95978452 0.79709031
[5,] 0.07659639 0.9118669 0.1681176 0.25147565 0.18073212
            [,1]        [,2]        [,3]        [,4]        [,5]
[1,]  0.71181535 -0.09741464  0.08412125 -0.06890345 -0.07491071
[2,] -0.09741464  0.68669738 -0.17573433  0.06978065 -0.02206427
[3,]  0.08412125 -0.17573433  0.79014548 -0.12712219 -0.09399207
[4,] -0.06890345  0.06978065 -0.12712219  0.71638107 -0.14063418
[5,] -0.07491071 -0.02206427 -0.09399207 -0.14063418  0.72391997
[1] 8

GenomicMating documentation built on May 2, 2019, 6:52 a.m.