Beside the listed commands for manipulating chemical and non-chemical objects, the standard Tcl scripting interface is enhanced with a collection of additional commands which do not belong to one of the two big groups. This is a list of these commands:
alarm()C library function. Only relevant for the Windows version, because on Unix the equivalent alarm command provided by the TclX library is available.
The Cactvs toolkit adds a number of commonly used mathematical functions to the interpreters. For Tcl , this means they are implemented as extensions to the math expression engine. The mathematics enhancements are implemented as normal module functions in Python . Python does not distinguish between normal and math functions.
range()function, the Python version uses the function name inrange .
This command provides basic functionality for the processing of bit vectors on a string level, or as binary pre-parsed objects. String representations of bit vectors understood by this command consist of 0 and 1 characters, optionally prefixed by a percent or B character. Bitvectors with this encoding style can, for example, be obtained from a Tcl data recall command on chemistry object bitvector data items.
In both the Tcl and Python interfaces, decoded bitvectors are internally represented as binary custom language interface objects. This avoids re-parsing strings if the objects are used in multiple processing commands.
These are the standard boolean operations. nand and nor yields the inverted result of the and and or operations. If no arguments beyond the first are given, the result is the input vector for and, or, xor , and the inverted input vector for the rest. In case the vectors are of different lengths, they are virtually padded with zero bits to the size of the largest vector. eor is an alias name for the xor operation.
Return a list of the vector index positions (starting with zero) which have a set or unset bit. Optionally, an offset for the first bit to be tested, and the maximum number of bits to be tested may be specified. By default, testing begins with the first vector position (index 0) and continues until the end of the vector. The subcommand
may be abbreviated to
are aliases for this command.
These commands are equivalent to the
commands above, except that they report the selected bit positions starting with one instead of zero, in the customary fashion of file record counting.
Generated a new bitvector of the specified length. By default, it is set to all zeros. The base value parameter, which may be 0 or 1, can be used to generate a vector with all set bits instead. If the toggle positions argument is used, it is expected to be an integer list with 0-based vector indices were the bit value in the new vector should be flipped.
This command parses a vector representation (which can be a string representation, or already a bitvector object, in which case no real work is performed) and creates a new pre-parsed bitvector object.
Perform a screening operation on the first bitvector. The command returns the first 0-based index position where a bit is set in the second vector, but not in the first. If all set bits in the second vector have counterparts in the first vector, minus one is returned. The bitvectors may be of different length. The shorter vector is assumed to be filled up with zero bits. In a standard application, the first argument is a feature vector of a structure, and the second vector a feature vector of a substructure.
Perform a screening operation on the first bitvector. The command returns a list of all 0-based bit positions where a bit is set in the second vector, but not in the first. If all set bits in the second vector have counterparts in the first vector, an empty list is returned. The bitvectors may be of different length. The shorter vector is assumed to be filled up with zero bits. In a standard application, the first argument is a feature vector of a structure, and the second vector a feature vector of a substructure.
Compare the two bitvectors and return the 1-based position of the first bit which disagrees. If the bit is set in the first vector, a the position is returned as a positive number, and as a negative number when the bit is set in the second vector. If both vectors are identical, or are identical if the shorter vector is assumed to be filled up with zero bits, the return value is zero. The alternative subcommand name
is an alias.
Compare the two bitvectors and return a list of the 1-based bit positions where the two vectors disagree. If at any such position the first vector has a set bit, the position is listed as a positive number. In the opposite case, the position is entered as a negative number. If the vectors are identical, or are identical if the shorter vector is assumed to be filled up with zero bits, the return value is an empty list. The alternative subcommand name
is an alias.
implementation additionally supports standard copy and pickle methods, with-clause, and overloaded numeric operators
as well as
method returns the vector length. A bitvector has a boolean true value if any of its bits are set. Setting and retrieving individual bits via indices is also supported:
Due to syntactic limitations in the generic
methods cannot be named such - these are reserved words. Instead, they are accessible as
. The other bit methods (
) are implemented with their normal name, but also accessible with the same prefix. The
is equivalent to a
statement, except that it is an instance method, not a class method.
This command reads formatted binary data from an output channel. The specified Tcl channel is automatically configured for binary data for the duration of the command and then restored to the original state.
Multiple values sharing the same format can be read in one statement with a set of recipient variables is specified. The return value is the value of the last item read. If no variables are used, one item is read and returned, but not stored in a variable.
This command writes formatted binary data to an output channel. The specified Tcl channel is automatically configured for binary data for the duration of the command and then restored to the original state.
If more than one data item is specified, the same format is used for all the data items. For most formats, the binary data layout is not changed and it thus platform-dependent. The exception are those formats which are prefixed with an X: These follow the platform-independent XDR encoding standard (RFC 1014) in their layout (network byte order, MSB first), but not in the stored item size (the byte size of smaller objects is not expanded to multiples of four). The following formats are supported:
The string format may contain additional length and pad character specifications. If a pad character is used, it must be supplied as its ISO Latin code. This makes it simple to use zero bytes as filler.
writes a string which always occupies exactly 16 bytes. If it is longer, the extra characters are ignored. If it is shorter, it is padded with “x“ characters. A zero byte is not written, because this string has an explicit length.
Decode a color name. On Unix systems, color names are looked up in the local X11 color database. On the PC platform, a representative X11 color database dump is compiled into the application. In addition to English color names, the standard hex color notation, such as #rrggbb or #rgb, may be used, with or without alpha channel data. If a hex color notation has 4, 8 or 16 hex digits, the value is interpreted as # rgba , # rrggbbaa and # rrrrggggbbbbaaaa , respectively. In case of 12 hex digits (12 is both divisible by 3 and 4), the interpretation # rrrrggggbbbb takes precedence. Color names are case-insensitive.
By default, a color depth of 16 bits is assumed, and the returned color component values are thus in the range 0..65535. Smaller or larger color component value ranges may be specified by an explicit depth value, which must be in the range between 2 and 24. Depth 8 is used for the commonly used format with 8 bits per channel.
If the - shade option is used, the decoded color value is darkened or brightened by the specified amount by component-wise addition before it is output in the selected format. The shading value is scaled according to the selected color depth, i.e. with a color depth of 8, the useful minimum and maximum scale values are -255 and +255, while with a color depth of 16 the limits are -65525 and +65535. The transformed color values are automatically clamped to the white and black extremes, so the output will always be a valid color representation. Shading is not applied to the alpha/opacity channel. A shading value of zero has no effect in any color depth.
The default return format is a list with the decimal RGB values of the decoded color. This corresponds to the explicit mode -tuple. If the - hex option is set, the output is formatted as a single hex-encoded color value, and - javaint returns a standard Java color signed int color value. If the - alpha option is set, the format of the output includes the opacity value as the fourth component in RGBA order, either as an additional list element or appended to the hex string. The - javaint value always includes an alpha component.
With the - name option the command attempts to find the most closely matching color name in the database for the decoded and transformed color values and return that name instead of a color component list or hex encoding.
Transform the current process into a daemon process which is decoupled from all control terminals and runs in the background until finished or terminated. The current process is forked, and the old foreground process exited.
By default, the background process priority is unchanged. Alternatively, a new priority may be specified as the first optional argument. If it not an empty string, an attempt is made to set the process priority to the new value. No error message is generated when the attempt fails. Useful priority values depend on the platform. On Linux, the range is 0...20, with 20 being the lowest priority. Increasing the priority, by using a value lower than the current process value, requires non-standard permissions, usually an effective application user ID of root.
By default, all open file handles are closed. If the optional
parameter is set to 0, most file handles are kept open. An exception are the standard input, output and error channels. These are always redirected to
regardless of the option value. Note that the closing of the file descriptors does not automatically invalidate any
scripting language references to these, such as standard
file or socket handles, or toolkit
handles. These should be explicitly closed by the application script before this function is called. Otherwise, any use of these stale handles results in errors.
This command decodes a number of commonly encountered encoding formats for string and binary data. The decoded data is returned as command result. The mode parameter decides which decoding scheme is used. For the Python version, the mode is usually specified without the leading -, but this is not required. The following modes are available:
The return value is a wide integer value with all bits set according to the decoded symbolic value string. If the value cannot be decoded, an error results. An empty value argument always yields zero as result. Example:
The return value is 5, which is combined from set bit index 0 for a and set bit index 2 for c . For bitsets, the first colon-separated word in the enumeration specification contains one or more aliases for zero set bits, which corresponds to the numerical result zero. Instead of a vertical bar, whitespace may also be used as bit position name separators.
The returned value is 1, which is the default value of symbolic name b , or its alias beta , taken from its colon-separated word index. The word index is used in the absence of an explicit value, as it is specified in the example for value c .
https://loinc.org/) and get the textual description of the data content. The first call to the LOINC decoder takes a few seconds since the LOINC table needs to be loaded from disk.
compress(). This is primarily useful in the context of the Mysql database cartridge. The data consists of a 4-byte binary header with the decompressed data length, followed by zlib-compressed data. An empty string is encoded verbatim.
RC4cipher. This command version requires an additional argument after the data argument which is used as the decoder key.
filexcommand. The argument file is not required to exist - it is only used to extract the suffix. This command does not try to match table or network file extensions, but it ignores known compression suffixes such as . gz , .Z or .bz in determining the applicable core file suffix.
clock scanfor Tcl ,
datetime.strptimefor Python )
The decoded data may contain zero-bytes and other special characters and may thus need special care in further processing. The counterpart of the
command is the
command, which can be used to encode data in all recognized decoder formats.
This command is the counterpart to the
command. It is not completely identical, though . There are encoding schemes for which no corresponding decoding method has been implemented. Additionally, the decoder automatically recognizes certain variants of encoding schemes, which need to be selected explicitly on the encoder side. The encoded data, which may be binary, is returned as command result. In the
version , the mode is usually specified without a leading -, but this is not required. The recognized encoding modes are:
<object>) with an embedded data URI encoding of the data argument with an appropriate MIME type and the data encoded in base64 format. This is useful for the generation of HTML pages with images where the images need not to be stored in external files. The encoded data must be a GIF , PNG , JPEG , SVG or PDF image, which is verified by looking at the magical header bytes. PDF input results in an
<object>tag, the other types yield
<img>. This command variant accepts an optional third argument. If it is set, it is used as the content of the “
alt” tag attribute. Example:
This command manages I/O when running an application script as an
) Web application. Only selected interpreters provide this command, for example the standard
and the stand-alone
In addition to providing the
command, these interpreters also register additional pre-opened
Reading from or writing to these channels with the normal
I/O commands directly moves the data to or from the
server communication channels.
argument flag is set (it is on by default), the
channels are redirected to the corresponding
multiplex socket. All normal
I/O commands automatically use the multiplex socket instead of the standard channels if they are referring implicitly or explicitly to the standard channels. In addition, Web-typical properties like
are aware of this redirection and also send their output to the socket in case it is sent to one of the standard channels instead of a disk file. The current redirection status is mirrored in the read-only control variable
The standard output is sent to the remote browser. For normal Web applications, the output is typically
or some image format. Output must be started with a standard
header (but no status code), which ends with an empty line. After that, the HTML or other content is added. Standard error gets sent to the Web server error log. This is simple text. Standard input contains form field data if the
call was from a form page. It can be decoded with the
command. Query data specified as part of the
(after a question mark) can be read from the environment variable
flag is set (it is also set by default), the application automatically exits if the socket communication results in an error or
. The return value is a status code and zero in case a normal communication was initiated. In case automatic exiting is disabled, a negative status code is returned if there is an error.
The process can be terminated by the
Web server module after some time of inactivity, or a fixed count of invocations. In addition, multiple processes with the same script may be started by the module in parallel. In case there is a load balancer, subsequent requests may even be sent to different physical hosts. For these reasons, it is generally not reliable to store global data in the script which should still be available in the next invocation. Instead, internal state like temporary objects should be cleaned up when a request has been executed and data which may be needed in a later processing step offloaded to storage using a lightweight session key or cookie as identifier - typically either to a disk file, or some distributed caching mechanism like
Since FCGI scripts remain running after processing a request, edits to the script file are not immediately recognized. In order to pick up changes, all running interpreter processes with the script must be killed. They are automatically restarted by the FCGI Web server module on the next invocation.
If the redirect flag is set (it is set by default), any existing
redirections to the
socket are canceled. All standard channels as seen by the script interpreter and certain image properties (see description of
command) are reconnected to their original streams. The current redirection status is mirrored in the read-only control variable
This command is the same as the standard
command, except that it operates on the
equivalents of the
communication model. In case a channel is specified, only
are possible argument values. The command is primarily useful in case the automatic redirection feature of the
command was not used. Output is only possible after the invocation of an
command and before the issue of a closing
This command reads the
is encountered and returns the data as a byte vector. In case
redirection is active, the standard
command can be used as an equivalent.
This command may be used to explicitly invoke or cancel the redirection of the standard
equivalents. In case no boolean redirection argument is given, the current redirection status is reported. In case a new status is set, the command returns the previous status. The current redirection status is also mirrored in the read-only control variable
This code snippet shows a typical main loop in an FCGI application. Standard I/O redirection is used for convenience, and in case there are any communication errors with the Web server, or shutdown instructions, like closing of the stdin channel, are received from the server, the application exists. If the application scripts exits, it is (in a typical set-up, this depends on the Web server configuration) be restarted by the Web server at a later time when the next request comes in.
fetch ?-agent agent? ?-cookie cookie? ?-cookielist cookielist? ?-csrftoken token? ?-debug 0/1? ?-filename name? ?-header no/yes/exclusive? ?-modified time_in_secs? ?-password password? ?-referer referer? ?-setcookie cookie? ?-timeout nsecs? ?-tofile 0/1? ?-user username? ?-verification 0/1? ?-xheader1 header? ?-xheader2 header? ?-xheader3 header? url ?statusvar?
fetch(url=,?statusvariable=?,?agent=?,?cookie=?,?cookielist=?,?csrftoken=? ?filename=?,?header=?,?modified=?,?password=?,?referer=?,?setcookie=?, ?timeout=?,?tofile=?,?user=?,?verification=?,?xheader1=?,?xheader2=?, ?xheader3=?)
This command is used to retrieved data from network locations identified by URL s. The default action is to fetch the data and return is as uninterpreted byte data, but without protocol header information. The following options can be used to modify the command action:
name=valueformat) cookie specifications, which are sent as a bundled collection.
If a status variable parameter is specified, it is interpreted as the name of a Tcl array variable or Python dictionary which is created if necessary, reset and filled with status information. Its elements are size (the download data size, without header), lastmodified (the remote file modification date), location (the last download URL , which can be different from the original retrieval URL in case of redirects), mimetype (the Mime type of the data, as perceived by the remote server), various cookie data variants (see below) and finally status for the integer return status code.
The elements for the cookie data element encoding variants are named
(a list/tuple of all received cookies in Netscape format),
(the same as list/tuple of dictionaries, with dictionary keys identifying the cookie field data components), and individual per-cookie elements
cookie%d and cookiedict%d,
where the placeholder is the cookie index starting with zero. The Netscape cookie format is a tab-separated string of six elements encoding the cookie domain, its domain access flag, the path, secure access flag, expiration date, cookie name and value. Splitting these strings to access individual data items should be done explicitly on the tab character since implicit list conversion is not reliable for this encoding. In the dictionary list and individual cookie dictionary encoding variants, the dictionaries contain the same information properly isolated under the keys
. The individual cookie strings are simplified data representations pre-formatted in the style
(the latter only if an explicitly path was specified) which is usually the proper form to use when constructing a custom
header with a
If the program is run in -header exclusive mode, the command result is a list of the status variable values size , lastmodified , mimetype , code , location and cookies , in the order listed, instead of the fetched data.
The modification time as well as cookie expiration dates in the status are returned as an integer (seconds since midnight, Jan 1
), suitable for formatting by means of the standard
command. If a modification or expiration date could not be determined, the reported time value is minus one.
This command is used to check formats and attributes of files. The result is either boolean 1, if the file is of the checked type, or 0 if it is not. In case of errors, such as a non-existing file, a standard error condition is raised. These file type checks are currently supported:
These tests operate by examining the first bytes of a file, not by a simple match of suffixes. File checks which rely on platform-specific binary data layout information only work for the current platform. On a Sun, a OSX bundle will not be recognized, and vice versa.
A boolean test to determine whether the test point is on the inside of the polygon defined by the points
.. The first and last points of the polygon are assumed to be connected, so one should not supply a start and end point duplicate. The minimum polygon size is three points, and there is no upper limit. The point encoding is determined by the number of arguments (2,3, or more).
Delete elements from a list. The first optional parameter selects the match mode for the patterns. If can be one of - exact , - nocase , - substring , - regexp , - glob or - index . The standard option list terminator “--” may also be used. The default mode is exact . The index mode expects element indices starting with 0 as pattern arguments.
This command is not directly supported in the Python interface - the function can easily be implemented with standard list comprehensions (see for example https://stackoverflow.com/questions/20349125/removing-a-pattern-from-a-list-items-in-python)
The mode flags may be any combination of -
and the option terminator “--”. The default mode is the combination of
, the same as for the standard
Just as the standard command, matching list indices are returned. In mode first, which corresponds to the default behavior, the result is the list index >= 0 of the first matching element, or -1 if the pattern cannot be found. In mode all, a list of the indices of all matching list elements is returned, or an empty list if no element matches.
Delete elements from a list variable. The first optional parameter selects the match mode for the patterns. If can be one of - exact , - nocase , - substring , - regexp , - glob or - index . The standard option list terminator “--” may also be used. The default mode is exact . The index mode expects element indices starting with 0 as pattern arguments.
mail ?-attachment filename? ?-debug 0/1? ?-file filename? ?-from address? ?-secure 0/1? ?-smtphost hostname? ?-smptpassword password? ?-stmpport port? ?-smptuser userid? addresslist ?subject? ?message?
Send a simple iso-encoded plain-text email message to one or more recipients. The only required argument is the recipient email address list. Without subject and body arguments, an empty message is sent. If the recipient address list is an empty list, or only contains empty elements, the command silently does nothing. Address list elements which are not empty strings and ignored must pass a simple email address pattern test before a mail delivery attempt is made.
arguments specify the access parameters to the mail host. If these options are not set, they are read from the corresponding control variable elements, i.e.
, etc. If the -
option is set, an attempt is made to use encrypted
communication instead of the plain
protocol, though the initial protocol negotiation still uses plain
port is not explicitly set to 465. In absence of an -
argument, the sender address is copied from
. There is no required relationship between the
address and the mail host access parameters. The default
port used by this command is 587, not the old standard 25.
Experience teaches that talking to mail servers can be tricky. When the - debug option is set, trace output from the communication attempts is printed on standard error. This is highly useful to pinpoint connection problems.
Finally, the - file option allows the direct upload of an existing, readable file as the message. The file contents are sent as message data, not as an attachment. If both an upload file and a body argument are specified, the file is inserted first.
The message content is sent as plain Latin1 (ISO8859-1) encoded message. The nature of line-break characters in the message is not preserved, and additional line breaks are inserted if any line is longer than 998 characters, the maximum line length in a standard smtp message.
This command currently neither supports pop-before-smtp authorization, nor the sending of attachments, though they are accepted as arguments. In the Tcl command version, multiple attachments are specified by repeating the -attachment command. In Python , an attachment file name tuple is expected, because named function arguments cannot be repeated.
The argument order of the Python command is intentionally different to allow sending of messages without setting more exotic options. All arguments after the first three must be specified as named arguments.
Return the standard opener/viewer for files of the specified MIME type. The result is dependent of the local configuration.On Windows, the command attempts to find a suitable opener in the registry, and if it is found, the return value usually contains Windows-specific placeholder tags.
This command checks whether the argument can be parsed as the data type indicated. The result is a boolean value. No error is raised if the parsing fails, and the parsed data structure is discarded. The following data types are currently understood:
DOI(digital object identifier).
ens createwithout any extra flags.
molfile scanand other scan commands, in native toolkit notation. This excludes queries in the Lilly format.
molfile scanand other scan commands. Both the native toolkit style and the Bruns/Watson Lilly notation are recognized.
molfile scanand other scan commands.
molfile scanand other scan commands.
The first command variant encodes a clear-text password with the standard Unix
algorithm. A salt value for the password generation may be specified as exactly two letters from the set “a-zA-Z0-9./”. If no salt is specified, a random value is used. The command returns the encoded version of the clear text.
returns 1. Note that without the specification of a salt parameter the encoded result is different each time in a random fashion. However, the password check works without knowing the salt with encrypted passwords encoded with each possible salt.
post ?-agent agent? ?-boundary text? ?-cookie cookietext? ?-contenttype mimetype? ?-cookie cookietext? ?-csrftoken token? ?-debug 0/1? ?-fieldcontenttype type? ?-host hostname? ?-language languagecode? ?-password pwd? ?-raw? ?-referer referer? ?-setcookie cookie? ?-timeout secs? ?-uploads uploaddictionary? ?-user username? ?-verifyhost 0/1 ?-xheader1 headerline? ?-xheader2 headerline? ?-xheader3 headerline? url ?fielddictionary/rawdata? ?statusvariable?
post(url=,?data=?,?agent=?,?boundary=?,?cookie=?,?contenttype=?, ?csrftoken=?,?debug=?,?fieldcontenttype=?,?host=?,?languate=?, ?password=?,?raw=?,?referer=?,?setcookie=?,?timeout=?,?uploads=?,?user=?, ?verifyhost=?,?xheader1=?,?xheader2=?,?xheader3=?,?statusvariable=?)
In the standard command mode, the field dictionary parameter is a list of field names and their contents to include in the POST message. The transfer format is binary, so it is possible to send byte array data. The default individual field mime format is text/plain , but PNG and GIF images as field data are automatically recognized and sent as image/png and image/gif, respectively. In order to mirror the data encoding characteristics of file upload HTML form elements faithfully, an optional uploads dictionary can be provided. It is a key/value collection where the keys are field names that are file upload elements in the emulated Web form. They also need to be contained in the field dictionary as field name / field data pair. Field names only present in the uploads directory are ignored. The upload dictionary values are the filename attribute of the transmitted fields. The encoding of transmitted data for fields in this dictionary is modified so that the content type is always set to application/octet-stream instead of text/plain . Whether the configuration of the upload dictionary is required or not when emulating the submission of forms with upload fields depends on the extent of the data analysis performed on the side of the contacted server, but its use does not potentially introduce new problems. File contents are not automatically opened and read. Their contents must be provided in the field dictionary.
If the - raw flag is set, no interpretation of the field dictionary parameter takes place. Instead, the value of this parameter is transmitted verbatim as byte sequence in the message body. In this mode, it is assumed that it already contains all field formatting and only needs to be augmented with the HTTP header data. The Tcl version of the command uses this flag as a stand-alone parameter, while in the Python version it requires a boolean value specification.
The other optional parameters allow the setting of additional fields in the header of the
attribute is the
separator string. Its default value is a random string that is highly unlikely to occur in any transmitted data. The default content type for the form submission is
, but this may be adjusted with the -
parameter. The short argument forms
select the standard encodings
. Other values of this option are sent verbatim to the server after a
keyword. The additional attributes of file upload fields are ignored in
The argument of the - language option is passed to the Accept-Language: HTTP header field. By default the Host: HTTP header is extracted from the destination URL , but a custom value can be set with the - host option. The - xheader parameters allow the injection of custom lines into the HTTP header. The line data should be provided without linefeeds, and must contain the header field name. The - csrftoken option simplifies the handling of CSRF tokens. A token specified here is added to the HTTP header in a X-CSRF-Token: header line.
Field content is normally posted with a “
” type header, except for data which is recognized to be in another well-known format (like
images), where the proper standard type is substituted. The
attribute can be used to override this default typing. If it is set to an empty string (or Python
), the fields are posted without type information. Individual typing of fields is currently not supported.
option is set to
, and the connection uses SSL encryption, the remote host identity is not rigorously checked against its SSL certificate. This allows interaction with hosts which used mis-configured SSL certificates, but this lenient approach is obviously a potential security issue and should only be used when necessary. The other parameters have the same meaning as in the related
If the name of a status variable is specified, it is created or reset in the local namespace, and filled with the elements
server error code, 200 for normal retrieval), size (the length of the received content in bytes),
(a list of all cookies received in Netscape string format),
(a list of cookies in dictionary form),
, which can be different from the command argument in case of server redirection),
(the modification time stamp of the result data, if available, -1 otherwise) and
type of the response). In addition, every cookie is individually stored as element
, starting with index zero and with the seven elements
that are contained in the standard
cookie encoding. The variable element names are compatible to those used in the
It is possible to omit the field dictionary argument if an empty message is to be sent. The URL may also contain field arguments in URL encoding, but whether these are recognized in addition to the data in the field dictionary depends on the destination server configuration.
set data [post -contenttype urlencoded -cookie $c -debug 0 \
-csrftoken [dict get $dcsrf value] \
-referer https://mcule.com/search/ \
[dict create csrfmiddlewaretoken [dict get $dcsrf value] mode exact structure_2 $mdata
command or expression from
. This command is only available in interpreters which include a
subsystem. This command is not supported in
, but on that side, comparable
For the eval variant, only a single statement may be processed, and the result of that statement is returned to Tcl . Longer statement blocks can be processed with the exec command variant, but in that case the result is always an empty string if no error occurs. This is a limitation of the Python API . In case an error is raised, its description is transferred back as Tcl result string, and the command also reports an error.
At this time, only a single primary Python interpreter exists in Python -enabled toolkit applications. It is mutex-protected and can be called from multiple Tcl threads, but not simultaneously. Property computation Python sub-interpreters are internally used, but not accessible via this command.
interpreter in the standard toolkit context (but not when loaded as
module) has already imported the
functions and other objects are explicitly imported and can by used without a module prefix. The
functions allow scripts to double back and execute a
command in the main
interpreter from within
The last example executes a command in the
interpreter, which itself turns back to the
interpreter to execute an
statement. Toolkit objects are shared between the
interpreters. The newly created ensemble object is known and accessible in both languages simultaneously.
Perform an efficient string quoting operation of a Latin1 string. The result is a string which contains only 7-bit printable characters. Characters outside this range are encoded as backslash-encoded octets or standard backslash escape sequences such as ’\t’ or ’\\’. The code for this command was copied from the Tcl Netscape plug-in.
Generate integer pseudo-random numbers. In the simplest command variant, the limitval parameter is an upper exclusive bound. The returned pseudo-random number is in the range 0 to limit-1 . By default, only a single number is returned. If a non-empty sequencesize parameter is added, the specified number of pseudo-random numbers is returned as a list. If the third optional parameter is the string reset , the random number generator is reset to its default start state. Alternatively, a numerical seed value can is used to initialize it to a different initial state before computing the random numbers..The random numbers are always the same sequence for a given initial state. If this is not desired, some pseudo-random seed, such as the current clock click value, should be used.
command variants can be used to manipulate the state without starting the random number generation. The
subcommand without a seed argument uses a combination of a high-resolution timer and the process ID as seed value and is the recommended method to set up the generator for non-repeatable randomness.
variants directly return hex string encodings of 32, 64 or 128 bit integers, which possess fixed string lengths of 8, 16 and 32 characters, respectively. Optionally, this operation again can be combined with a reset operation or a seed value.
This command is thread-aware. Every script thread has its own random state, and random number generation or state manipulation in one thread has no effect on any other interpreter thread. The
subcommand is the sole exception - it is not thread-aware, and not coupled to the thread-local random state of the other commands.
screen ?-aromatch lenient|normal|strict? ?-frags? ?-hydrogens ignore|match|mark? ?-mode ligands|smarts? ?-nobondorder? ?-tauto? ehandle patternlist ?exactmatchvar?
Perform fragment-based bit screening on an ensemble object. If the - frags option is not set, he result is a bit vector of the same length as the pattern list, with bits set to zero or one depending on whether a pattern fragment matches or not. If - frags option is set, the return value is a list of the patterns which match, copied verbatim from the pattern list argument.
If the optional exact match variable parameter is given, it is the name of a Tcl or Python variable which is set to one if the input ensemble is of exactly the same connectivity (without stereochemistry or isotopes) as one of the pattern fragments. If no pattern is an exact match, it is set to zero.
The expected format of the pattern list depends on the match mode. The default match mode is ligands , which can be explicitly set by supplying the argument to - mode . The other possible match mode is smarts , set by -mode smarts .
In smarts mode, the patterns are normal SMARTS strings. These are cached internally, so if patterns are reused, and the total number of patterns is not too large for the cache, they are not decoded anew for every command invocation.
In ligands mode, a simpler pattern language which is faster to decode and match is used. The patterns are either two element symbols, connected by a bond symbol (- for single bond, = for double, * for triple, # for quadruple, ~ for aromatic - note that this is different from SMILES !), or an element, followed by a sequence of bracketed ligands, each with a preceding bond symbol. Patterns like these describe one central atom (the first element in the pattern), with one or more ligands. Examples are “P=O” or “C(-Cl)(=O)” or “C(-H)(~C)(~C)” . For internal reasons, all multiple bonds in a pattern must be written before any aromatic bond.
The - aro option controls how aromatic systems in the ensemble are matched. The default is normal , meaning that single and double bonds in SMARTS patterns match aromatic bonds in the ensemble, regardless of their Kekulé bond order, and single bonds in ligands patterns match aromatic ensemble bonds. In strict mode, non-aromatic bonds in the pattern do not match aromatic ensemble bonds. This mode has an effect only for smarts matching, not ligand matching. The aro match mode lenient only has an effect on matching ligand patterns. If not selected, ligand pattern double bonds do not match aromatic ensemble bonds. If the mode is lenient , they do.
If the - tauto flag is set, the matching of both ligand and SMARTS patterns is further modified. In ligands mode, tautomeric ensemble bonds (as per property B_ISTAUTOMERIC ) are excluded from any match which requires an exact bond order match. In smarts mode, the matched fragment must be compatible with a tautomeric form with shifted bond orders and relocated hydrogen atoms. This flag is intended to be used to construct a screening bit string for tautomer-tolerant substructure searches. Because less patterns can be positively identified to be matching under these circumstances, these bit strings have generally less bits set, and are therefore less effective filters.
The - hydrogen option controls how patterns with hydrogen atoms are handled. By default, in mode match , they are matched like any other pattern. In mode ignore , patterns with hydrogen never match. This is the mode to use if a screen vector for superstructure search is constructed. In mode mark , any pattern which contains a hydrogen atom reports a match, and any pattern which does not a mismatch. This mode is intended to be used for construction of bit masks for the removal of any bits from a screen vector which are hydrogen-dependent. This allows for example the re-use of a substructure screen vector for superstructure search.
The Python version of the command intentionally has a different argument order than the Tcl version. Additionally, single-word arguments in the Tcl version must be specified as named arguments with a boolean value. All parameters after the pattern set must be passed as named arguments.
Generate a valid name for a temporary file. The file name prefix, the suffix as well as the directory may be specified. If these parameters are omitted, or set to empty strings (including
) a temporary file in the standard tmp directory and with a file name prefix derived from the application name (obtained via invoking the command
in the current
interpreter, where the standard
features to configure its results apply) is generated.
This command decodes CGI data, as it is delivered to a CGI application from data input in a WWW form via the Web server. It automatically recognizes the two standard transfer formats application/x-www-form-urlencoded and multipart/form-data and adjusts the decoding process accordingly.
input data can be obtained either from the
environment variable (
forms, or direct
s), or from reading the
forms). A typical code snippet in case the data submission method is not known is:
The return value of this command is a dictionary with name/value pairs. This dictionary can be read into an array variable by the standard
command. If the optional
parameter is used, an array variable of that name is automatically created or reset and filled with the decoded data in the form of array elements.
By default, leading and trailing white space is removed from the decoded data. Fields for which this white space removal should not be performed can be listed as a standard Tcl list in the untrimmedfields parameter. These fields are decoded without any processing.
Note that it is generally advisable to set the stdin input channel to binary mode before reading the CGI data. On Unix, this is likely to be a no-op, but the transfer of binary data on Windows usually does not work at all without this setting.
For security reasons, certain
-style tags, including their inner text if they possess it, are automatically removed from the input data. The currently deleted tag list is
. This tag deletion cannot be suppressed.
Data of type multipart/form may transfer additional parameter attributes for the data together with the actual content. In case of file uploads from Web forms, the original client-side file name is captured in an additional result element named by appending “_filename” to the basic data field name. The MIME type of the data, if transmitted, is similarly stored in an extra element with the appended name part “_type”.
In case a field name is occurring more than once in a data string, the additional instances are appended to the first instance as list elements. The final content of the decoded field is then a list of all values found in the input.
If an output variable parameter is used, all existing array elements are removed before decoding starts. In case results should be accumulated, the - noreset option can be used to suppress the variable reset step.
After the parameter listing fields not to be trimmed an arbitrarily long list of pairs of field names and their default values can be specified. If a field name listed there was not present in the input data, it is set in the result list and array variable with the default value following the field name.
The structure of the arguments is intentionally different in the Python version of the command. All arguments after the CGI data must be passed as named arguments. The noreset option requires a boolean argument value. Instead of an open argument set for field names and their default after the standard arguments a dictionary with field names as key and defaults as values is used.
Extract a list of indexed elements from a nested list. From each element of the nested input list, the element indicated by the index parameter is selected and appended to the result list. If the index parameter is omitted, the default is zero. If a selected list element does not exist, an empty string is substituted.
Upload a file to a remote destination. The first argument is a path to a local, readable file. The second argument is an
which indicates the transfer protocol and the remote location. The optional final argument is e
type specification which is transferred to the remote host in addition to the file content. If it is not specified, the type is implicitly
ftpStandard or secure file transfer protocol. The URL follows the standard schema
s3://bucket/?path/?filenameAdditionally, the URL query parameters secret, key, acl and region are recognized. If the AWS parameters are not specified in the URL , the values are taken from
The ACL can be any of private , public-read, public-read-write , authenticated-read , aws-exec-read , bucket-owner-read , bucket-owner-full-control or log-delivery-write (see AWS documentation). The default is private. The available AWS regions are frequently updated, please refer to the AWS documentation. The specified value is not checked on the client side.
This command provides a couple of useful 3D vector and point manipulation commands. In the Tcl case, the points and vectors are internally standard Tcl list objects with floating point elements, so operations are not blazingly fast but still reasonably effective for routine vector arithmetic. Vectors are not toolkit objects, there is nothing to destroy when they are no longer needed. In the Python implementation, there is a custom point/vector object which holds a triple of floating-point values.
Create a point or vector and return its fully expanded numerical representation. If only one argument is given, any of the standard representations is accepted. In case three arguments are provided, they are internally concatenated and this list submitted to the decoding procedure. The command result, if the arguments could be decoded, is the numerical vector representation. The vector commands generally understand both resolved vectors, and the short forms which can be decoded by this command, to in many cases, explicit syntax resolution is not required.
Add two or more vectors. The return value is the vector sum. Subcommand aliases are
implementation provides both class and object methods. Additionally, the
numerical operators are overloaded.
Add two or more vectors. The return value is the vector sum. Subcommand aliases are
implementation provides both class and object methods. Additionally, the
numerical operators are overloaded.
If only a single argument is specified, interpret the argument as vector and compute its length. In case multiple arguments are used, compute the length of the straight, acyclic path between the points.
Return a list of the distances between point one and two, two and three, and so on. For two arguments, the result is the same as using
, but if there are additional points, the individual distances between the waypoints are returned as a list instead of the total length of the path.
Compute the vector cross product of the two passed vectors. The return value is the cross product vector. The subcommand may be abbreviated as
, and additionally
are subcommand aliases. In Python, the
multiplication sign is overloaded with this function.
Compute the distance between a point (coordinates in first argument) and a plane in 3D space (specified in Hesse form, i.e. smallest distance of any point on the plane to the origin and plane normal vector).
Merge one or more lists. The result is a nested list where each element is a sequence of input list elements at the corresponding position. The size of the largest input list determines the output. If any input lists are shorter than another input list, empty elements (
) are substituted.