# Load the data set and calculate the distance matrix for all individuals.
data(Aeut)
A.dist <- diss.dist(Aeut)
# Graph it.
A.msn <- poppr.msn(Aeut, A.dist, gadj=15, vertex.label=NA)
# Set subpopulation structure.
Aeut.sub <- as.genclone(Aeut)
setpop(Aeut.sub) <- ~Pop/Subpop
# Plot respective to the subpopulation structure
As.msn <- poppr.msn(Aeut.sub, A.dist, gadj=15, vertex.label=NA)
# Show only the structure of the Athena population.
As.msn <- poppr.msn(Aeut.sub, A.dist, gadj=15, vertex.label=NA, sublist=1:10)
# Let's look at the structure of the microbov data set
data(microbov)
micro.dist <- diss.dist(microbov)
micro.msn <- poppr.msn(microbov, diss.dist(microbov), vertex.label=NA)
# Let's plot it and show where individuals have < 15% of their genotypes
different.
edge_weight <- E(micro.msn$graph)$weight
edge_labels <- ifelse(edge_weight < 0.15, round(edge_weight, 3), NA)
plot.igraph(micro.msn$graph, edge.label = edge_labels, vertex.size = 2,
edge.label.color = "red")
Run the code above in your browser using DataLab