NAMD
Public Types | Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | List of all members
PDBAtom Class Reference

#include <PDBData.h>

Inheritance diagram for PDBAtom:
PDBData PDBAtomRecord PDBHetatm

Public Types

enum  Start {
  STYPE =1, SSERIAL =7, SNAME =13, SALT =17,
  SRESNAME =18, SCHAIN =22, SRESSEQ =23, SINSERT =27,
  SX =31, SY =39, SZ =47, SOCC =55,
  STEMPF =61, SFOOT =68, SSEGNAME =73, SELEMENT =77
}
 
enum  Length {
  LTYPE =6, LSERIAL =5, LNAME =4, LALT =1,
  LRESNAME =4, LCHAIN =1, LRESSEQ =4, LINSERT =1,
  LCOOR =8, LCOORPREC =3, LOCC =6, LOCCPREC =2,
  LTEMPF =6, LTEMPFPREC =2, LFOOT =3, LSEGNAME =4,
  LELEMENT =2
}
 
- Public Types inherited from PDBData
enum  PDBType {
  HEADER, OBSLTE, COMPND, SOURCE,
  EXPDTA, AUTHOR, REVDAT, SPRSDE,
  JRNL, REMARK, SEQRES, FTNOTE,
  HET, FORMUL, HELIX, SHEET,
  TURN, SSBOND, SITE, CRYST1,
  ORIGX, SCALE, MTRIX, TVECT,
  MODEL, ATOM, HETATM, SIGATM,
  ANISOU, SIGUIJ, TER, ENDMDL,
  CONECT, MASTER, END, UNKNOWN
}
 
enum  PDBFormatStyle { COLUMNS, FIELDS }
 

Public Member Functions

 PDBAtom (void)
 
virtual ~PDBAtom (void)
 
void parse (const char *s)
 
void sprint (char *s, PDBFormatStyle usestyle=COLUMNS)
 
int serialnumber (void)
 
void serialnumber (int newserialnumber)
 
const char * name (void)
 
void name (const char *newname)
 
const char * alternatelocation (void)
 
void alternatelocation (const char *newalternatelocation)
 
const char * residuename (void)
 
void residuename (const char *newresiduename)
 
const char * chain (void)
 
void chain (const char *newchain)
 
int residueseq (void)
 
void residueseq (int newresidueseq)
 
const char * insertioncode (void)
 
void insertioncode (const char *newinsertioncode)
 
BigReal xcoor (void)
 
void xcoor (BigReal newxcoor)
 
BigReal ycoor (void)
 
void ycoor (BigReal newycoor)
 
BigReal zcoor (void)
 
void zcoor (BigReal newzcoor)
 
const BigRealcoordinates (void)
 
void coordinates (const BigReal *newcoordinates)
 
BigReal occupancy (void)
 
void occupancy (BigReal newoccupancy)
 
BigReal temperaturefactor (void)
 
void temperaturefactor (BigReal newtemperaturefactor)
 
int footnote (void)
 
void footnote (int newfootnote)
 
const char * segmentname (void)
 
void segmentname (const char *newsegmentname)
 
const char * element (void)
 
void element (const char *newelement)
 
- Public Member Functions inherited from PDBData
 PDBData (PDBType newtype)
 
virtual ~PDBData (void)
 
PDBType type (void)
 

Static Public Attributes

static const int default_serial = -1
 
static const int default_residueseq = -1
 
static const BigReal default_coor = 9999.000
 
static const BigReal default_occupancy = 1.00
 
static const BigReal default_temperaturefactor = 0.00
 
static const int no_footnote = 0
 
- Static Public Attributes inherited from PDBData
static const char * PDBNames [UNKNOWN+1]
 

Protected Types

enum  PDBPossibleAtoms { USE_ATOM = ATOM, USE_HETATM = HETATM }
 

Protected Member Functions

 PDBAtom (const char *data, PDBPossibleAtoms whichatom)
 

Additional Inherited Members

- Static Protected Member Functions inherited from PDBData
static void scan (const char *data, int len, int start, int size, int *ans, int defalt)
 
static void scan (const char *data, int len, int start, int size, BigReal *ans, BigReal defalt)
 
static void scan (const char *data, int len, int start, int size, char *ans)
 
static void field (const char *data, int fld, char *result)
 
static void sprintcol (char *s, int start, int len, const char *val)
 
static void sprintcol (char *s, int start, int len, int val)
 *** provide a simple way to print to a specific column More...
 
static void sprintcol (char *s, int start, int len, int prec, BigReal val)
 

Detailed Description

Definition at line 134 of file PDBData.h.

Member Enumeration Documentation

Enumerator
LTYPE 
LSERIAL 
LNAME 
LALT 
LRESNAME 
LCHAIN 
LRESSEQ 
LINSERT 
LCOOR 
LCOORPREC 
LOCC 
LOCCPREC 
LTEMPF 
LTEMPFPREC 
LFOOT 
LSEGNAME 
LELEMENT 

Definition at line 147 of file PDBData.h.

enum PDBAtom::PDBPossibleAtoms
protected
Enumerator
USE_ATOM 
USE_HETATM 

Definition at line 181 of file PDBData.h.

Enumerator
STYPE 
SSERIAL 
SNAME 
SALT 
SRESNAME 
SCHAIN 
SRESSEQ 
SINSERT 
SX 
SY 
SZ 
SOCC 
STEMPF 
SFOOT 
SSEGNAME 
SELEMENT 

Definition at line 138 of file PDBData.h.

Constructor & Destructor Documentation

PDBAtom::PDBAtom ( const char *  data,
PDBPossibleAtoms  whichatom 
)
protected

Definition at line 203 of file PDBData.C.

References parse().

205 {
206  parse(data);
207 };
PDBData(PDBType newtype)
Definition: PDBData.h:90
void parse(const char *s)
Definition: PDBData.C:193
PDBAtom::PDBAtom ( void  )

Definition at line 210 of file PDBData.C.

References alternatelocation(), chain(), default_coor, default_occupancy, default_residueseq, default_serial, default_temperaturefactor, element(), footnote(), insertioncode(), name(), no_footnote, occupancy(), residuename(), residueseq(), segmentname(), serialnumber(), temperaturefactor(), xcoor(), ycoor(), and zcoor().

211 {
213  name("");
214  alternatelocation("");
215  residuename("");
216  chain("");
218  insertioncode("");
225  segmentname("");
226  element("");
227 }
static const BigReal default_coor
Definition: PDBData.h:155
static const int no_footnote
Definition: PDBData.h:158
static const BigReal default_temperaturefactor
Definition: PDBData.h:157
const char * chain(void)
Definition: PDBData.C:405
BigReal temperaturefactor(void)
Definition: PDBData.C:450
const char * insertioncode(void)
Definition: PDBData.C:417
BigReal zcoor(void)
Definition: PDBData.C:433
PDBData(PDBType newtype)
Definition: PDBData.h:90
const char * residuename(void)
Definition: PDBData.C:399
int footnote(void)
Definition: PDBData.C:456
BigReal ycoor(void)
Definition: PDBData.C:429
int residueseq(void)
Definition: PDBData.C:411
const char * alternatelocation(void)
Definition: PDBData.C:392
const char * name(void)
Definition: PDBData.C:386
static const int default_residueseq
Definition: PDBData.h:154
BigReal xcoor(void)
Definition: PDBData.C:425
BigReal occupancy(void)
Definition: PDBData.C:444
const char * element(void)
Definition: PDBData.C:470
int serialnumber(void)
Definition: PDBData.C:380
static const int default_serial
Definition: PDBData.h:153
static const BigReal default_occupancy
Definition: PDBData.h:156
const char * segmentname(void)
Definition: PDBData.C:464
PDBAtom::~PDBAtom ( void  )
virtual

Definition at line 230 of file PDBData.C.

230  {
231 }

Member Function Documentation

const char * PDBAtom::alternatelocation ( void  )

Definition at line 392 of file PDBData.C.

Referenced by PDB::PDB(), and PDBAtom().

393 { return myalternatelocation; }
void PDBAtom::alternatelocation ( const char *  newalternatelocation)

Definition at line 394 of file PDBData.C.

References LALT.

395 { strncpy(myalternatelocation, newalternatelocation, LALT);
396  myalternatelocation[LALT]=0;}
const char * PDBAtom::chain ( void  )

Definition at line 405 of file PDBData.C.

Referenced by PDBAtom().

406 { return mychain; }
void PDBAtom::chain ( const char *  newchain)

Definition at line 407 of file PDBData.C.

References LCHAIN.

408 { strncpy(mychain, newchain, LCHAIN); mychain[LCHAIN]=0;}
const BigReal * PDBAtom::coordinates ( void  )

Definition at line 438 of file PDBData.C.

Referenced by PDB::PDB().

439 { return mycoor; }
void PDBAtom::coordinates ( const BigReal newcoordinates)

Definition at line 440 of file PDBData.C.

441 { for (int i=0; i<3; i++) mycoor[i] = newcoordinates[i]; }
const char * PDBAtom::element ( void  )

Definition at line 470 of file PDBData.C.

Referenced by PDBAtom(), and Molecule::prepare_qm().

471 { return myelement; }
void PDBAtom::element ( const char *  newelement)

Definition at line 472 of file PDBData.C.

References LELEMENT.

473 { strncpy(myelement, newelement, LELEMENT); myelement[LELEMENT]=0;}
int PDBAtom::footnote ( void  )

Definition at line 456 of file PDBData.C.

Referenced by PDBAtom().

457 { return myfootnote; }
void PDBAtom::footnote ( int  newfootnote)

Definition at line 458 of file PDBData.C.

459 { myfootnote = newfootnote; }
const char * PDBAtom::insertioncode ( void  )

Definition at line 417 of file PDBData.C.

Referenced by PDBAtom().

418 { return myinsertioncode; }
void PDBAtom::insertioncode ( const char *  newinsertioncode)

Definition at line 419 of file PDBData.C.

References LINSERT.

420 { strncpy(myinsertioncode, newinsertioncode, LINSERT);
421  myinsertioncode[LINSERT]=0;}
const char * PDBAtom::name ( void  )

Definition at line 386 of file PDBData.C.

Referenced by PDB::PDB(), and PDBAtom().

387 { return myname; }
void PDBAtom::name ( const char *  newname)

Definition at line 388 of file PDBData.C.

References LNAME.

389 { strncpy(myname, newname, LNAME); myname[LNAME]=0; }
BigReal PDBAtom::occupancy ( void  )

Definition at line 444 of file PDBData.C.

Referenced by PDB::PDB(), PDBAtom(), and Molecule::prepare_qm().

445 { return myoccupancy ;}
void PDBAtom::occupancy ( BigReal  newoccupancy)

Definition at line 446 of file PDBData.C.

447 { myoccupancy = newoccupancy; }
void PDBAtom::parse ( const char *  s)

Definition at line 193 of file PDBData.C.

References PDBData::field().

Referenced by PDBAtom().

194 {
195  char tempstr[100];
196  field(data, 1, tempstr); // get info about field #1 (the first one)
197  if (tempstr[0] == '#') {
198  parse_field_data(data);
199  } else {
200  parse_column_data(data);
201  }
202 }
static void field(const char *data, int fld, char *result)
Definition: PDBData.C:133
const char * PDBAtom::residuename ( void  )

Definition at line 399 of file PDBData.C.

Referenced by PDB::PDB(), PDBAtom(), and Molecule::prepare_qm().

400 { return myresiduename; }
void PDBAtom::residuename ( const char *  newresiduename)

Definition at line 401 of file PDBData.C.

References LRESNAME.

402 { strncpy(myresiduename, newresiduename, LRESNAME); myresiduename[LRESNAME]=0;}
int PDBAtom::residueseq ( void  )

Definition at line 411 of file PDBData.C.

