Webace - AceDB on the web [ Configure | Help ]

Instructions for curators

This file is for curators of acedb databases who wish to make their data available via webace.

Initial setup

Assuming webace has already been setup for some databases, to add a new acedb database carry out the following steps:

If webace has not already been setup you will have to follow the webace setup instructions.

Database specific customisation of webace by curators

Acedb database curators, who are serving their data using webace, can control the following aspects to the way their data appears to the user:

A full list of all the webace configuration files, including those controlled by the webace administrator can be found here.

1. Definition of 'views' for graphical displays of ace objects.

The webace_view.pl file allows the curator to define 'views' for both FMAP and GMAP displays with associated header and footer HTML, as well as the click 'modes' described below. The file is loaded by the 'display' CGI script, however a search path is followed to allow maximum flexibility in authorship and testing:

wspec/webace_view_'port'.pl
wspec/webace_view.pl
acelib/webace_view_'db'.pl
acelib/webace_view.pl
The search path is therefore (1) database specific file in wspec under curator control, (2) database specific file under webace administrator control, (3) global webace_view file under webace administrator control.

The extra file at the beginning of the search with the additional 'port' qualifier is to facilitate testing by curators. If you wish to experiment with the webace configuration files without affecting a live service, the best way is to run a separate www server on a different port (other than the default port 80). This should have a completely separate htdocs and cgi-bin tree (a duplicate copy of all cgi-bin, acelib files). By modifying the dbinfo file, other acedb servers can be connected to, however this is not essential if one just wishes to experiment with different view control settings. If one is the webace administrator of course it is easy to edit any webace_view*.pl files in acelib, however if one is a curator without write access to acelib it is only possible to edit files in wspec, which will be referred to by both CGI scripts on both webace www servers. To address this, 'display' first looks for wspec/webace_view_'port'.pl in its search list. Popular alternative ports are 8080 for example, in which case call this file wspec/webace_view_8080.pl

The file is included into the CGI script using 'eval' - if it does not compile then the only result is that neither views nor extra click modes are defined at all - the CGI scripts will continue to execute correctly. The syntax of the file can be with 'perl -c filename' to avoid these errors.

Although in both types of display the user interface is identical (a popup view menu), the way the view is defined is quite different. For GMAP displays, the actual data displayed corresponds to a named 'view' object previously defined within the acedb database in question. For FMAP displays, views are defined in the above file, by listing all the methods used in the database and flagged them as enabling or disabling for each view.

It is also possible to define a special view, abbreviated as 'auto', where the actual view depends on some set of rules, such as the object name or zoom factor. In the example file given this is used to implement semantic zooming for FMAP displays (only genes are displayed at low resolution, but more and more information is displayed as one zooms in) and for GMAP displays selection on the basis of object name.

An example of the elements of the file is given below.

1. view name/label definitions.

The structure of these is identical for FMAP and GMAP. An array (@) and a hash (%) are both required due to a limitation of CGI.pm (which may later be removed). The hash links the value ('def') with the label that will be displayed in the menu to the user ('Default view').


	@$rafmap_view=(
		       'def',
		       'chrctg1',
		       'chrctg2',
		       );
	%$rhfmap_view=(
		       'def','Default view',
		       'chrctg1','All clones',
		       'chrctg2','Selected clones',
		       );

2. view data definitions.

The structure of these is different for FMAP and GMAP.

For GMAP, a set of view names are defined which map to view names already defined inside the relevant acedb. The hash defines the relationship between the values attached to each menu entry and the extra part of the acedb gifaceserver command that is required.


%gmap_acedb_viewcom=(
		     'def','',
		     'chr','-view webace_chr',
		     'chrctg1','-view webace_chrctg1',
		     'chrctg2','-view webace_chrctg2',
		     );

The mechanism for FMAP is similar except that the 'views' themselves are defined in this file as a set of column on/off states - it is therefore required to list all methods that you want control off and define if they should be on or off for any given view. In fact the view is calculated relative to 'default' state, so this must also be stored, although in practice this is not difficult (any user defined method is on, some acedb hardwired methods are on and some are off). There are two hashs (the second one being a hash or arrays, and only partially shown here for space), the first providing a numerical index to the array elements in the second. The first element in each array of the second hash indicates the default display state (as shown by acedb - 1 = on; 2 = off). The subsequent elements indicate the state required for each view as defined in the first hash.


