[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.7, Sat Oct 22 17:43:49 2005 UTC revision 1.8, Tue Jun 13 23:32:15 2006 UTC
# Line 47  Line 47 
47    
48  <li>Now choose WIDTH from the same pull down menu, and click show spreadsheet. Because width is a numeric variable, I grouped these key/value pairs in 1/10ths of the maximum. If you look at the Color Descriptions box you will see ranges (this is not perfect at the moment, but it is on the way).</li>  <li>Now choose WIDTH from the same pull down menu, and click show spreadsheet. Because width is a numeric variable, I grouped these key/value pairs in 1/10ths of the maximum. If you look at the Color Descriptions box you will see ranges (this is not perfect at the moment, but it is on the way).</li>
49    
50  <li>Now reset the WIDTH pull-down menu to empty (the first option in the list), and choose PIRSF from the menu labelled "color columns by each PEGs attribute" and click show spreadsheet. This is the same as before, but hopefully we can add more keys here and color other things.</li>  <li>Now reset the WIDTH pull-down menu to empty (the first option in the list), and choose structure from the menu labelled "color columns by each PEGs attribute" and click show spreadsheet. This is the same as before, but hopefully we can add more keys here and color other things.</li>
51    
52  <li>From one of the PEGs that is colored as having a PIRSF link click on the link to get to the protein page. There is the attributes box (as before), and a new "Edit Attributes" button. When you click this, you will get three fields, key, value, and URL. If you go to a protein that does not have any attributes yet, you still get the edit box to let you add some attributes.</li>  <li>From one of the PEGs that is colored as having a structure link click on the link to get to the protein page. There is the attributes box (as before), and a new "Edit Attributes" button. When you click this, you will get three fields, key, value, and URL. If you go to a protein that does not have any attributes yet, you still get the edit box to let you add some attributes.</li>
53    
54    
55  </ul>  </ul>
# Line 177  Line 177 
177  [fid, key, value, url]</p>  [fid, key, value, url]</p>
178  <p>You can request an E. coli key like this  <p>You can request an E. coli key like this
179  $fig-&gt;get_attributes('83333.1');</p>  $fig-&gt;get_attributes('83333.1');</p>
180  <p>You can request any PIRSF key like this  <p>You can request any "structure" key like this
181  $fig-&gt;get_attributes('', 'PIRSF');</p>  $fig-&gt;get_attributes('', 'structure');</p>
182  <p>You can request any google url like this  <p>You can request any google url like this
183  $fig-&gt;get_attributes('', '', '', 'http://www.google.com');</p>  $fig-&gt;get_attributes('', '', '', 'http://www.google.com');</p>
184  <p>NOTE: If there are no attributes an empty array will be returned. You need to check for this and not assume that it will be undef.</p>  <p>NOTE: If there are no attributes an empty array will be returned. You need to check for this and not assume that it will be undef.</p>
# Line 193  Line 193 
193          value          value
194          optional URL to add          optional URL to add
195          optional file to store the attributes in.</pre>          optional file to store the attributes in.</pre>
196  <p>A note on file names. At the moment the file assigned_attributes is used to store new attributes by default, and load_attributes loads that file last so any changes will overwrite existing keys. However this is not quite true since we can now have multiple key/values for a single peg. Using this method you can define a filename to store the attributes in. The directory structure will be figured out for you, so you can use something like ``pirsf'' as the file name.</p>  <p>A note on file names. At the moment the file assigned_attributes is used to store new attributes by default, and load_attributes loads that file last so any changes will overwrite existing keys. However this is not quite true since we can now have multiple key/values for a single peg. Using this method you can define a filename to store the attributes in. The directory structure will be figured out for you, so you can use something like ``structure'' as the file name.</p>
197  <p>  <p>
198  </p>  </p>
199  <h3><a name="delete_attribute">delete_attribute</a></h3>  <h3><a name="delete_attribute">delete_attribute</a></h3>
# Line 223  Line 223 
223  <h3><a name="erase_attribute_entirely">erase_attribute_entirely</a></h3>  <h3><a name="erase_attribute_entirely">erase_attribute_entirely</a></h3>
224  <p>This method will remove any notion of the attribute that you give it. It is different from delete as that just removes a single attribute associated with a peg. This will remove the files and uninstall the attributes from the database so there is no memory of that type of attribute. All of the attribute files are moved to FIG_Tmp/Attributes/deleted_attributes, and so you can recover the data for a while. Still, you should probably use this carefully!</p>  <p>This method will remove any notion of the attribute that you give it. It is different from delete as that just removes a single attribute associated with a peg. This will remove the files and uninstall the attributes from the database so there is no memory of that type of attribute. All of the attribute files are moved to FIG_Tmp/Attributes/deleted_attributes, and so you can recover the data for a while. Still, you should probably use this carefully!</p>
225  <p>I use this to clean out old PIR superfamily attributes immediately before installing the new correspondence table.</p>  <p>I use this to clean out old PIR superfamily attributes immediately before installing the new correspondence table.</p>
226  <p>e.g. my $status=$fig-&gt;erase_attribute_entirely(``pirsf'');</p>  <p>e.g. my $status=$fig-&gt;erase_attribute_entirely(``structure'');</p>
227  <p>This will return the number of files that were moved to the new location</p>  <p>This will return the number of files that were moved to the new location</p>
228  <p>  <p>
229  </p>  </p>
# Line 232  Line 232 
232  <p>Without any arguments:</p>  <p>Without any arguments:</p>
233  <p>Returns a reference to a hash, where the key is the type of feature (peg, genome, rna, prophage, etc), and the value is a reference to a hash where the key is the key name and the value is a reference to an array of all features with that id.</p>  <p>Returns a reference to a hash, where the key is the type of feature (peg, genome, rna, prophage, etc), and the value is a reference to a hash where the key is the key name and the value is a reference to an array of all features with that id.</p>
234  <p>e.g.</p>  <p>e.g.</p>
235  <p>print ``There are  '' , scalar @{{$fig-&gt;get_keys}-&gt;{'peg'}-&gt;{'PIRSF'}}, `` PIRSF keys in the database\n'';</p>  <p>print ``There are  '' , scalar @{{$fig-&gt;get_keys}-&gt;{'peg'}-&gt;{'structure'}}, `` Structure keys in the database\n'';</p>
236  <p>my $keys=$fig-&gt;get_keys;  <p>my $keys=$fig-&gt;get_keys;
237  foreach my $type (keys %$keys)  foreach my $type (keys %$keys)
238  {  {
# Line 265  Line 265 
265  <pre>  <pre>
266          $fig-&gt;get_values('peg'); # will get all values for pegs</pre>          $fig-&gt;get_values('peg'); # will get all values for pegs</pre>
267  <pre>  <pre>
268          $fig-&gt;get_values('peg', 'pirsf'); # will get all values for pegs with attribute pirsf</pre>          $fig-&gt;get_values('peg', 'structure'); # will get all values for pegs with attribute structure</pre>
269  <pre>  <pre>
270          $fig-&gt;get_values(undef, 'pirsf'); # will get all values for anything with that attribute</pre>          $fig-&gt;get_values(undef, 'structure'); # will get all values for anything with that attribute</pre>
271  <p>  <p>
272  </p>  </p>
273  <h3><a name="key_info">key_info</a></h3>  <h3><a name="key_info">key_info</a></h3>

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3