Learn R Programming

RClone (version 1.0.3)

convert_GC: File conversion into RClone files

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

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.

See Also

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

Examples

Run this code
# NOT RUN {
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, "/")
# }

Run the code above in your browser using DataLab