R/proteinClassDefinition.R

Defines functions Protein

#'@title Protein Class Definitions
#'
#'@aliases Protein-class
#'
#'@description Protein Class used to Define Protein Objects of S3 and S4 Types.
#'Currently still in development, Integrity checks still need to be added.
#'
#'@format Breakdown of a Protein Object's structure:
#'\itemize{
#'  \item{header: }{List of 2, Header Line and Title \itemize{
#'    \item{header_line: }{List of 3, Classification, depDate, and idCode \itemize{
#'      \item{classifiation: }{Classification of the Protein in the PDB}
#'      \item{depDat: }{Date the PDB was deposited or created}
#'      \item{idCode: }{4 digit identifier for the PDB. Always unique.}
#'      }}
#'    \item{title: }{The title of the PDB.}
#'    }}
#'  \item{structure: }{Dataframe of 16 variables \enumerate{
#'    \item{record_type:}{Type of record in this section. Generally ATOM or HETATM}
#'    \item{serial_num: }{The serial number for the position of the atom in the sequence}
#'    \item{atom_name: }{A name to identify the atom in a structure}
#'    \item{alt_location_id: }{}
#'    \item{residue_name: }{3 character identifier for a residue}
#'    \item{chain_id: }{}
#'    \item{residue_seq_num: }{Number representing where in the sequence a residue is. }
#'    \item{insert_residue_code: }{}
#'    \item{x_ortho_coord: }{X coordinate in Ångstroms on an orthogonal plane}
#'    \item{y_ortho_coord: }{Y coordinate in Ångstroms on an orthogonal plane}
#'    \item{z_ortho_coord: }{Z coordinate in Ångstroms on an orthogonal plane}
#'    \item{occupancy: }{}
#'    \item{temp_factor: }{The amount of overall error in the measurement of an atom.}
#'    \item{segment_id: }{}
#'    \item{element_symbol: }{Periodic symbol representing an atom.}
#'    \item{charge: }{Charge of the given atom. Can be +, -, or none at all}
#'  }}
#'}

#S4 Protein Class Declaration ##################################################
setClass("Protein", representation(
  header = "list",
  structure = "data.frame")
)

#S3 Protein Class Constructor ##################################################
Protein <- function(hdr, prtn_strct) {
  #Integrity checks go here:

  #Put it all together
  newProteinObject <- list(header = hdr,
                           structure = prtn_strct)
  class(newProteinObject) <- "Protein"

  #Return the new object value
  return(newProteinObject)
}
SimonLiles/protein8k documentation built on Dec. 18, 2021, 2:01 p.m.