R/seq2aln.R

Defines functions seq2aln

Documented in seq2aln

seq2aln <-
function(seq2add, aln, id="seq", file = "aln.fa", ...) {
  ##- Add a sequence 'seq2add' to an existing alignment 'aln'
  ##  Adds at the bottom of alignment
  cl <- match.call()
   
  if(!inherits(aln, "fasta")) 
     stop("Input 'aln' should be a 'fasta' object")

  tmp.seq = as.fasta(seq2add)
  if(nrow(tmp.seq$ali) > 1)
     warning("Multiple sequences in 'seq2add' should be pre-aligned")

  dots = list(...)
  # fixed arguments
  dots$profile = aln
  dots$outfile = file
    
  args = c(list(aln=seq2add, id=id), dots)
  naln = do.call(seqaln, args)

  naln$call = cl
  return(naln)
}

Try the bio3d package in your browser

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

bio3d documentation built on Oct. 27, 2022, 1:06 a.m.