R/res_xyz.R

Defines functions res_xyz

Documented in res_xyz

#' Residue XYZ
#'
#' Returns the XYZ coordinate of the specified atom from the selected residue, across all frames of a pdb object.
#' @param pdb The pdb to be processed.
#' @param res The dbl index of the selected residue.
#' @param atomtype Selection of atom to be return, defaults to calpha.
#' @keywords pdb, bio3d, calpha
#' @export
#' @examples
#' res_xyz(some_pdb, 6)


res_xyz <- function(pdb, res, atomtype = "calpha"){

  xyz_index <- atom.select(pdb, string = atomtype, resno = res)$xyz
  return(pdb$xyz[,xyz_index])
}
BradyAJohnston/mdfret documentation built on April 16, 2022, 8:32 a.m.