%fmap_col_index=(
		 'default',0,
		 'def',1,
		 'hom',2,
		 'gene',3,
		 'ggp',4,
		 );

%fmap_col=(
	   
	   # methods
	  
	   # real genes
	   'supported_CDS',
	   [1,1,1,1,1,],
	   'supported_mRNA',
	   [1,1,1,1,1,],

	   .......
	   
	   'Coords',
	   [2,2,2,2,2,],
	   'DNA Sequence',
	   [2,2,2,2,2,],
	   'Brief Identifications',
	   [2,2,2,2,2,],
	   'Text Features',
	   [1,1,1,1,1,],
	   );

2. view header/footer definitions.

Both FMAP and GMAP setups also allow the definition of %fmap_head and %fmap_key respectively, which will be printed as html at the top and bottom of the page respectively. Icons for each acedb defined colour can be found in /webace/I/colour.gif and can be used to build keys.


	%fmap_head=(
		    'def',1,
		    'chrctg1',1,
		    'chrctg2',1,
		    );
		    
	$fmap_head[1]='';
	
	%fmap_key=(
		   'def',1,
		   'chrctg1',1,
		   'chrctg2',1,
		   );
		   
# EDITABLE
	$fmap_key[1]=<<ENDOFTEXT;
Clone status colour key: 
<img src="../I/black.gif"> Archived/Submitted
<img src="../I/red.gif"> Finished
<img src="../I/lightred.gif"> Contiguous
<img src="../I/yellow.gif"> Assembly_start
<img src="../I/green.gif"> Shotgun_complete
<img src="../I/lightgray.gif"> Shotgun
<img src="../I/blue.gif"> Library_made
<img src="../I/lightblue.gif"> Fingerprinted
<img src="../I/white.gif"> DNA_made/Streaked<p>
ENDOFTEXT


2. Definition of click 'modes' for graphical displays.

The second part of the wspec/webace_view.pl file can be used to define 2 extra click-actions, which, if enabled, will be added to the click-action popup menu immediately above the graphics image.

The first is 'External Links'. When an acedb object is displayed as text, parts of it that can be parsed to build an External URL link using the definitions in 3 files, cgi-bin/acelib/standard_urls, wspec/markup.pl and cgi-bin/acelib/global_markup.pl (see below). The same definitions in standard_urls can be accessed via the values in @keys and $type returned from the subroutine definition below.

Set $use_external_link=1 to activate this mode. The string that is parsed is the information string displayed when the mouse is held over an object when in 'mouseover' mode. This is less information than is available to markup.pl, but should still be sufficient for many purposes. Careful naming of objects in acedb can be helpful, as shown in this case where object prefixes allow various types of sequence to be distinguished.

$type and @keys will be undefined by default. If no valid reference is returned, webace will return a page informing the user that there is no valid 'External Link' for this object.


# C. External Links

# EDITABLE
$use_external_link=0;

$external_link=sub{
    my($label)=@_;
    my($type,@keys);
    
# EDITABLE - define $keys[] and $type for different $label expressions
    if($label=~/^Sequence:em:(\w+)/i){
	$keys[0]=$1;
	$type="EMBLAC";
    }elsif($label=~/^Protein:sw:(\w+)/i){
	$keys[0]=$1;
	$type="SwissProtAC";
    }elsif($label=~/^Protein:tr:(\w+)/i){
	$keys[0]="tr:$1";
	$type="TremblAC";
    }elsif($label=~/^Protein:wp:(\w+)/i){
	$keys[0]="wp:$1";
	$type="WPAC";
    }
    
    return ($type,@keys);
};

The second is 'External Help', which is a form of context sensitive help. This allows the definition of a raw html page or point within an html page to jump to if an object is clicked on while in this mode. This will be most useful to document the meaning of classes of object rather than individual objects and methods that gave rise to features. The sort of information on how an entry in acedb was created is not normally stored within the database so it is appropriate to store it in an external html file(s) in this way.

Set $use_external_help=1 to activate this mode. Again the parsing is of the information string displayed when the mouse is held over an object when in 'mouseover' mode. In this case the URL returned is $ext merged with $stem, however it could easily be modified so each case defined a full URL to give a separate page for each entry. Here is the example html file, methods-help.html.


# D. External Help

