export_genclone: export data file to Adegenet, Genetix and Arlequin

Description Usage Arguments Value Note Author(s) Examples

Description

These functions allow to transform a RClone table into files to work with Adegenet (R package), Genetix and Arlequin softwares.

Usage

1
2
3
export_genclone_genind(data1, ele)
export_genclone_genetix(data1, haploid = FALSE, ele, name)
export_genclone_arlequin(data1, haploid = FALSE, name)

Arguments

data1

a RClone table with only one population.

haploid

logical, option, if haploid = FALSE, data1 contains diploid data; if haploid = TRUE, haploid data.

ele

option, separator element for export.

name

option, name of the exported file.

Value

a genind object or a file for Genetix or Arlequin.

Note

For multi-population files, we recommend to use split function to cut the table into several tables, one for each population, and then combine lapply with the export functions.

Author(s)

Creator/Author: Diane Bailleul <diane.bailleul.pro@gmail.com>
Author: Sophie Arnaud-Haond <sophie.arnaud@ifremer.fr>
Contributor: Solenn Stoeckel

The R implementation of RClone was written by Diane Bailleul.

The design was inspired by GenClone program described in Arnaud-Haond & Belkhir (2007).

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
data(posidonia)

#RClone to Adegenet:
res <- export_genclone_genind(posidonia, "/")
#library(adegenet)
#res2 <- df2genind(res, ploidy = 2, sep = "/")
#nAll(res2)

#RClone to Genetix:
export_genclone_genetix(posidonia, name = "test.txt")
#or
write.table(export_genclone_genetix(posidonia), "test2.txt", row.names = FALSE, 
sep = "\t", quote = FALSE)
#for genets only:
export_genclone_genetix(unique(posidonia), name = "test.txt")

#Rclone to Arlequin:
write.table(export_genclone_arlequin(posidonia), "file1.arp", row.names = FALSE,
 col.names = FALSE, quote = FALSE)
#or
export_genclone_arlequin(posidonia, haploid = FALSE, "file2.arp")
#for genets only:
export_genclone_arlequin(unique(posidonia), haploid = FALSE, "file2.arp")

#if several populations:
#res <- split(data, vecpop)
#lapply(res, function(x) export_genclone_genetix(x))
#lapply(res, function(x) export_genclone_arlequin(x))

dbailleul/RClone documentation built on May 17, 2021, 3:04 p.m.