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 (separated by ',' ';' ':' ' ' or 'tab') that
contain more characters of type chars than val, sort them
alphabetically and write them separated by ' ' to the output
STRING COMPARISON
-
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)
-
extract_sequence("chars",rel_len)
like extract_words, but do not sort words, but rel_len is the minimum
percentage of characters of a word that mach a character in 'chars'
before word is taken. All words will be separated 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.
FILTERING
-
There are several functions to filter sequential data:
-
All these functions use the following COMMON OPTIONS to define
what is used as filter sequence:
-
species=name
-
Use species 'name' as filter.
-
SAI=name
-
Use SAI 'name' as filter.
-
first=1
-
Use 1st input stream as filter for all other input streams.
-
pairwise=1
-
Use 1st input stream as filter for 2nd stream,
3rd stream as filter for 4th stream, and so on.
-
align=ali_name
-
Use alignment 'ali_name' instead of current default
alignment (only meaningful together with 'species' or 'SAI').
-
Note: Only one of the parameters 'species', 'SAI', 'first' or 'pairwise' may be used.
-
diff(options)
-
Calculates the difference between the filter (see common options above) and the input stream(s) and
write the result to output stream(s).
-
Additional options:
-
equal=x
-
Character written to output if filter and stream are equal at
a position (defaults to '.'). To copy the stream contents for
equal columns, specify 'equal=' (directly followed by ',' or ')')
-
differ=y
-
Character written to output if filter and stream don't match at one column position.
Default is to copy the character from the stream.
-
filter(options)
-
Filters only specified columns out of the input stream(s). You need to
specify either
-
exclude=xyz
-
to use all columns, where the filter (see common options above) has none
of the characters 'xyz'
-
or
-
include=xyz
-
to use only columns, where the filter has one of the characters 'xyz'
-
All used columns are concatenated and written to the output stream(s).
-
change(options)
-
Randomly modifies the content of columns selected
by the filter (see common options above).
-
The options 'include=xyz' and 'exclude=xyz' work like
with 'filter()', but here they select the columns to modify - all other
columns get copied unmodified.
-
How the selected columns are modified, is specified by the following
parameters:
-
change=percent
-
percentage of changed columns (default: silently change nothing, to make
it more difficult for you to ignore this helpfile)
-
to=xy
-
randomly change to one of the characters 'xy'.
-
Hints:
-
Use 'xyy' to produce 33% 'x' and 66% 'y'
-
Use 'xxxxxxxxxy' to produce 90% 'x' and 10% 'y'
-
Use 'x' to replace all matching columns by 'x'
-
I think the intention for this (long undocumented) command is to easily generate
artificial sequences with different GC-content, in order to test treeing-software.
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
preceding 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!
|