Technical Documentation
Utilities: Linear Sequences

The LinSeq module provides utilities for linear sequences. Linear sequences are chain of atoms where each atom is connected to no more than two others. The chain is unbranched but the ends of the chain may be joined to create a closed circle.

The LinSeq module is located in Yup.Tools. Thus, the required import statement is some variant of: from Yup.Tools.LinSeq import *.

The functions are:

parseq()

Parse the specification for a sequence

addforcefield()

Add the components of a force field

genline()

Generate a random linear path, predominantly along the x-axis

gencirc()

Generate a random circular path, predominantly in the xy-plane


The parseq function parses a sequence specification and returns a list of sequence type and the repeat count.

Method Name
Number of Arguments
Return Value
parseq
2
Tuple of tuple
Argument
Type
Preset Value
sequence
string
-
legal
string
-

The sequence parameter must be a string and it may be of two forms. It may contain only a number. This is then taken to be the length of a homogeneous sequence with the type taken to be zero. Otherwise, sequence must start with a letter and may contain only digits and the letters in legal. This is taken to be the sequence of a heterogeneous chain. Each letter that appears corresponds to a letter in legal and the type is taken to be the position in legal. If a number appears after the sequence letter, it is taken as the repeat count. For example:

sequence
legal
Return Value
'C500A250T'
'ATCG'
[ ( 3, 500 ), ( 1, 250 ), ( 2, 1 ) ]
'001000'
(anything)
[ ( 0, 1000 ), ]

The addforcefield() function registers force field interactions.

Method Name
Number of Arguments
Return Value
addforcefield
8
None
Argument
Type
Preset Value
atoms
list of atom AtomMaps
-
pe2
Bonds object
None
pe3
Angles object
None
pe4
Torsions or Impropers object
None
pex
SoftSphereI, SoftSphereX, VanderWaalsI or VanderWaalsX object
None
xcl
list
[]
lud
list
[]
skp
list
[]
closed
integer: 0 or 1
0

The atoms argument holds an ordered list of atoms. This function will link the atoms using the desired terms of the force field. if the pe2 argument is specified consecutive pairs of atoms will be registered in the Bonds object. If pe3 is specified, it is assumed to be a three-atom interaction Energy object. Consecutive triplets of atoms are registered in the pe3 object. With pe4, four consecutive atoms are registered and pe4 is assumed to be a four-atom interaction. If pex is specified it has to be one of four nonbond terms. If an Exclusion type term, for each atom and tracing through the chain of bonds, atoms that are separated by xcl or fewer atoms are excluded from the interaction. If an Inclusion type term, for a given atom, the closest interaction is separated by xcl bonds; thereafter every consecutive atom separated by skp bonds is added. If closed has a value other than 0, the ends of the chain are closed to form a closed circle.


The genline() function generates and returns a path

Method Name
Number of Arguments
Return Value
genline
numerous
List

The


The gencirc() function generates and returns a random circular path, predominantly in the xy-plane. The path is returned as a tuple of tuples.

Method Name
Number of Arguments
Return Value
gencirc
4
Tuple of tuple
Argument
Type
Preset Value
length
integer
-
dimen
integer
3
distave
float
1.0
diststd
float
0.01

The length argument specifies the number of points in the path and the dimen argument specifies the number of dimensions (3 if not specified). The generated path lies mostly in the xy-plane centered on (0,0,...). Each point is spaced on average distave from the other two closest bonded atoms. Then each point is given a random displacement in all dimensions with the displacement taken from a Gaussian distribution with a standard deviation of diststd.


Technical
Introduction
Directory
Vectors
Energy
Model
Assembly
Methods
FPF
FFF
AVF
TaroScript
YammpScript
Python
Utilities

Home
Information
News
User
Technical
Programmer
iYup
Download
Showcase
ETC