Endonuclease PvuII (1PVI) DNA - GATTACAGATTACA
CAP - Catabolite gene Activating Protein (1BER)
DNA - GATTACAGATTACAGATTACA Endonuclease PvuII bound to palindromic DNA recognition site CAGCTG (1PVI) DNA - GATTACAGATTACAGATTACA TBP - TATA box Binding Protein (1C9B)
CAP - Catabolite gene Activating Protein (1BER)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
TBP - TATA box Binding Protein (1C9B)
 

° 

Yanaconda supports the usual operators

Most programming languages share a common set of operators. Some differences become apparent if you use multiple operators in one expression without explicitly ordering them using parentheses. Then evaluation order depends on the predefined operator priority. The operators you can use in Yanaconda are listed in the following sections. Operators of the same priority are evaluated from left to right.

° 

The negation operator has the maximum priority 7: !, not

This operator switches true (anything except 0) to false (0) and vice versa. You can use '!' or 'not', whichever you prefer.


a = 3
b = 0

Print (!a)
0
Print (not b)
1

° 

Operators with priority 6: *, /, //, %, <<, >>

Here are some examples for the six operators with the second highest priority. Note that the modulo operator '%' requires an integer on the left side. The '//' operator is mainly known to Python programmers, it is a division with truncation of the result's fractional part. The normal division operator '/' rounds the result to the closest integer if the requested result data type is an integer.


a = 2
b = 3.

Print (a*b)
6
Print (b*a)
6.0000000000e0
Print (a/b)
1
Print (a//b)
0
Print (b/a)
1.5000000000e0
Print (a%b)
2
Print (b%a)
Error - unsupported operator

The '//' operator is additionally helpful to truncate floating point numbers without rounding:


a=1.7
Print (a//1)
1.0

The shift operators '<<' and '>>' do bitwise binary shifts to the left or right, they require an integer on the left side. A left shift corresponds to a multiplication with 2, a right shift to a division by 2. That's why they have the same priority as '*' and '/'.


a = 2
b = 3.000

Print (a<<1)
4
Print (a<<b)
16
Print (a>>1)
1
Print (b>>a)
Error - unsupported operator

° 

Operators with priority 5: +, -


a = 2
b = 3.000

Print (a+b)
5
Print (b+a)
5.000

° 

Operators with priority 4: &, |, ^

These operators do a bitwise 'and', 'or' and 'xor', there must be an integer on the left side. They are rarely if ever needed in Yanaconda. Unlike in the C programming language, their priority is higher than the comparisons, just like in Python.

° 

Operators with priority 3: >, >=, <=, <, ==, !=

All comparison operators have the third lowest priority. They return 1 if the comparison is true, 0 otherwise. Note that '!=' stands for 'is not equal to'.


a = 2
b = 3.000

Print (a>b)
0
Print (a<b)
1
Print (a==b)
0
Print (a!=b)
1

° 

Operators with priority 2: in

The 'in' operator determines if a variable is in a list:


anglelist='Alpha','Beta','Gamma'
angle='Beta'
if angle in anglelist
  Print 'Yes'

Yes

° 

Operators with minimum priority 1: and, or

Logical operators are used most of the time in if/else statements to combine the results of comparisons.


a = 2
b = 3

if a==1 or b==3
  Print "Hello World!"

Hello World!