convert_GC: File conversion into RClone files

Description Usage Arguments Value Author(s) See Also Examples

View source: R/RClone.R

Description

convert_GC helps files conversion into RClone format.

RClone functions work on tables with one allele per column.

convert_GC converts tables with one locus per column into tables with one allele per column, handling separation elements.

convert_GC also sorts alleles at a locus per increasing order.

Usage

1
convert_GC(data1, num, ele)

Arguments

data1

a table, with units in row and one locus per column.

num

numeric, the length of each allele.

ele

option, the alleles separator in the original table.

Value

a table with one allele per column, alleles sorted by increasing order.

Author(s)

Creator/Author: Diane Bailleul <[email protected]>
Author: Sophie Arnaud-Haond <[email protected]>
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).

See Also

sort_all for tables with one allele per column.
transcript_GC uses convert_GC as internal function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
test <- matrix("232/231", ncol = 2, nrow = 2)
convert_GC(test, 3, "/") 
#"232" is a allele of length 3 and "/" is the separator.

test2 <- matrix("192235", ncol = 2, nrow = 2)
convert_GC(test2, 3) 
#no separator

#with data1, a genind object from adegenet:
#test <- genind2df(data1)
#convert_GC(test, 3, "/")

dbailleul/RClone documentation built on May 12, 2017, 8:56 p.m.