GBrowse

 view release on metacpan or  search on metacpan

docs/pod/CONFIGURE_HOWTO.pod  view on Meta::CPAN

not appear on the main screen or any of the configuration screens.  To
set this up, add a "restrict" option to the track you wish to make
off-limits:

	[PROPRIETARY]
	feature = etc
	glyph   = etc
	restrict = Order deny,allow
		   deny from all
		   allow from localhost .cshl.edu .ebi.ac.uk

The value of the restrict option is identical to the Apache
authorization directives and can include any of the directives
"Order," "Satisfy," "deny from," "allow from," "require valid-user" or
"require user."  The only difference is that the "require group"
directive is not supported, since the location of Apache's group file
is not passed to CGI scripts.  Note that username/password
authentication must be turned on in httpd.conf and the user must have
successfully authenticated himself in order for the username to be
available.

As with other gbrowse options, restrict can be a code subroutine.  The
subroutine will be called with three arguments consisting of the host,
ip address and authenticated user.  It should return a true value to
allow access to the track, or a false value to forbid it.  This can be
used to implement group-based authorization or more complex schemes.

Here is an example that uses the Text::GenderFromName to allow access
if the user's name sounds female and forbids access if the name sounds
male.  (It might be useful for an X-chromosome annotation site.)

    restrict = sub {
	       my ($host,$ip,$user) = @_;
	       return unless defined $user;
	       use Text::GenderFromName qw(gender);
	       return gender($user) eq 'f';
	     }

You should be aware that the username will only be defined if username
authentication is turned on and the user has successfully
authenticated himself against Apache's user database using the correct
password.  In addition, the hostname will only be defined if
HostnameLookups have been turned on in httpd.conf.  In the latter
case, you can convert the IP address into a hostname using this piece
of code:
    
    use Socket;
    $host = gethostbyaddr(inet_aton($addr),AF_INET);

Note that this may slow down the response time of gbrowse noticeably
if you have a slow DNS name server.

Another thing to be aware of when restricting access to an entire
database is that that even though the database itself will not be
accessible to unauthorized users, the name of the database will still
be available from the popup "Data Source" menu.  If you wish even the
name to be suppressed from view by unauthorized users, add the
following line to the [GENERAL] section of the configuration file of
the database you wish to suppress:

    restrict = require valid-user

The syntax described earlier for restricting access to tracks by
hostname, IP address or username holds true for restricting the
visibility of the database on the Data Source popup menu.

=head1 F. DISPLAYING GENETIC AND RH MAPS

GBrowse can be tweaked to make it more suitable for displaying genetic
and radiation hybrid maps.  

The main issue is that the Bio::DB::GFF database expects coordinates
to be positive integers, not fractions, but genetic and RH maps use
floating point numbers.  Working around this is a bit of an ugly hack.
Before loading your data you must multiply all your coordinates by a
constant power of 10 in order to convert them into integers.  For
example, if a genetic map uses Morgan units ranging from 0 to 1.80,
you would multiple by 100 to create a map in ranging from 0 to 180.

Create a GFF file containing the markers in modified coordinates and
load it as usual.  Now you must tell GBrowse to reverse these changes.
Enter the following options into the [GENERAL] section of the
configuration file:

 units = M
 unit_divider = 100

These two options tell GBrowse to use "M" (Morgan) units, and to
divide all coordinates by 100.  GBrowse will automatically display the
scale using the most appropriate units, so the displayed map will
typically be drawn using cM units.

=head1 G. CHANGING THE LOCATION OF THE CONFIGURATION FILES

If you wish to change the location of the gbrowse.conf configuration
file directory, you must manually edit the gbrowse CGI script.  Open
the script in a text editor, and find this section:

 ###################################################################
 # Non-modperl users should change this variable if needed to point
 # to the directory in which the configuration files are stored.
 #
 use constant CONF_DIR => '/usr/local/apache/conf/gbrowse.conf';
 #
 ###################################################################

Change the definition of CONF_DIR to the desired location of the
configuration files.

An alternative, for users of mod_perl only, is to add the GBrowseConf
per-directory variable to the configuration for the directory in which
the gbrowse script lives.  This variable overrides the CONF_DIR value.
For example:

 <Directory /usr/local/apache/cgi-perl>
   SetHandler      perl-script
   PerlHandler     Apache::Registry
   PerlSendHeader  On
   Options         +ExecCGI
   PerlSetVar      GBrowseConf /etc/gbrowse.conf
 </Directory>



( run in 2.323 seconds using v1.01-cache-2.11-cpan-5837b0d9d2c )