R/read.prmtop.R

Defines functions read.prmtop

Documented in read.prmtop

read.prmtop <- function(file) {
  cl <- match.call()

  if(missing(file)) {
    stop("read.pdb: please specify a PDB 'file' for reading")
  }
  
  ##- Check if file exists locally or on-line
  if(!file.exists(file)) {
    stop("No input PDB file found: check filename")
  }
  
  ## parse PRMTOP file with cpp function
  prmtop <- .read_prmtop(file)
  if(!is.null(prmtop$error))
    stop(paste("Could not read", file))
  else
    class(prmtop) <- c("amber", "prmtop")
  
  prmtop$call <- cl
  
  ## finished
  return(prmtop)
}

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.