Difference between revisions of "GBrowse Tutorial"

From GMOD
Jump to: navigation, search
m
(Replaced 2009 Tutorial with 2010 Tutorial)
Line 1: Line 1:
 
{| class="tutorialheader"
 
{| class="tutorialheader"
| align="right" | {{#icon: 2009SummerSchoolAmericas170.png|2009 GMOD Summer School - Americas|120|2009 GMOD Summer School - Americas}}<br /><br />{{#icon: GMOD2009Europe170.png|2009 GMOD Summer School - Europe|120|2009 GMOD Summer School - Europe}}
+
| align="right" | {{#icon: 2010SummerSchoolAmericas300.png|2010 GMOD Summer School - Americas||2010 GMOD Summer School - Americas}}
 
| {{TutorialTitleLine|[[GBrowse]]}}<br />
 
| {{TutorialTitleLine|[[GBrowse]]}}<br />
2009 [[GMOD Summer School]] - [[2009 GMOD Summer School - Europe|Europe]] & [[2009 GMOD Summer School - Americas|Americas]]<br />
+
[[2010 GMOD Summer School - Americas]]<br />
July & August 2009<br />
+
May 6-9, 2010<br />
 
[[User:Scott|Scott Cain]]
 
[[User:Scott|Scott Cain]]
 
|}
 
|}
Line 21: Line 21:
  
 
; This tutorial
 
; This tutorial
: This tutorial was originally taught by [[User:Scott|Scott Cain]] at the [[2009 GMOD Summer School - Europe]].  It walks you through setting up and running [[GBrowse]] with some sample data.  It provides a [[VMware]] image to work on, and relies heavily on the {{GBrowseAdminTutorialLink|GBrowse Administration Tutorial}}.
+
: This tutorial was originally taught by [[User:Scott|Scott Cain]] at the [[2010 GMOD Summer School - Americas]].  It walks you through setting up and running [[GBrowse]] with some sample data.  It provides a [[VMware]] image to work on, and relies heavily on the {{GBrowseAdminTutorialLink|GBrowse Administration Tutorial}}.
  
: '''Note:''' This tutorial was also taught at the [[2009 GMOD Summer School - Americas]], but the notes and system image used here are from the [[2009 GMOD Summer School - Europe|Europe course]].
 
 
</div>
 
</div>
  
Line 32: Line 31:
 
= VMware =
 
= VMware =
 
{|
 
{|
| valign="top" |This tutorial was taught using a [[VMware]] system image as a starting point.  If you want to start with that same system, download and install the ''Starting'' image.  There is also an ''Ending'' image for this tutorial, which contains the system after this tutorial (and the [[GBrowse_syn Tutorial]]) have been finished.
+
| valign="top" |This tutorial was taught using a [[VMware]] system image as a starting point.  If you want to start with that same system, download and install the ''Starting'' image.
  
 
'''''See [[VMware]] for what software you need to use a VMware system image, and for directions on how to get the image setup and running on your machine.'''''
 
'''''See [[VMware]] for what software you need to use a VMware system image, and for directions on how to get the image setup and running on your machine.'''''
Line 39: Line 38:
 
! Download
 
! Download
 
|-
 
|-
| align="center" | [ftp://ftp.gmod.org/pub/gmod/Courses/2009/SummerSchoolEurope/GmodSumSch2009EU2.zip Starting&nbsp;Image]<br>
+
| align="center" | [ftp://ftp.gmod.org/pub/gmod/Courses/2010/SummerSchoolAmericas/GMODCourse2010Day1.vmwarevm.tar.gz Starting&nbsp;Image]<br>
[ftp://ftp.gmod.org/pub/gmod/Courses/2009/SummerSchoolEurope/GmodSumSch2009EU3.tar.gz Ending Image]<br />
+
[ftp://ftp.gmod.org/pub/gmod/Courses/2010/SummerSchoolAmericas/GMODCourse2010Day2.vmwarevm.tar.gz Ending Image]<br />
----
+
|-
Username:&nbsp;gmod<br />Password: gmod
+
! Logins
 +
|-
 +
|
 +
{| class="wikitable"
 +
! Purpose
 +
! Username
 +
! Password
 +
|-
 +
| Shell
 +
| gmod
 +
| gmodamericas2010
 +
|-
 +
| MySQL
 +
| root
 +
| gmodamericas2010
 
|}
 
|}
 
|}
 
|}
 +
|}
 +
  
 
= Caveats =
 
= Caveats =
Line 51: Line 66:
 
=Prerequisites=
 
=Prerequisites=
  
Most installed before using apt or cpan
+
Installed before using apt or cpan.
 
+
<div class="emphasisbox">
+
Should be able to install Bio::Graphics via cpan like such:
+
 
+
  cpan> install Bio::Graphics
+
 
+
Weirdly, cpan thinks that BioPerl 1.6 is not installed yet, so it will install it, as well as updating Data::Stag (it will take a few minutes and requires cpan)
+
 
+
(In hindsight, the apt-get of libgd-tools below ''might'' have fixed this problem.)
+
</div>
+
 
+
Instead get it the source from http://search.cpan.org/CPAN/authors/id/L/LD/LDS/Bio-Graphics-1.97.tar.gz
+
 
+
If you download that from Firefox, it will put on the desktop.
+
 
+
<bash>cd ~/Desktop
+
tar xzvf Bio-Graphics-1.97.tar.gz
+
cd Bio-Graphics-1.97
+
perl Build.PL
+
./Build
+
./Build test
+
sudo apt-get install libgd-tools
+
./Build test
+
sudo ./Build install
+
</bash>
+
  
 
=Install GBrowse=
 
=Install GBrowse=
  
*Update [[GBrowse]] [[Glossary#CVS|cvs]] repository (it is an anonymous cvs checkout):
+
Easily installed via the cpan shell:
   cd ~/software/gbrowse-pre-1.70/
+
   <span class="enter">sudo cpan</span>
   cvs update -d
+
   cpan> <span class="enter">install Bio::Graphics::Browser2</span>
  
  perl Makefile.PL
+
Which gets all of the prereqs that aren't installed on the machine.
  ... accept defaults
+
  make
+
  sudo make install
+
  
 
=Tutorial=
 
=Tutorial=
Line 95: Line 82:
  
  
=GBrowse2=
 
[[:Category:GBrowse 2|GBrowse 2]] is a re-architecture of [[GBrowse]] that uses [[Glossary#AJAX|AJAX]] techniques to allow independent rendering of tracks and multiple distributed databases.  It is designed to allow the use of load management and distributes processing on a compute farm, which enhanced performance and the user experience.  It is due to be released in late 2009.
 
  
We will not cover GBrowse 2 in depth this year but will have a demo, time permitting.
 
 
*[[Migrating_from_GBrowse_1.X_to_2.X|transitioning from GBrowse 1.x to 2.x]]
 
*[[Running a GBrowse2 render farm]]
 
*[[GBrowse 2.0 HOWTO]]
 
 
=Example Advanced Features=
 
==PrimerDesigner Plugin==
 
[[Image:PrimerDesigner.png|right|border|300px]]
 
<span class="pops">[[GBrowse Plugins]]</span> allow you to add extra functionality to your genome browser.
 
* The [[PrimerDesigner.pm|PrimerDesigner plugin]] used primer3 to design PCR primers for the selected region from within [[GBrowse]].
 
* You can find out how to use and install this plugin, even see a ''fascinating'' video demonstration, <span class="pops">[[PrimerDesigner.pm|on the PrimerDesigner page]]</span>.
 
 
==Rubber-Band Select Menus==
 
[[Image:Rubber1.png|right|thumb|250px|An example of a select menu that appears after a region of the details panel is selected]]
 
"Rubber-band", or drag-selection is a user-interface feature of [[GBrowse]] 1.69 and later. It a JavaScript/DHTML-based feature that works in all major web browsers and is turned on by default.
 
 
* The rubber-band selection that is activating by dragging your mouse on the scalebar for the details section activated a menu that specifies various operations that can be performed on the selected sequence region.
 
* The [[GBrowse Configuration HOWTO|GBrowse configuration file]] can be used to control the contents and appearance of this menu.
 
* You can also add menus to the scalebar for the overview and regionview panels.
 
* See [[RubberBandSelection]] for more information, including menus, configuration (and a video demo!).
 
<br clear="all" />
 
  
 
=Basic [[Chado]] Configuration (if we have time)=
 
=Basic [[Chado]] Configuration (if we have time)=
  
Normally, we'd need Bio::DB::Das::Chado, but it was installed for [[JBrowse]] [[2009 GMOD Summer School - Europe|yesterday]].
+
{{CPAN|Bio::DB::Das::Chado}} was installed when we created the image, but I've since released a new version, so we can install the new version with the cpan shell:
  
Starting material:
+
  <span class="enter">sudo cpan</span>
 +
  cpan> <span class="enter">install Bio::DB::Das::Chado</enter>
  
  ~/software/gbrowse-pre-1.70/contrib/conf_files/07.chado.conf /etc/apache2/gbrowse.conf/
+
Simple config file in <tt>/etc/gbrowse2/pythium.conf</tt>
  
 
Some simple tweaks and additions:
 
Some simple tweaks and additions:
Line 133: Line 97:
 
*fix the dbi string
 
*fix the dbi string
 
*add nucleotide matches
 
*add nucleotide matches
 +
*strip out stuff that is in <tt>/etc/gbrowse2/GBrowse.conf</tt>
  
 
==Materialized views for searching==
 
==Materialized views for searching==
  
[[Chado]] comes with a tool to materialize views written by developers at the [[:Category:SGN|SOL Genomics Network]].  A materialized view is faster (at the expense of more disk space) to search than a regular view (which is really a query over potentially several tables).  To create a materialized view that makes searching a GBrowse Chado instance a faster, we can do this:
+
Chado comes with a tool to materialize views written by developers at the [[:Category:SGN|SOL Genomics Network (SGN)]].  A materialized view is faster (at the expense of more disk space) to search than a regular view (which is really a query over potentially several tables).  To create a materialized view that makes searching a GBrowse [[Chado]] instance a faster, we can do this:
  
   gmod_materialized_view_tool.pl -c
+
   <span class="enter">gmod_materialized_view_tool.pl -c</span>
  
 
which will ask us several obscure questions for which we need to provide obscure answers:
 
which will ask us several obscure questions for which we need to provide obscure answers:
<pre>
+
 
 
   Give your materialized view a name (word characters only):
 
   Give your materialized view a name (word characters only):
   all_feature_names
+
   <span class="enter">all_feature_names</span>
  
 
   Where will this MV be located? (schemaname.tablename):
 
   Where will this MV be located? (schemaname.tablename):
   public.all_feature_names
+
   <span class="enter">public.all_feature_names</span>
  
 
   A view with this name already exists; do you want to replace it
 
   A view with this name already exists; do you want to replace it
 
   with a materialized view? [y|n]
 
   with a materialized view? [y|n]
   y
+
   <span class="enter">y</span>
  
 
   How often, in seconds, should the MV be refreshed?
 
   How often, in seconds, should the MV be refreshed?
 
   You can also type 'daily', 'weekly', 'monthly' (30 days), or 'yearly' (365 days):
 
   You can also type 'daily', 'weekly', 'monthly' (30 days), or 'yearly' (365 days):
   weekly
+
   <span class="enter">weekly</span>
  
 
   Enter specifications for the materialized view, OR provide a file in which
 
   Enter specifications for the materialized view, OR provide a file in which
 
   the specs are written ('? for help):
 
   the specs are written ('? for help):
   feature_id integer,name varchar(255)
+
   <span class="enter">feature_id integer,name varchar(255)</span>
  
 
   Enter the SQL query for the materialized view,
 
   Enter the SQL query for the materialized view,
 
   or a file containing only the query:
 
   or a file containing only the query:
   SELECT feature_id,CAST(substring(uniquename from 0 for 255) as varchar(255)) as name FROM feature UNION SELECT feature_id, name FROM feature where name is not null UNION SELECT fs.feature_id,s.name FROM feature_synonym fs, synonym s WHERE fs.synonym_id = s.synonym_id
+
   <span class="enter">SELECT feature_id,CAST(substring(uniquename from 0 for 255) as varchar(255)) as name FROM feature UNION SELECT feature_id, name FROM feature where name is not null UNION SELECT fs.feature_id,s.name FROM feature_synonym fs, synonym s WHERE fs.synonym_id = s.synonym_id</span>
  
 
   Enter a comma separated list of fields to index (or return for none):
 
   Enter a comma separated list of fields to index (or return for none):
   feature_id,name
+
   <span class="enter">feature_id,name</span>
  
 
   Enter the SQL queries for special indexes,
 
   Enter the SQL queries for special indexes,
 
   or a file containing only the query (or return for none):
 
   or a file containing only the query (or return for none):
   create index all_feature_names_lower_name on all_feature_names (lower(name))
+
   <span class="enter">create index all_feature_names_lower_name on all_feature_names (lower(name))</span>
  
 
   Enter 'y' to confirm, 'n' to re-enter data:
 
   Enter 'y' to confirm, 'n' to re-enter data:
   y
+
   <span class="enter">y</span>
</pre>
+
  
 
[[Category:Tutorials]]
 
[[Category:Tutorials]]
 
[[Category:GBrowse]]
 
[[Category:GBrowse]]

Revision as of 23:56, 11 June 2010

{{#icon: 2010SummerSchoolAmericas300.png|2010 GMOD Summer School - Americas 2010 GMOD Summer School - Americas}} GBrowse Session

2010 GMOD Summer School - Americas
May 6-9, 2010
Scott Cain

__NOTITLE__


There are several GBrowse tutorials:
GBrowse User Tutorial at OpenHelix
Demonstrates the GBrowse user interface.
GBrowse2 Admin Tutorial
Step by step guide on how to configure and load data into GBrowse. Administration tutorials are available for both the GBrowse2 Admin Tutorial, and the earlier 1.x versions.
GBrowse NGS Tutorial
Instructions on how to visualize next generation sequencing data in GBrowse using SAMtools. The tutorial includes a starting VMware image, and uses the example data that comes with SAMtools.
This tutorial
This tutorial was originally taught by Scott Cain at the 2010 GMOD Summer School - Americas. It walks you through setting up and running GBrowse with some sample data. It provides a VMware image to work on, and relies heavily on the GBrowse2 Admin Tutorial.



VMware

This tutorial was taught using a VMware system image as a starting point. If you want to start with that same system, download and install the Starting image.

See VMware for what software you need to use a VMware system image, and for directions on how to get the image setup and running on your machine.

Download
Starting Image

Ending Image

Logins
Purpose Username Password
Shell gmod gmodamericas2010
MySQL root gmodamericas2010


Caveats

Important Note

This tutorial describes the world as it existed on the day the tutorial was given. Please be aware that things like CPAN modules, Java libraries, and Linux packages change over time, and that the instructions in the tutorial will slowly drift over time. Newer versions of tutorials will be posted as they become available.

Prerequisites

Installed before using apt or cpan.

Install GBrowse

Easily installed via the cpan shell:

 sudo cpan
 cpan> install Bio::Graphics::Browser2

Which gets all of the prereqs that aren't installed on the machine.

Tutorial

Go to http://localhost/gbrowse



Basic Chado Configuration (if we have time)

Bio::DB::Das::Chado was installed when we created the image, but I've since released a new version, so we can install the new version with the cpan shell:

 sudo cpan
 cpan> install Bio::DB::Das::Chado</enter>

Simple config file in /etc/gbrowse2/pythium.conf

Some simple tweaks and additions:

  • fix the dbi string
  • add nucleotide matches
  • strip out stuff that is in /etc/gbrowse2/GBrowse.conf

Materialized views for searching

Chado comes with a tool to materialize views written by developers at the SOL Genomics Network (SGN). A materialized view is faster (at the expense of more disk space) to search than a regular view (which is really a query over potentially several tables). To create a materialized view that makes searching a GBrowse Chado instance a faster, we can do this:

 gmod_materialized_view_tool.pl -c

which will ask us several obscure questions for which we need to provide obscure answers:

 Give your materialized view a name (word characters only):
 all_feature_names
 Where will this MV be located? (schemaname.tablename):
 public.all_feature_names
 A view with this name already exists; do you want to replace it
 with a materialized view? [y|n]
 y
 How often, in seconds, should the MV be refreshed?
 You can also type 'daily', 'weekly', 'monthly' (30 days), or 'yearly' (365 days):
 weekly
 Enter specifications for the materialized view, OR provide a file in which
 the specs are written ('? for help):
 feature_id integer,name varchar(255)
 Enter the SQL query for the materialized view,
 or a file containing only the query:
 SELECT feature_id,CAST(substring(uniquename from 0 for 255) as varchar(255)) as name FROM feature UNION SELECT feature_id, name FROM feature where name is not null UNION SELECT fs.feature_id,s.name FROM feature_synonym fs, synonym s WHERE fs.synonym_id = s.synonym_id
 Enter a comma separated list of fields to index (or return for none):
 feature_id,name
 Enter the SQL queries for special indexes,
 or a file containing only the query (or return for none):
 create index all_feature_names_lower_name on all_feature_names (lower(name))
 Enter 'y' to confirm, 'n' to re-enter data:
 y