If not otherwise mentioned every command creates one
output stream for each input stream.
STREAM HANDLING
-
echo(x1;x2;x3...) creates an output stream for each
parameter 'x' and writes 'x' onto it.
-
"text" == echo("text")
-
dd copies all input streams to output streams
-
cut(N1,N2,N3) copies the Nth input stream(s)
-
drop(N1,N2) copies all but the Nth input stream(s)
-
dropempty drops all empty input streams
-
dropzero drops all non-numeric or zero input streams
-
swap(N1,N2) swaps two input streams
(w/o parameters: swaps last two streams)
-
toback(X) moves the Xth input stream
to the end of output streams
-
tofront(X) moves the Xth input stream
to the start of output streams
-
merge([sep]) merges all input streams into one output stream.
If 'sep' is specified, it's inserted between them.
If no input streams are given, it returns 1 empty
input stream.
-
split([sep[,mode]]) splits all input streams at separator string 'sep'
(default: split at linefeed).
-
streams returns the number of input streams
STRING
-
head(n) the first n characters
left(n) the first n characters
-
tail(n) the last n characters
right(n) the last n characters
-
len the length of the input
-
len("chr") the length of the input excluding the
characters in 'chr'
-
mid(x,y) the string from x to y
y < 0 means a position relative to the
end
-
crop("str") removes characters of 'str' from
both ends of the input
-
remove("str"); removes all characters of 'str'
e.g. remove(" ") removes all blanks
-
keep("str"); the opposite of remove:
remove all chars that are not a member
of 'str'
-
srt("orig=dest",...) replace command, invokes SRT
(see ´Search and Replace Tool (SRT)´)
-
translate("old","new"[,"other"])
-
translates all characters from input that occur in the
first argument ("old") by the corresponding character of the
second argument ("new").
-
An optional third argument (one character only) means:
replace all other characters with the third argument.
-
Example:
Input: "--AabBCcxXy--"
translate("abc-","xyz-") "--AxyBCzxXy--"
translate("abc-","xyz-",".") "--.xy..z...--"
-
This can be used to replace illegal characters from sequence date
(see predefined expressions in 'Modify fields of listed species').
-
tab(n) append n-len(input) spaces
-
pretab(n) prepend n-len(input) spaces
-
upper converts string to upper case
lower converts string to lower case
caps capitalizes string
-
format(options)
takes a long string and breaks it into several lines
option (default) description
==========================================================
width=# (50) line width
firsttab=# (10) first line left indent
tab=# (10) left indent (not first line)
"nl=chrs" (" ") list of characters that specify
a possibly point of a line break;
This character is deleted !
"forcenl=chrs" ("\n") Force a newline at these characters.
-
extract_words("chars",val)
Search for all words (seperated by ',' ';' ':' ' ' or 'tab') that
contain more characters of type chars than val, sort them
alphabetically and write them seperated by ' ' to the output
STRING COMPARATION
-
compare(a,b) return -1 if a<b, 0 if a=b, 1 if a>b
equals(a,b) return 1 if a=b, 0 otherwise
contains(a,b) if a contains b, this returns the position of
b inside a (1..N) and 0 otherwise.
partof(a,b) if a is part of b, this returns the position of
a inside b (1..N) and 0 otherwise.
-
The above functions are binary operators (see below).
For each of them a case-insensitive alternative exists (icompare, iequals, ...).
CALCULATOR
BINARY OPERATORS
CONDITIONAL
select(a,b,c,...) each input stream is converted into a number
(non-numeric text converts to zero). That number is
used to select one of the given arguments:
0 selects 'a',
1 selects 'b',
2 selects 'c' and so on.
The selected argument is interpreted as ACI command
and is applied to an empty input stream.
DEBUGGING
trace(onoff) toggle tracing of ACI actions to standard output.
Start arb from a terminal to see the output.
Parameter: 0 or 1 (switch off or on)
All streams are copied (like 'dd').
DATABASE AND SEQUENCE
-
readdb(field_name) the contents of the field 'field_name'
-
sequence the sequence in the current alignment.
-
Note: older ARB versions returned 'no sequence'
if the current alignment contained no sequence.
Now it returns an empty string.
-
For genes it returns only the corresponding part
of the sequence. If the field complement = 1 then the
result is the reverse-complement.
-
sequence_type the default sequence's type(rna/dna..)
sequence_name the default sequence name(ali_16s,..)
-
Note: The commands above only work at the beginning of the ACI expression.
-
checksum(options) calculates a CRC checksum
options:
"exclude=chrs" remove 'chrs' before calculation
"toupper" make everything uppercase first
-
gcgchecksum a gcg compatible checksum
-
format_sequence(options)
-
filter(options)
exclude=# characters in filter sequence which exclude the coloumn or
include=# vice versa
SAI=# SAI of filter sequence or
species= species of filter sequence
-
diff(options)
show differences to default alignment of another species
SAI=#
species=#
[equal=.]
-
extract_sequence("chars",rel_len)
like extract_words, but do not sort words, but rel_len is the minimum
percantage of characters of a word that mach a character in 'chars'
before word is taken. All words will be seperated by white space.
-
taxonomy([treename,] depth)
-
Returns the taxonomy of the current species or group as defined by a tree.
-
If 'treename' is specified, its used as tree, otherwise the 'default tree'
is used (which in most cases is the tree displayed in the ARB_NT main window).
-
'depth' specifies how many "levels" of the taxonomy are used.
SPECIALS
-
exec(command,var1,...)
Execute external (unix) command
WARNING !!!!!! You should not use this command for NDS !!!
because any slow command will disable all editing -> You never
can remove this command from the NDS. Even arb_panic will not
easily help you.
-
command(escapedCommand)
-
applies 'escapedCommand' to all input streams using
-
In escapedCommand you have to escape '\' and '"' by
preceeding a '\'. If you nest calls you have to use multiple escapes
(e.g. inside an export filter - which is in fact an
SRT expression - you'll have to use double escapes).
-
eval(escapedCommand)
-
the 'escapedCommand' is evaluated (using an empty string as input)
and the result is interpreted as command and gets applied to all
input streams.
-
Example: Said you have two numeric positions stored in database fields
'pos1' and 'pos2' for each species. Then the following command
extracts the sequence data from pos1 to pos2:
-
sequence|eval(" \"mid(\";readdb(pos1);\";\";readdb(pos2);\")\" ")
-
How the example works:
The argument to eval is the escaped version of the command
'"mid(" ; readdb(pos1) ; ";" ; readdb(pos2) ; ")"'.
If pos1 contains '10' and pos2 contains '20' that command
evaluates to 'mid(10;20)'.
The resulting ACI for the example species
is 'sequence|eval("mid(10;20)")' which is equivalent
to 'sequence|mid(10;20)'.
-
define(name,escapedCommand)
defines a ACI-macro 'name'. 'escapedCommand' contains an escaped
ACI command sequence. This command sequence can be executed with
do(name).
-
do(name)
-
applies a previously defined ACI-macro to all input streams (see 'define').
-
'define' followed by 'do' works similar to 'command'.
See embl.eft for an example using define and 'do'
-
origin_organism(escapedCommand)
origin_gene(escapedCommand)
-
like command() but readdb() etc. reads all data from the
origin organism/gene of a gene-species (not from the gene-species itself).
-
This function applies only to gene-species!
|