Learn R Programming

RScelestial (version 1.0.4)

as.ten.state.matrix.from.node.seq: Generates 10-state sequence matrix from name/10-char string matrix.

Description

This function is used for conversion of results of internal scelestial result to 10-state sequence matrices.

Usage

as.ten.state.matrix.from.node.seq(n.seq)

Value

A 10-state sequence data frame with samples as columns and loci as rows. Elements of n.seq are translated to their 10-state representations.

Arguments

n.seq

A two column data frame. First column is the name of a node and the second column is a string representation of the sequencing result. Each element of the sequencing result is from a 10-state representation in which each state represented as a character according to the following encoding:

One character representation10-state representation
"A""A/A",
"T""T/T",
"C""C/C",
"G""G/G",
"K""A/C",
"L""A/G",
"M""C/T",
"N""C/G",
"O""T/G",
"P""T/A",
"X""./."

Examples

Run this code
## A node sequence data frame
n.seq = data.frame("node" = c("C1", "C2"), "seq" = c("AKLTCXAAC", "AKKOCXAPC"))
## Convert it to ten state matrix
as.ten.state.matrix.from.node.seq(n.seq)
#     V1  V2  V3  V4  V5  V6  V7  V8  V9
# C1 A/A A/C A/G T/T C/C ./. A/A A/A C/C
# C2 A/A A/C A/C T/G C/C ./. A/A T/A C/C

Run the code above in your browser using DataLab