Referenced by Molecule::build_go_arrays(), PDB::PDB(), PDBAtom(), and Molecule::prepare_qm().

412 { return myresidueseq; }
void PDBAtom::residueseq ( int  newresidueseq)

Definition at line 413 of file PDBData.C.

414 { myresidueseq = newresidueseq; }
const char * PDBAtom::segmentname ( void  )

Definition at line 464 of file PDBData.C.

Referenced by PDBAtom(), and Molecule::prepare_qm().

465 { return mysegmentname; }
void PDBAtom::segmentname ( const char *  newsegmentname)

Definition at line 466 of file PDBData.C.

References LSEGNAME.

467 { strncpy(mysegmentname, newsegmentname, LSEGNAME); mysegmentname[LSEGNAME]=0;}
int PDBAtom::serialnumber ( void  )

Definition at line 380 of file PDBData.C.

Referenced by PDB::PDB(), and PDBAtom().

381 { return myserialnumber; }
void PDBAtom::serialnumber ( int  newserialnumber)

Definition at line 382 of file PDBData.C.

383 { myserialnumber = newserialnumber; }
void PDBAtom::sprint ( char *  s,
PDBFormatStyle  usestyle = COLUMNS 
)
virtual

Reimplemented from PDBData.

Definition at line 615 of file PDBData.C.

References PDBData::COLUMNS.

Referenced by PDB::write().

616 {
617  if (usestyle == PDBData::COLUMNS)
618  sprint_columns( outstr);
619  else
620  sprint_fields( outstr);
621 }
BigReal PDBAtom::temperaturefactor ( void  )

Definition at line 450 of file PDBData.C.

Referenced by PDB::PDB(), PDBAtom(), and Molecule::prepare_qm().

451 { return mytemperaturefactor; }
void PDBAtom::temperaturefactor ( BigReal  newtemperaturefactor)

Definition at line 452 of file PDBData.C.

453 { mytemperaturefactor = newtemperaturefactor; }
BigReal PDBAtom::xcoor ( void  )

Definition at line 425 of file PDBData.C.

Referenced by Molecule::build_go_arrays(), PDB::find_extremes(), PDBAtom(), and PDB::set_all_positions().

426 { return mycoor[0]; }
void PDBAtom::xcoor ( BigReal  newxcoor)

Definition at line 427 of file PDBData.C.

428 { mycoor[0] = newxcoor; }
BigReal PDBAtom::ycoor ( void  )

Definition at line 429 of file PDBData.C.

Referenced by Molecule::build_go_arrays(), PDB::find_extremes(), and PDBAtom().

430 { return mycoor[1]; }
void PDBAtom::ycoor ( BigReal  newycoor)

Definition at line 431 of file PDBData.C.

432 { mycoor[1] = newycoor; }
BigReal PDBAtom::zcoor ( void  )

Definition at line 433 of file PDBData.C.

Referenced by Molecule::build_go_arrays(), PDB::find_extremes(), and PDBAtom().

434 { return mycoor[2]; }
void PDBAtom::zcoor ( BigReal  newzcoor)

Definition at line 435 of file PDBData.C.

436 { mycoor[2] = newzcoor; }

Member Data Documentation

const BigReal PDBAtom::default_coor = 9999.000
static

Definition at line 155 of file PDBData.h.

Referenced by PDBAtom().

const BigReal PDBAtom::default_occupancy = 1.00
static

Definition at line 156 of file PDBData.h.

Referenced by PDB::PDB(), and PDBAtom().

const int PDBAtom::default_residueseq = -1
static

Definition at line 154 of file PDBData.h.

Referenced by PDBAtom().

const int PDBAtom::default_serial = -1
static

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 153 of file PDBData.h.

Referenced by PDBAtom().

const BigReal PDBAtom::default_temperaturefactor = 0.00
static

Definition at line 157 of file PDBData.h.

Referenced by PDB::PDB(), and PDBAtom().

const int PDBAtom::no_footnote = 0
static

Definition at line 158 of file PDBData.h.

Referenced by PDBAtom().


The documentation for this class was generated from the following files: