📄 analyze_mode.html
字号:
<html><title>The Analyze File</title><body bgcolor="#FFFFFF" text="#000000" link="#0000AA" alink="#0000FF" vlink="#000044"><h2 align=center>The Analyze File</h2><p>The file "<tt>analyze.cfg</tt>" is used to setup avida when its inanalysis-only mode, which can be done by running "avida -a". It is used toperform additional tests on genotypes after a run has completed.<p>This analysis language is basically a simple programming language. Thestructure of a program involves loading in genotypes in one or more"batches", and then either manipulating single batches, or doing comparisonsbetween batches. Currently there can be up to 300 batches of genotypes, butwe will eventually remove this limit.<p>The rest of this file describes how individual commands work, as wellas some notes on other languages features, like how to use variables. Asa formatting guide, command arguments will be presented between brackets,such as [<font color="#0000AA">filename</font>]. If that argument ismandatory, it will be in blue. If it is optional, it will be in green, and(if relevant) a default value will be listed, such as[<font color="#008800">filename="output.dat"</font>]<p>There are currently four ways to load in genotypes:<p align=center><b>Table 1: <font color="#008800">Genotype Loading Commands</font></b><table cellpadding=6><tr><td><b>LOAD_ORGANISM [<font color="#0000AA">filename</font>]</b><br> Load in a normal single-organism file of the type that is output from avida. These consist of lots of organismal information inside of comments, and then the full genome of the organism with one instruction per line.<tr><td><b>LOAD_BASE_DUMP [<font color="#0000AA">filename</font>]</b><br> Load in a basic dump file from avida. Each line contains a genotype sequence, but little additional information.<tr><td><b>LOAD_DETAIL_DUMP [<font color="#0000AA">filename</font>]</b><br> Load in a detail file. These are similar to the basic dump files, but contain a lot more information on each line. These files are saved from avida typically beginning with the word "detail" or "historic".<tr><td><b>LOAD_SEQUENCE [<font color="#0000AA">sequence</font>]</b><br> Load in a user-provided sequence as the genotype. Avida has a symbol associated with each instruction; this command is simply followed by a sequence of such symbols that is than translated back into a proper genotype.</table><p>A future addition to this list is a command that will use the "dominant.dat"file to identify all of the dominant genotypes from a run, and then lookup andload their individual genomes from the genebank directory. Also, thecommands LOAD_BASE_DUMP and LOAD_DETAIL_DUMP currently require fixed-formatedfiles. New output files from avida have tags listed for their column names,and as such we already have a working prototype of a generic "LOAD" commandthat will figure out the file format and be able to load in all of the dataproperly.<p>All of the load commands place the new genotypes into the "current" batch,which can be set with the "SET_BATCH" command. Below is the list of controlfunctions that allow you to manipulate the batches.<p align=center><b>Table 2: <font color="#008800">Batch Control Commands</font></b><table cellpadding=6><tr><td><b>SET_BATCH [<font color="#0000AA">id</font>]</b><br> Set the batch that is currently active; the initial active batch at the start of a program is 0.<tr><td><b>NAME_BATCH [<font color="#0000AA">name</font>]</b><br> Attach a name to the current batch. Some of the printing methods will print data from multiple batches, and we want the data from each batch to be attached to a meaningful identifier.<tr><td><b>PURGE_BATCH [<font color="#008800">id=current</font>]</b><br> Remove all genotypes in the specified batch (if no argument is given, the current batch is purged.<tr><td><b>DUPLICATE [<font color="#0000AA">id1</font>] [<font color="#008800">id2=current</font>]</b><br> Copy the genotypes from batch id1 into id2. By default, copy id1 into the current batch. Note that duplicate is <i>non-destructive</i> so you should purge the target batch first if you don't want to just add more genotypes to the ones already in that batch.<tr><td><b>STATUS</b><br> Print out (to the screen) the genotype count of each non-empty batch and identify the currently active batch.</table><p>There are several other commands that will allow you to interact with theanalysis mode in some very important ways, but don't actually trigger anyanalysis tests or output. Below are a list of some of the more importantcontrol commands. <p align=center><b>Table 3: <font color="#008800">More Analysis Control Commands</font></b><table cellpadding=6><tr><td><b>VERBOSE </b><br> Toggle verbose/minimal messages. Verbose messages will print all of the details of what is happening to the screen. Minimal messages will only briefly state the process being run. Verbose messages are recommended if you're in interactive mode.<tr><td><b>SYSTEM [<font color="#0000AA">command</font>]</b><br> Run the command listed on the command line. This is particularly useful if you need to unzip files before you can use them, or if you want to delete files no longer in use.<tr><td><b>INCLUDE [<font color="#0000AA">filename</font>]</b><br> Include another file into this one and run its contents immediately. This is useful if you have some pre-written routines that you want to have available in several analysis files. Watch out because there are currently no protections against circular includes.<tr><td><b>INTERACTIVE</b><br> Place Avida analysis into interactive mode so that you can type commands have have them immediately acted upon. You can place this anywhere within the analyze file, so that you can have some processing done before interactive mode starts. You can type "quit" at any point to continue with the normal processing of the file.<tr><td><b>DEBUG [<font color="#0000AA">message</font>] </b><br> This is an "echo" command that will print a message (its arguments) on the screen. If there are any variables (see below) in the message, they will be translated before printing, so this is a good way of debugging your programs.</table><p>Now that we know how to interact with analysis mode, and load in genotypes,its important to be able to manipulate them. The next batch of commandswill do basic analysis on genotypes, and allow the user to prune batchesto only include those genotypes that are needed.<p align=center><b>Table 4: <font color="#008800">Genotype Manipulation Commands</font></b><table cellpadding=6><tr><td><b>RECALCULATE</b><br> Run all of the genotypes in the current batch through a test CPU and record the measurements taken (fitness, gestation time, etc.). This overrides any values that may have been loaded in with the genotypes.<tr><td><b>FIND_GENOTYPE [<font color="#008800">type="num_cpus" ...</font>]</b><br> Remove all genotypes but the one selected. Type indicates which genotype to choose. Options available for type are "num_cpus" (to choose the genotype with the maximum organismal abundance at time of printing), "total_cpus" (number of organisms ever of this genotype), "fitness", or "merit". If a the type entered is numerical, it is used as an id number to indicate the desired genotype (if no such id exists, a warning will be given). Multiple arguments can be given to this command, in which case all those genotypes in that list will be preserved and the remainder deleted.<tr><td><b>FIND_LINEAGE [<font color="#008800">type="num_cpus"</font>] </b><br> Delete everything except the lineage from the chosen genotype back to the most distant ancestor available. This command will only function properly if parental information was loaded in with the genotypes. Type is the same as the FIND command.<tr><td><b>ALIGN</b><br> Create an alignment of all the genome's sequences; It will place '_'s in the sequences to show the alignment. Note that a "FIND_LINEAGE" must first be run on the batch in order for the alignment to be possible.<tr><td><b>SAMPLE_ORGANISMS [<font color="#0000AA">fraction</font>] </b><br> Keep only "fraction" of organisms in the current batch. This is done per organism, <i>not</i> per genotype. Thus, genotypes of high abundance may only have their abundance lowered, while genotypes of abundance 1 will either stay or be removed entirely.<tr><td><b>SAMPLE_GENOTYPES [<font color="#0000AA">fraction</font>] </b><br> Keep only fraction of genotypes in the current batch.<tr><td><b>RENAME [<font color="#008800">start_id=0</font>]</b><br> Change the id numbers of all the genotypes to start at a given value. Often in long runs we will be dealing with ID's in the millions. In particular, after reducing a batch to a lineage, we will often want to number the genotypes in order from the ancestor to the final one.</table><p>Next, we are going to look at the standard output commands that will used tosave information generated in analyze mode.<p align=center><b>Table 5: <font color="#008800">Basic Output Commands</font></b><table cellpadding=6><tr><td><b>PRINT [<font color="#008800">dir="genebank/"</font>] </b><br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -