gengraph | R Documentation |

These functions are under development. Please email the author before
using them for published work.

The function `gengraph`

generates graphs based on genetic
distances, so that pairs of entities (individuals or populations) are
connected if and only if they are distant by less than a given
threshold distance. Graph algorithms and classes from the
`igraph`

package are used.

`gengraph`

is a generic function with methods for the
following types of objects:

- `matrix`

(only numeric data)

- `dist`

- `genind`

objects (genetic markers, individuals)

- `genpop`

objects (genetic markers, populations)

- `DNAbin`

objects (DNA sequences)

gengraph(x, ...) ## S3 method for class 'matrix' gengraph(x, cutoff=NULL, ngrp=NULL, computeAll=FALSE, plot=TRUE, show.graph=TRUE, col.pal=funky, truenames=TRUE, nbreaks=10, ...) ## S3 method for class 'dist' gengraph(x, cutoff=NULL, ngrp=NULL, computeAll=FALSE, plot=TRUE, show.graph=TRUE, col.pal=funky, truenames=TRUE, nbreaks=10, ...) ## S3 method for class 'genind' gengraph(x, cutoff=NULL, ngrp=NULL, computeAll=FALSE, plot=TRUE, show.graph=TRUE, col.pal=funky, truenames=TRUE, nbreaks=10, ...) ## S3 method for class 'genpop' gengraph(x, cutoff=NULL, ngrp=NULL, computeAll=FALSE, plot=TRUE, show.graph=TRUE, col.pal=funky, method=1, truenames=TRUE, nbreaks=10, ...) ## S3 method for class 'DNAbin' gengraph(x, cutoff=NULL, ngrp=NULL, computeAll=FALSE, plot=TRUE, show.graph=TRUE, col.pal=funky, truenames=TRUE, nbreaks=10, ...)

`x` |
a |

`cutoff` |
a |

`ngrp` |
an |

`computeAll` |
a |

`plot` |
a |

`show.graph` |
a |

`col.pal` |
a color palette used to define group colors. |

`method` |
an |

`truenames` |
a logical indicating whether original labels should be used for plotting (TRUE), as opposed to indices of sequences (FALSE). |

`nbreaks` |
an integer indicating the number of breaks used by the heuristic when seeking an exact number of groups. |

`...` |
further arguments to be used by other functions; currently not used. |

The class `gengraph`

is a list with the following
components:

`graph` |
a graph of class |

`clust` |
a list containing group information: |

`cutoff` |
the value used as a cutoff point |

`col` |
the color used to plot each group. |

Original idea by Anne Cori and Christophe Fraser. Implementation by Thibaut Jombart t.jombart@imperial.ac.uk.

The `igraph`

package.

if(require(ape)){ data(woodmouse) g <- gengraph(woodmouse, cutoff=5) g plot(g$graph) }

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.