# EDITABLE
$use_external_help=0;

$external_help=sub{
    my($label,$type)=@_;
    my($link,$stem,$ext);

# EDITABLE
    $stem="/webace/example-config/methods-help.html#";
    
# EDITABLE - define $ext for different $label expressions/$type combinations
    if($label=~/^Sequence:/i && $type=~/Map/i){
	$ext="mapsequence";
    }elsif($label=~/^PAC:/i){
	$ext="mappac";
    }elsif($label=~/^STS:/i){
	$ext="mapsts";
    }elsif($label=~/^Probe:/i){
	$ext="mapprobe";
    }elsif($label=~/^Sequence:(em|sp|wp)/i){
	$ext="sequence";
    }elsif($label=~/^Protein:/i){
	$ext="protein";
    }elsif($label=~/^Sequence:\w+\.(fgeneh|genscan)/i){
	$ext="gene_predictions";
    }
    
    if($ext){
	$link=$stem.$ext;
    }
    return $link;
};

3. Auto addition of external URL links to parts of an acedb object when viewed as text.

Before using this section to add anything new, consider if you would rather add URL objects to your acedb database directly instead - a feature that has been added to acedb since this aspect of webace was created. Having said this, at present webace does rely on this system internally to build the 'view image' link at the top of text objects, so these files are still necessary.

External URL definitions involve 3 files (see complete file list), cgi-bin/acelib/standard_urls, wspec/markup.pl and cgi-bin/acelib/global_markup.pl. markup.pl and global_markup.pl define rules to decide when to add URLs from standard_urls (completed with parameters extracted by the rules defined in the former). Unlike webace_view.pl, where a local file overrides a global file completely, here the rules in the first 2 files are adative, even if there are duplicates. To modify these files requires knowledge of the acedb object model, the models of the acedb database being curated and the representation syntax of acedb objects output by 'show -perl'. A simple example is:


In markup.pl

{'root'=> {'cl'=>'Sequence'},
 'keys' => sub {my ($node, $root) = @_;
		return ($node->{db},$node->{cl},$node->{va});
	    },
'urls'=>'display'
},

In standard_urls

display:view graphic:$main::baseURL/cgi-bin/$main::ndisplay?db=$keys[0]&class=$keys[1]&object=$keys[2]

The elements in each file are perl statements that can be executed by the CGI scripts using 'eval'. The definition in markup.pl is a data structure, which is used to parse part of a perl object: the rule it specifies is that if $node is of class Sequence, the array @keys is returned containing values for database, class and object, which are to be used with the entry in standard_urls called display. The display entry consists of 3 parts: its name (display); the name that will be given to the href URL that is going to be generated ('view graphic') and the href URL itself. The 3 entries in the @keys array are subsituted into the the URL. It is a reference to an acedb object using the webace API to address the display CGI script.

4. Addition of URL objects to database

The above method of adding external URL links, can generally be replaced by adding URL objects to acedb databases (added in acedb 4.5): In the standalone acedb application, selecting such an object causes netscape to be launched (if not already running) and for the appropriate page to be displayed. In webace such objects are automatically marked up as external URL links and displayed in italic to distinguish them from internal links to other acedb objects. The difference is that whereas a generic URL object could be added to an acedb object to create a URL based on the object name, more complex parsing is not currently possible whereas it is above. Also, the above method will create an external URL link next to a reference to an object, whereas here external URL's will only be accessible when you view the object directly. Having said that, URL objects can still be very useful.

It is worth noting at this point that as well as true URL objects, various other tagname/text combinations are searched for and parsed into URL links by webace: text which appears to be an email address following a tag name 'Email' is marked up as a 'mailto:' link. Text which appears to be an http link following a tag name 'WWW_URL' is marked up as a'http' link (this is for historical support only - such entries should be changed to true URL objects).

Once you have a number of acedb databases served using webace (and perhaps know of a number of others elsewhere on the net you may want to want to consider adding crosslinks between your objects and objects in other databases. These links are made by creating URL objects which use the webace API to address an object. A level beyond this is that the exact object reference in the external acedb need not be known, as the URL object could also contain an acedb query (again formed using the webace API). Provided this query returns a single object, clicking on the URL object will jump directly to a webace display of the object pointed to. Details and examples on how to create crosslinks can be found here.

15/3/98, webace@sanger.ac.uk