code2nid {phyclust} | R Documentation

## 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)

### 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.

### Details

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

### Value

`code2nid` returns a numerical vector containing nucleotide ids, and `nid2code` returns a character vector containing nucleotide codes.

### Author(s)

Wei-Chen Chen wccsnow@gmail.com

### References

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

### See Also

`.nucleotide`, `snp2sid`, `sid2snp`, `code2snp`, `snp2code`.

### Examples

    ## Not run:
    library(phyclust, quiet = TRUE)

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

    ## End(Not run)

[Package phyclust version 0.1-25 Index]