[Bio] / FigWebPages / Attributes.html Repository:
ViewVC logotype

Diff of /FigWebPages/Attributes.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4, Tue Jul 12 14:34:15 2005 UTC revision 1.6, Tue Jul 19 04:54:22 2005 UTC
# Line 1  Line 1 
1  <h1 style="text-align: center">Attributes</h1>  <h1 style="text-align: center">Attributes</h1>
2    
3  <h2 style="text-align: center">Updated July 11th, 2005. Rob Edwards</h2>  <h2 style="text-align: center">Updated July 11th, 2005. Rob Edwards</h2>
4    
5    
# Line 6  Line 7 
7                  <h3 style="text-align: center">Contents</h3>                  <h3 style="text-align: center">Contents</h3>
8                          <li><a href="#overview">Overview</a></li>                          <li><a href="#overview">Overview</a></li>
9                          <li><a href="#definitions">Definitions</a></li>                          <li><a href="#definitions">Definitions</a></li>
10                            <li><a href="#filelocations">File Locations</a></li>
11                            <li><a href="#scripts">Scripts for working with attributes</a></li>
12                          <li><a href="#methods">Methods for accessing attributes</a></li>                          <li><a href="#methods">Methods for accessing attributes</a></li>
13                            <ul>
14                          <li><a href="#get_attributes">get_attributes</a></li>                          <li><a href="#get_attributes">get_attributes</a></li>
15                          <li><a href="#add_attribute">add_attribute</a></li>                          <li><a href="#add_attribute">add_attribute</a></li>
16                          <li><a href="#delete_attribute">delete_attribute</a></li>                          <li><a href="#delete_attribute">delete_attribute</a></li>
# Line 19  Line 23 
23                          <li><a href="#guess_value_format">guess_value_format</a></li>                          <li><a href="#guess_value_format">guess_value_format</a></li>
24                          <li><a href="#attribute_location">attribute_location</a></li>                          <li><a href="#attribute_location">attribute_location</a></li>
25                  </ul>                  </ul>
26                    </ul>
27    
28  <p>I have added attributes to the database in a more significant way. This page is to document those attributes and ways to access/modify them. The page has two sections, a non-technical section for general discussion and overview, and a technical section for behind-the-scenes type information.</p>  <p>I have added attributes to the database in a more significant way. This page is to document those attributes and ways to access/modify them. The page has two sections, a non-technical section for general discussion and overview, and a technical section for behind-the-scenes type information.</p>
29    
# Line 65  Line 70 
70                          <li>Keys are case sensitive</li>                          <li>Keys are case sensitive</li>
71                          <li>An optional mapping is provided between a key and an explanation of what the key means (see below)</li>                          <li>An optional mapping is provided between a key and an explanation of what the key means (see below)</li>
72                          <li>By default, any key can have multiple values. If a key is to have only one value then a boolean can be set (see below) to limit this behavior</li>                          <li>By default, any key can have multiple values. If a key is to have only one value then a boolean can be set (see below) to limit this behavior</li>
73                            <li>keys cannot contain the following characters: space, tab or newline or any of @$!#%^&*()`~{}[]|\:;"'<>?,./
74    
75    
76                  </ul>                  </ul>
77                  <li><em>Value</em>. The value is free form and there are no limitations on what is contained in the value.                  <li><em>Value</em>. The value is free form and there are no limitations on what is contained in the value.
78                  <li><em>URL</em>. The URL is optional, and not required for any data set.                  <li><em>URL</em>. The URL is optional, and not required for any data set.
79          </ul>          </ul>
80          <br>          <br>
81          <li style="font-weight: 700">File Locations</li>          <li style="font-weight: 700"><a name="filelocations">File Locations</a></li>
82          <ul>          <ul>
83                  <li><em>General Attributes</em> Attributes are stored in the following locations:</li>                  <li><em>General Attributes</em> Attributes are stored in the following locations:</li>
84                  <ul>                  <ul>
85                          <li>$FIG_Config::organisms/xxxxx/Attributes contains the genome and organism attributes</li>                          <li>$FIG_Config::organisms/xxxxx/Attributes contains the genome and organism attributes</li>
86                          <li>$FIG_Config::organisms/xxxxx/Features/peg/Attributes contains the attributes for pegs</li>                          <li>$FIG_Config::organisms/xxxxx/Features/peg/Attributes contains the attributes for pegs</li>
87                          <li>$FIG_Config::organisms/xxxxx/Features/rna/Attributes contains the attributes for rnas... etc</li>                          <li>$FIG_Config::organisms/xxxxx/Features/rna/Attributes contains the attributes for rnas... etc</li>
88                          <li>Note that no general attributes should be stored in $FIG_Config::global (see below)</li>                          <li>Note that general attributes should not normally be stored in $FIG_Config::global (see below)</li>
89                  </ul>                  </ul>
90                    <li>All attributes files can hold comments as long as the line begins with a pound sign. Blank lines are also ignored.
91                  <br>                  <br>
92                  <li><em>Deleted Attributes</em>                  <li><em>Modified attributes</em></li>
93                  <ul>                  <ul>
94                          <li>Deleted attributes are stored in the text file $FIG_Config::global/Attributes/deleted_attributes. The only information that is stored here is the ID and the key. Note that this will currently delete all occurences of this key from this ID (hence with multiple values, all will be deleted).</li>                          <li>Modified attributes are stored in the files transaction_log</li>
95                            <li>There are separate transaction_logs in each of the locations where attributes are stored (e.g. the Features/peg/Attributes, Organism/nnnn.nn/Attributes, and Global/Attributes directories<li>
96                            <li>The transaction_log file has the following format:
97                            <ol>
98                                    <li>Method. This must be one of ADD/CHANGE/DELETE</li>
99                                    <li>Feature ID (e.g. peg, genome, or RNA number)</li>
100                                    <li>Key</li>
101                                    <li>Old value</li>
102                                    <li>Old URL</li>
103                                    <li>New value</li>
104                                    <li>New URL</li>
105                            </ol>
106                            <li>The old value, old, url, new value, and new url are optional depending on the method. For example, old value/url can be null if the method is add, and new value/new url can be null if the method is delete.</LI>
107                            <li>If the old value and old URL are ommitted and the method is delete all attributes that match key will be deleted from the feature</li>
108    
109                  </ul>                  </ul>
110                  <br>                  <br>
111                  <li><em>Metadata</em></li>                  <li><em>Metadata</em></li>
# Line 96  Line 119 
119                          </ol>                          </ol>
120                  </ul>                  </ul>
121          </ul>          </ul>
122            <li style="font-weight: 700"><a name="scripts">Scripts for working with attributes</a></li>
123            <li>Here are a few common scripts that you may want to use:
124            <ol>
125                    <li>load_attributes</li>
126                    <p>This will delete the current attributes database, look through all the potential places that attributes are stored and add those attributes into the database. Both genome-specific and global attributes will be added. Finally, each of the transaction_logs are processed and the data added back into the database. This is used to add new data to a database, and to rebuild an existing database.</p>
127                    <li>gather_attributes</li>
128                    <p>Atrributes are stored in disparate locations (global, genome, etc) and this will look through all the various locations and print out any attributes that are found. Gather attributes can take an optional -d on the command line, and will "delete" any attributes file that it finds. It doesn't actually delete the file, rather moves it to FIG_Config::temp/Attributes/deleted_attributes, and you can delete it from there.</p>
129                    <li>distribute_attributes</li>
130                    <p>This script will take any attributes on STDIN and write them to their appropriate locations.</p>
131    <p><b>Recommended</b> The recommended way to run these two commands is to first run gather attributes to collate the information and delete it:
132    <br><tt>
133    $gather_attributes -d > gathered_attributes.txt
134    </tt>
135    </br>
136    <br>And then to run the distribute command:</br>
137    <br><tt>
138    $sort -u gathered_attributes.txt | distribute_attributes
139    </tt></br>
140    
141    <p>This will recreate the attributes files, and overcome any potential problems of writing files that are being moved.</p>
142    
143                    <li>dump_attributes</li>
144                    <p>Dumps the current value of each attribute from the database, so these have all the changes in transaction_log already enacted.</p>
145            </ol>
146    
147    
148    
149  </ol>  </ol>
150    
151    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.6

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3