RWBROOK interface functions: Data Exchange Between the Channels and
Application.
Exchange of Atom Data.
PARAMETERS:
Non-negative return codes contain bit-encoded warnings.
XYZAtom1 may set the following
warning flags:
Zero return (=RWBERR_Ok) means
success, no warnings.
REMARKS:
XYZAtom1 replicates function
XYZAtom from former
rwbrook.f. The information is
merely passed between the Library and application, with a little
bit of calculations for parameters IZ
and ID (input only). If atom position
was not properly adjusted in input channel,
iRet will return
RWBERR_EmptyPointer. For output
channels, the atom data given will replace any existing
data that might have been previously output at a given
channel pointer (e.g. if the output is being made into channel
opened first for input and then redirected for output). NOTE
that the regim of transferring the data by
XYZAtom1 is solely determined
by the channel input/output mode set in
XYZOpen or
XYZOpen1 (see also
XYZSetType).
subroutine XYZCoord1 ( iUnit,XFlag,BFlag,x,y,z,occ,BIso,U,iRet )
PARAMETERS:
Non-negative return codes contain bit-encoded warnings.
XYZCoord1 may set the following
warning flags:
Zero return (=RWBERR_Ok) means
success, no warnings.
REMARKS:
XYZCoord1 replicates function
XYZCoord from former
rwbrook.f. The information is
merely passed between the Library and application, with
calculations for parameters x,
y, z,
BIso and
U, if the corresponding fractional
modes were specified. No calculations should be performed on
the application side.
If atom position was not properly adjusted in input channel,
iRet will return
RWBERR_EmptyPointer. For output
channels, this return will be issued also in the case if
atom identification data (set by
XYZAtom1) was not provided
prior to the call of XYZCoord1.
In output regime of the channel, the data given to
XYZCoord1 will replace any
existing data that might have been previously output at a
given channel pointer (e.g. if the output is being made
into channel opened first for input and then redirected
for output). NOTE that the regim of transferring the data by
XYZCoord1 is solely determined
by the channel input/output mode set in
XYZOpen or
XYZOpen1 (see also
XYZSetType).
An attention should be given to the length of real-type
parameters. As a meter of standard, 4-byte real values
are assumed. This is determined by the definition of
apireal found in file
mmdb_rwbrook.h of the
Library. More likely than not, a mismatch in the length
of real-type parameters passed between application and
Library will lead to a crash.
subroutine XYZSetTer ( iUnit,iRet )
PARAMETERS:
REMARKS:
XYZSetTer does not have an analogue
in former rwbrook.f. In RWBROOK
interface, using this function is the only way to put chain
terminator into channel.
NOTE that prior to using this function, the internal channel
pointer should be advanced to the position of
'TER', the atom identification
data should be stored with
XYZAtom1
function (only the serial number, residue name, sequence
number, insertion code and the chain name are important here),
and only then this newly created atom may be converted into
'TER':
where we specified carbon for atom name and element type to avoid
issuing any warnings on incorrect input. This example makes the
following 'TER' card:
if iSer=4151 and
iResN=431.
Note that the coordinate information
(XYZCoord1) does not have to be set
for converting atom into a chain terminator.
subroutine XYZSetHet ( iUnit,iRet )
PARAMETERS:
REMARKS:
XYZSetHet does not have an analogue
in former rwbrook.f. In RWBROOK
interface, the "Het-atom" flag may also be set by
XYZCoord1
function.
NOTE that prior to using this function, the internal channel
pointer should be advanced to the position of
'TER', the atom identification
data should be stored with
XYZAtom1
function AND the atom coordinates should be provided with
XYZCoord1
and only then this newly created atom may be converted into
'HETATM':
The following example does exactly the same:
subroutine XYZAtom1 ( iUnit,iSer,AtNam,ResNam,ChnNam,
iResN,ResNo,InsCod,AltCod,
SegID,IZ,ID,iRet )
NOTE: using the fractional coordinate system requires that
the crystallographic information be loaded into the channel.
See more details
here
NOTE: using the fractional Us requires that the
crystallographic information be loaded into the channel.
See more details
here
The anisotropic temperature factors are not always given.
If only isotropic factor is known,
U(1) receives its value, and all
other elements of U are set to
zero. This must be performed by application for output
channels.
..........
call XYZOpen ( 'XYZIN','OUTPUT','PDB',iUnit,iRet )
call RBCheckErr ( 1,0 )
..........
iSer = 0
iResN = 1
..........
call XYZAdvance1 ( iUnit,0,iRet )
call RBCheckErr ( 2,0 )
iSer = iSer+1
call XYZAtom1 ( iUnit,iSer,'C','ALA','A',iResN,'----',
'F','-','----',0,'C',iRet )
call RBCheckErr ( 3,0 )
call XYZSetTer ( iUnit,iRet )
call RBCheckErr ( 4,0 )
..........
call XYZClose ( iUnit,iRet )
call RBCheckErr ( 5,0 )
TER 4151 ALA A 431F
..........
call XYZOpen ( 'XYZIN','OUTPUT','PDB',iUnit,iRet )
call RBCheckErr ( 1,0 )
..........
iSer = 0
iResN = 1
..........
call XYZAdvance1 ( iUnit,0,iRet )
call RBCheckErr ( 2,0 )
iSer = iSer+1
call XYZAtom1 ( iUnit,iSer,'CA','ALA','A',iResN,'----',
'F',' ','A1',0,'C',iRet )
call RBCheckErr ( 3,0 )
call XYZCoord1 ( iUnit,'O','O',x,y,z,occ,BIso,U,iRet )
call RBCheckErr ( 4,0 )
call XYZSetHet ( iUnit,iRet )
call RBCheckErr ( 5,0 )
..........
call XYZClose ( iUnit,iRet )
call RBCheckErr ( 6,0 )
..........
call XYZOpen ( 'XYZIN','OUTPUT','PDB',iUnit,iRet )
call RBCheckErr ( 1,0 )
..........
iSer = 0
iResN = 1
..........
call XYZAdvance1 ( iUnit,0,iRet )
call RBCheckErr ( 2,0 )
iSer = iSer+1
call XYZAtom1 ( iUnit,iSer,'CA','ALA','A',iResN,'----',
'F',' ','A1',0,'C',iRet )
call RBCheckErr ( 3,0 )
call XYZCoord1 ( iUnit,'HO','O',x,y,z,occ,BIso,U,iRet )
call RBCheckErr ( 4,0 )
..........
call XYZClose ( iUnit,iRet )
call RBCheckErr ( 5,0 )