R/as.matrix.alignment.R

Defines functions as.matrix.alignment

Documented in as.matrix.alignment

as.matrix.alignment <- function(x, ...){
  nc <- nchar(x$seq[[1]])
  res <- matrix(data = sapply(x$seq, s2c), nrow = x$nb, ncol = nc,
                byrow = TRUE)
  rownames(res) <- x$nam
  colnames(res) <- seq_len(nc)
  return(res)
}

Try the seqinr package in your browser

Any scripts or data that you put into this service are public.

seqinr documentation built on March 31, 2023, 3:05 p.m.