chfl_residue type¶
- type chfl_residue¶
A
chfl_residueis a group of atoms belonging to the same logical unit. They can be small molecules, amino-acids in a protein, monomers in polymers, etc.- Type fields:
% init [subroutine] ::
chfl_residue%init()% copy [subroutine] ::
chfl_residue%copy()% name [function] ::
chfl_residue%name()% id [function] ::
chfl_residue%id()% atoms_count [function] ::
chfl_residue%atoms_count()% add_atom [subroutine] ::
chfl_residue%add_atom()% contains [function] ::
chfl_residue%contains()% atoms [subroutine] ::
chfl_residue%atoms()% set [subroutine] ::
chfl_residue%set()% get [function] ::
chfl_residue%get()% properties_count [function] ::
chfl_residue%properties_count()% list_properties [subroutine] ::
chfl_residue%list_properties()% free [subroutine] ::
chfl_residue%free()
- subroutine chfl_residue%init(name[, id, status])¶
Initialize the residue with a new residue with the given
nameand optional residueid. This subroutine allocate memory which must be released withchfl_residue%free().- Parameters:
name [character(len=*)] :: residue name
- Options:
id [integer] :: residue id
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS, usechfl_last_error()to learn more about the error.
- subroutine chfl_residue%copy(residue[, status])¶
Initialize this residue with a copy of
residue. This subroutine allocate memory which must be released withchfl_residue%free().- Parameters:
residue [type(chfl_residue)] :: residue to copy
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS, usechfl_last_error()to learn more about the error.
- function chfl_residue%name([status])¶
Get the name of the residue. If the name is longer than
CHFL_STRING_LENGTH, it will be truncated.- Return:
character (len=CHFL_STRING_LENGTH)
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS, usechfl_last_error()to learn more about the error.
- function chfl_residue%id([status])¶
Get the residue id. If the residue do not have an id,
statusis set toCHFL_GENERIC_ERROR, and no value is returned.- Return:
integer
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS, usechfl_last_error()to learn more about the error.
- function chfl_residue%atoms_count([status])¶
Get the number of atoms in the residue.
- Return:
integer
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS, usechfl_last_error()to learn more about the error.
- subroutine chfl_residue%add_atom(index[, status])¶
Add the atom at the given
indexin the residue.- Parameters:
index [integer] :: index of the atom to add
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS, usechfl_last_error()to learn more about the error.
- function chfl_residue%contains(index[, status])¶
Check if the atom at the given
indexis in the residue.- Return:
logical
- Parameters:
index [integer] :: index of the atom
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS, usechfl_last_error()to learn more about the error.
- subroutine chfl_residue%atoms(data[, status])¶
Get the list of atoms in the topology in the pre-allocated array
dataof sizechfl_residue%atoms_count().- Parameters:
data [integer,dimension(:)] :: array to be filled with the indexes of atoms in the residue
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS, usechfl_last_error()to learn more about the error.
- subroutine chfl_residue%set(name, property[, status])¶
Add a new
propertywith the givennameto this residue.If a property with the same name already exists, this function override the existing property with the new one.
propertycan either be achfl_property, or any value that can be stored in achfl_property: logical, real, string, or vector3d.- Parameters:
name [character(len=*)] :: property name
property [type(chfl_property)] :: the new property
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS, usechfl_last_error()to learn more about the error.
- function chfl_residue%get(name[, status])¶
Get a copy of the property with the given
namein this residue. If no property exist with this name,statuswill be set toCHFL_PROPERTY_ERROR.The associated memory must be released by calling
chfl_property%free().- Return:
type (chfl_property)
- Parameters:
name [character(len=*)] :: property name
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS, usechfl_last_error()to learn more about the error.
- function chfl_residue%properties_count([status])¶
Get the number of properties in this residue.
- Return:
integer
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS, usechfl_last_error()to learn more about the error.
- subroutine chfl_residue%list_properties(names[, status])¶
Fill the pre-allocated array
nameswith the names of the properties in this residue. The array must have room forchfl_residue%properties_count()values of typecharacter(len=CHFL_STRING_LENGTH).- Return:
integer
- Parameters:
names (:) [character(len=CHFL_STRING_LENGTH)] :: list of properties names
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS, usechfl_last_error()to learn more about the error.
- subroutine chfl_residue%free()¶
Destroy a residue, and free the associated memory