Learn R Programming

phyclust (version 0.1-34)

code2nid: Transfer Codes (A, G, C, T, -) and nids (0, 1, 2, 3, 4)

Description

Transfer nucleotide codes (A, G, C, T, -) and nucleotide ids (0, 1, 2, 3, 4).

Usage

### S3 methods for a list, vector or matrix (default).
code2nid(codeseq)
nid2code(nidseq, lower.case = TRUE)

Value

code2nid returns a numerical vector containing nucleotide ids, and

nid2code returns a character vector containing nucleotide codes.

Arguments

codeseq

a character vector contains nucleotide codes, A, G, C, T, or -.

nidseq

a numerical vector contains nucleotide ids, 0, 1, 2, 3, or 4.

lower.case

transfer in lower cases.

Author

Wei-Chen Chen wccsnow@gmail.com

Details

These functions are based on the internal object .nucleotide to transfer codes and nids.

References

Phylogenetic Clustering Website: https://snoweye.github.io/phyclust/

See Also

.nucleotide, snp2sid, sid2snp, code2snp, snp2code.

Examples

Run this code
if (FALSE) {
library(phyclust, quiet = TRUE)

a <- c("A", "C", "G", "-", "T")
code2nid(a)
nid2code(code2nid(a)) 
}

Run the code above in your browser using DataLab