Skip to content

Commit

Permalink
Made Jason's SequenceDumper check that each format converter
Browse files Browse the repository at this point in the history
successfully loads before adding that format to the list.

Added examples of CDS and translation glyphs to wormbase and yeast
example conf files.
  • Loading branch information
lstein committed Jul 5, 2002
1 parent e5561df commit 5edb0c9
Show file tree
Hide file tree
Showing 7 changed files with 227 additions and 58 deletions.
2 changes: 2 additions & 0 deletions MANIFEST
Expand Up @@ -19,6 +19,7 @@ conf/02.wormbase.conf
conf/03.fly.conf
conf/04.human.conf
conf/05.embl.conf
conf/enzymes.txt
conf/plugins/FastaDumper.pm
conf/plugins/GFFDumper.pm
conf/plugins/OligoFinder.pm
Expand Down Expand Up @@ -69,6 +70,7 @@ htdocs/images/help/upload+edit.gif
htdocs/images/help/upload+remote.gif
htdocs/images/help/upload.gif
lib/Bio/DB/GFF/Aggregator/coding.pm
lib/Bio/DB/GFF/Aggregator/orf.pm
lib/Bio/DB/GFF/Aggregator/waba_alignment.pm
lib/Bio/DB/GFF/Aggregator/wormbase_gene.pm
lib/Bio/Graphics/Browser.pm
Expand Down
2 changes: 1 addition & 1 deletion Makefile.PL
Expand Up @@ -26,7 +26,7 @@ foreach (@argv) {
}

if (-e 'GGB.def' && !%OPTIONS) {
print STDERR "You have installed gbrowse before. Should I use the previous settings to set the file paths? ";
print STDERR "You have installed gbrowse before. Should I use the previous settings to set the file paths (y/n)? ";
chomp (my $line = <>);
if ($line =~ /^[yY]/) {
open F,'GGB.def' or die "GGB.def: $!";
Expand Down
55 changes: 47 additions & 8 deletions conf/01.yeast.conf
Expand Up @@ -3,7 +3,7 @@ description = S. cerevisae (via SGD Nov 2001)
adaptor = dbi::mysqlopt
database = dbi:mysql:database=yeast;host=localhost
# fasta_files =
aggregators = transcript alignment
aggregators = transcript alignment orf
user =
passwd =

Expand Down Expand Up @@ -55,7 +55,7 @@ footer = <hr>
</TR>
</table>
<hr>
<pre>$Id: 01.yeast.conf,v 1.3 2002-06-26 01:57:29 lstein Exp $</pre>
<pre>$Id: 01.yeast.conf,v 1.4 2002-07-05 13:53:10 lstein Exp $</pre>

# examples to show in the introduction
examples = II
Expand Down Expand Up @@ -90,6 +90,21 @@ height = 6
description = 1
key = ORF

[CDS]
feature = coding:sgd
glyph = cds
frame0f = cadetblue
frame1f = blue
frame2f = darkblue
frame0r = darkred
frame1r = red
frame2r = crimson
description = 0
height = 13
label = CDS frame
key = CDS
citation = This track shows CDS reading frames.

[tRNAs]
feature = tRNA:sgd
glyph = generic
Expand Down Expand Up @@ -124,13 +139,37 @@ glyph = anchored_arrow
height = 6
key = Long Terminal Repeats

[DNA]
glyph = dna
[TranslationF]
glyph = translation
global feature = 1
frame0 = cadetblue
frame1 = blue
frame2 = darkblue
height = 20
fgcolor = purple
strand = +1
translation = 3frame
key = 3-frame translation (forward)

[DNA/GC Content]
glyph = dna
global feature = 1
height = 40
do_gc = 1
fgcolor = red
axis_color = blue

[TranslationR]
glyph = translation
global feature = 1
height = 40
do_gc = 1
fgcolor = red
axis_color = blue
frame0 = darkred
frame1 = red
frame2 = crimson
height = 20
fgcolor = blue
strand = -1
translation = 3frame
key = 3-frame translation (reverse)

[ncRNA]
feature = RNA:sgd rRNA:sgd snRNA:sgd snoRNA:sgd
Expand Down
82 changes: 53 additions & 29 deletions conf/02.wormbase.conf
Expand Up @@ -4,7 +4,7 @@ adaptor = dbi::mysqlopt
database = dbi:mysql:database=wormbase;host=localhost
# fasta_files = /var/www/elegans
fasta_files =
aggregators = wormbase_gene clone alignment
aggregators = wormbase_gene clone alignment coding
user =
passwd =

Expand Down Expand Up @@ -48,15 +48,6 @@ fine zoom = 20%
overview landmarks = gene:framework
overview bgcolor = #93CBF4

#header = sub {
# use ElegansSubs 'PrintTop','PrintBottom';
# PrintTop(undef,undef,undef,
# '-Title' =>'Genome Browser',
# '-Target' =>'_top',
# '-Class' =>'search');
# '';
# }

footer = <hr>
<table width="100%">
<TR>
Expand All @@ -68,22 +59,7 @@ footer = <hr>
</TR>
</table>
<hr>
<pre>$Id: 02.wormbase.conf,v 1.3 2002-06-26 01:56:37 lstein Exp $</pre>

#footer = sub {
# PrintBottom();
# return '
# <hr>
# <table width="100%">
# <TR>
# <TD align="LEFT" class="databody">
# For the source code for this browser, see the <a href="http://www.gmod.org">
# Generic Model Organism Database Project.</a> For other questions, send
# mail to <a href="mailto:lstein@cshl.org">lstein@cshl.org</a>.
# </TD>
# </TR>
# </table>';
# }
<pre>$Id: 02.wormbase.conf,v 1.4 2002-07-05 13:53:10 lstein Exp $</pre>

# examples to show in the introduction
examples = IV
Expand All @@ -97,7 +73,16 @@ examples = IV
# "automatic" classes to try when an unqualified identifier is given
automatic classes = Locus PCR_Product WTP Genbank

# the remainder of the sections configure particular features to show
# List of remote annotation sources: format is URL/name pairs separated by
# white space. Please use quotation marks to prevent internal spaces from
# being interpreted.
remote sources = "Lincoln Stein's test 1" http://stein.cshl.org/~lstein/features.txt
"Lincoln Stein's test 2" http://stein.cshl.org/~lstein/features2.gff


##################################################################################
# the remainder of the sections configure particular tracks to show
##################################################################################

[tRNA]
feature = Sequence:tRNAscan-SE-1.11
Expand Down Expand Up @@ -128,7 +113,7 @@ glyph = wormbase_transcript
bgcolor = wheat
fgcolor = black
forwardcolor = violet
reversecolor = turquoise
reversecolor = indianred
font2color = red
height = 10
description = 1
Expand All @@ -137,8 +122,23 @@ citation = These are gene predictions that have been reviewed by WormBase cu
the CDS sections are represented. For 5' and 3' termini, please examine the paired
5' and 3' ESTs, full-length cDNAs, and Worm Transcriptome Project (WTP) gene extents.

[CDS]
feature = coding:curated
glyph = cds
frame0f = cadetblue
frame1f = blue
frame2f = darkblue
frame0r = darkred
frame1r = red
frame2r = crimson
description = 0
height = 13
label = CDS frame
key = CDS
citation = This track shows CDS reading frames.

[PG]
feature = transcript:NDB_CDS
feature = transcript:NDB_CDSl
glyph = transcript2
bgcolor = white
curatedexon = dodgerblue
Expand Down Expand Up @@ -432,6 +432,18 @@ key = Links & Superlinks
citation = This track shows the location of contigs created during the assembly
of the C. elegans genome.

[TranslationF]
glyph = translation
global feature = 1
frame0 = cadetblue
frame1 = blue
frame2 = darkblue
height = 20
fgcolor = purple
strand = +1
translation = 3frame
key = 3-frame translation (forward)

[DNA/GC Content]
glyph = dna
global feature = 1
Expand All @@ -440,6 +452,18 @@ do_gc = 1
fgcolor = red
axis_color = blue

[TranslationR]
glyph = translation
global feature = 1
frame0 = darkred
frame1 = red
frame2 = crimson
height = 20
fgcolor = blue
strand = -1
translation = 3frame
key = 3-frame translation (reverse)

[overview]
feature = gene:framework
label = 1
Expand Down
52 changes: 33 additions & 19 deletions conf/plugins/SequenceDumper.pm
@@ -1,4 +1,4 @@
# $Id: SequenceDumper.pm,v 1.2 2002-07-04 21:57:47 lstein Exp $
# $Id: SequenceDumper.pm,v 1.3 2002-07-05 13:53:10 lstein Exp $
#
# BioPerl module for Bio::Graphics::Browser::Plugin::SequenceDumper
#
Expand All @@ -12,7 +12,7 @@

=head1 NAME
Bio::Graphics::Browser::Plugin::SequenceDumper - A plugin for dumping
Bio::Graphics::Browser::Plugin::SequenceDumper - A plugin for dumping sequences in various formats
=head1 SYNOPSIS
Expand Down Expand Up @@ -50,7 +50,7 @@ Internal methods are usually preceded with a _


package Bio::Graphics::Browser::Plugin::SequenceDumper;
# $Id: SequenceDumper.pm,v 1.2 2002-07-04 21:57:47 lstein Exp $
# $Id: SequenceDumper.pm,v 1.3 2002-07-05 13:53:10 lstein Exp $
# Sequence Dumper plugin

use strict;
Expand All @@ -59,18 +59,32 @@ use Bio::SeqIO;
use Bio::Seq;
use CGI qw(:standard *pre);

use vars '$VERSION','@ISA', '%LABELS', '@ORDER';

%LABELS = ( 'fasta' => 'Fasta',
'genbank' => 'Genbank',
'embl' => 'EMBL',
'game' => 'GAME (XML)',
'bsml' => 'BSML (XML)',
'gcg' => 'GCG',
'raw' => 'Raw sequence'
);
use vars qw($VERSION @ISA);
use constant DEBUG => 0;

# module label is xml?
my @FORMATS = ( 'fasta' => ['Fasta', undef],
'genbank' => ['Genbank', undef],
'embl' => ['EMBL', undef],
'gcg' => ['GCG', undef],
'raw' => ['Raw sequence', undef],
'game' => ['GAME (XML)', 'xml'],
'bsml' => ['BSML (XML)', 'xml'],
);

# initialize @ORDER using the even-numbered elements of the array
# and grepping for those that load successfully (some of the
# modules depend on optional XML modules).
my @ORDER = grep {
my $module = "Bio::SeqIO::$_";
warn "trying to load $module\n" if DEBUG;
eval "require $module; 1";
}
map { $FORMATS[2*$_] } (0..@FORMATS/2-1);

@ORDER = qw(fasta genbank embl gcg raw game bsml);
# initialize %FORMATS and %LABELS from @FORMATS
my %FORMATS = @FORMATS;
my %LABELS = map { $_ => $FORMATS{$_}[0] } keys %FORMATS;

$VERSION = '0.11';

Expand All @@ -93,10 +107,10 @@ sub dump {
my %markuptype;
my $out = new Bio::SeqIO(-format => $config->{'fileformat'});
if ($config->{'format'} eq 'html') {
if ($config->{'fileformat'} =~ /^game|bsml$/i) {
if ($FORMATS{$config->{'fileformat'}}[1]) { # is xml
print header('text/xml');
$out->write_seq($segment);
} else {
} else {
print header('text/html');
print start_html($segment),h1($segment), start_pre;
$out->write_seq($segment);
Expand All @@ -105,8 +119,8 @@ sub dump {
}
} else {
print header('text/plain');
$out->write_seq($segment);
}
$out->write_seq($segment);
}
undef $out;
}

Expand Down Expand Up @@ -145,7 +159,7 @@ sub configure_form {
push @choices, TR({-class => 'searchtitle'},
th({-align=>'RIGHT',-width=>'25%'},"Sequence File Format",
td(popup_menu('-name' => "$objtype.fileformat",
'-values' => \@ORDER,
'-values' => \@ORDER,
'-labels' => \%LABELS,
'-default'=> $current_config->{'fileformat'} ))));
my $html= table(@choices);
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/DB/GFF/Aggregator/coding.pm
Expand Up @@ -88,7 +88,8 @@ None reported.
=head1 SEE ALSO
L<Bio::DB::GFF>, L<Bio::DB::GFF::Aggregator>, L<Bio::Graphics::Glyph::cds>
L<Bio::DB::GFF>, L<Bio::DB::GFF::orf>,
L<Bio::DB::GFF::Aggregator>, L<Bio::Graphics::Glyph::cds>,
=head1 AUTHOR
Expand Down

0 comments on commit 5edb0c9

Please sign in to comment.