arlequin: Read and Write Arlequin Files

Description Usage Arguments Details Value Note Author(s) References Examples

Description

Read an Arlequin-formatted project input file (.arp). Convert .arp data into gtypes object. Write an input file from a gtypes object.

Usage

1
2
3
4
5
6
7
8
9
arlequinRead(file)

arp2gtypes(arp, avoid.dups = FALSE)

arlequinWrite(g, file = NULL, locus = 1)

read.arlequin(file)

write.arlequin(g, file = NULL, locus = 1)

Arguments

file

filename of an arlequin project (.arp) file. See Notes for details on how .arp files are parsed.

arp

a list of arlequin profile information and data as returned from arlequinRead.

avoid.dups

logical. Should sample identifiers be combined with strata names to avoid duplicate identifiers between strata? If set to FALSE, ids will be left unchanged, but an error will be thrown when the gtypes object is created if duplicated ids are found.

g

a gtypes object.

locus

numeric or character designation of which locus to write for haploid data.

Details

arlequinRead parses a .arp file.
arp2gtypes converts list from parsed .arp file to gtypes.
arlequinWrite writes gtypes to .arp file.

Value

arlequinRead

a list containing:

file name and full path of .arp file that was read.
profile.info list containing parameters in [[Profile]] section of .arp file. All parameters are provided. Parameters unset in .arp file are set to default values.
data.info list containing data from [[Data]] section of .arp file. Can contain elements for haplotype.definition (a data.frame), distance.matrix (a matrix), sample.data (a data.frame), or genetic.structure (a list).
arp2gtypes

a gtypes object.

arlequinWrite

the filename of the .arp file that was written.

Note

arp2gtypes() will not create a gtypes object for Arlequin projects with relative frequency data (DataType=FREQUENCY and FREQUENCY=REL). If DataType=DNA and GenotypicData=0, sequences for each haplotype or individual are assumed to be from a single locus.

Author(s)

Eric Archer eric.archer@noaa.gov

References

Excoffier, L.G. Laval, and S. Schneider (2005) Arlequin ver. 3.0: An integrated software package for population genetics data analysis. Evolutionary Bioinformatics Online 1:47-50.
Available at http://cmpg.unibe.ch/software/arlequin3/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# write test microsat data .arp file
f <- arlequinWrite(msats.g, tempfile())

# read .arp file and show structure
msats.arp <- arlequinRead(f)
print(str(msats.arp))

# convert parsed data to gtypes object
msats.arp.g <- arp2gtypes(msats.arp)
msats.arp.g

# compare to original
msats.g

strataG documentation built on Feb. 28, 2020, 9:07 a.m.