From bugzilla-daemon at portal.open-bio.org Thu Jan 3 07:24:18 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 3 Jan 2008 07:24:18 -0500
Subject: [Bioperl-guts-l] [Bug 2427] New: error while using
Bio::Search::cross_match
Message-ID:
Query: 1 MSVNSNAYDAGIMGLKGKDFADQFFADENQVVHESDTVVLVLKKSDEINTFIEEILLTDY 60
MS++SNAY AGIM GK+FAD++FA+ENQVVHES+ VVLVLKKSDEIN ++EILL D
Sbjct: 1 MSLSSNAYGAGIMAKSGKEFADEYFAEENQVVHESNEVVLVLKKSDEINIIVDEILLGD- 59
Query: 61 KKNVNPTVNVEDRAGYWWIKANGKIEVDCDEISELLGRQFNVYDFLVDVSSTIGRAYTLG 120
+K+ NPT+ VEDRAGYWW+KA GKIEVDC+E+SELLGR F+VYDFLVDVSSTIGRA+TLG
Sbjct: 60 RKDENPTLVVEDRAGYWWLKATGKIEVDCEEVSELLGRTFSVYDFLVDVSSTIGRAFTLG 119
Query: 121 120
Sbjct: 120 119
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From bugzilla-daemon at portal.open-bio.org Fri Jan 11 14:36:42 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Fri, 11 Jan 2008 14:36:42 -0500
Subject: [Bioperl-guts-l] [Bug 2433] New: Please add quality score support
to Bio::DB::GenBank
Message-ID:
http://bugzilla.open-bio.org/show_bug.cgi?id=2433
Summary: Please add quality score support to Bio::DB::GenBank
Product: BioPerl
Version: 1.5 branch
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: bioperl-db
AssignedTo: bioperl-guts-l at bioperl.org
ReportedBy: pmiguel at purdue.edu
Chris Fields thinks that due to limitations in Bio::DB::GenBank, it is not
currently possible to download quality values from genbank records:
http://bioperl.org/pipermail/bioperl-l/2008-January/027031.html
Here is why I think this would be valuable and why, in principle, it is
possible:
No problem getting sequence from genbank via a myriad of methods. But as
the volume of non-finished sequence in genbank increases the importance
of also obtaining quality values for a given sequence increases. Some
records include quality values.
I typically use bp_fetch.pl to grab a sequence from genbank:
bp_fetch.pl -fmt fasta net::genbank:AC207960
sends the fasta sequence to STDOUT. But that bp_fetch.pl wasn't designed
to pull down quals evidently:
bp_fetch.pl -fmt qual net::genbank:AC207960
gives:
------------- EXCEPTION: Bio::Root::Exception -------------
MSG: You must pass a Bio::Seq::Quality or a Bio::Seq::PrimaryQual object
to write_seq() as a parameter named "source"
STACK: Error::throw
STACK: Bio::Root::Root::throw
/usr/local/perl_5.8/lib/site_perl/5.8.8/Bio/Root/Root.pm:359
STACK: Bio::SeqIO::qual::write_seq
/usr/local/perl_5.8/lib/site_perl/5.8.8/Bio/SeqIO/qual.pm:205
STACK: /usr/local/perl/bin/bp_fetch.pl:313
-----------------------------------------------------------
(running under bioperl 1.5.2)
The quality values for this accession are in genbank as these URLs
demonstrate:
http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?db=nuccore&id=154937460
http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?db=nuccore&list_uids=154937460&dopt=fasta
http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?db=nuccore&list_uids=154937460&dopt=qual
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From cjfields at dev.open-bio.org Mon Jan 14 00:31:06 2008
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Mon, 14 Jan 2008 00:31:06 -0500
Subject: [Bioperl-guts-l] [14437] bioperl-live/trunk/README: test
post-commit after fsfs transfer ( 2nd try)
Message-ID: <200801140531.m0E5V6lq030908@dev.open-bio.org>
Revision: 14437
Author: cjfields
Date: 2008-01-14 00:31:04 -0500 (Mon, 14 Jan 2008)
Log Message:
-----------
test post-commit after fsfs transfer (2nd try)
Modified Paths:
--------------
bioperl-live/trunk/README
Modified: bioperl-live/trunk/README
===================================================================
--- bioperl-live/trunk/README 2008-01-14 05:19:19 UTC (rev 14436)
+++ bioperl-live/trunk/README 2008-01-14 05:31:04 UTC (rev 14437)
@@ -252,3 +252,4 @@
may give you warnings or may not work at all (although we have tried
very hard to minimize this!). Send an email to the list and we'll be
happy to give you pointers.
+
From cjfields at dev.open-bio.org Tue Jan 15 14:25:35 2008
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Tue, 15 Jan 2008 14:25:35 -0500
Subject: [Bioperl-guts-l] [14438] bioperl-run/trunk/README: test
Message-ID: <200801151925.m0FJPZrT014343@dev.open-bio.org>
Revision: 14438
Author: cjfields
Date: 2008-01-15 14:25:33 -0500 (Tue, 15 Jan 2008)
Log Message:
-----------
test
Modified Paths:
--------------
bioperl-run/trunk/README
Modified: bioperl-run/trunk/README
===================================================================
--- bioperl-run/trunk/README 2008-01-14 05:31:04 UTC (rev 14437)
+++ bioperl-run/trunk/README 2008-01-15 19:25:33 UTC (rev 14438)
@@ -22,3 +22,4 @@
Write down any problems or praise and send them to
bioperl-l at bioperl.org ;-)
+
From bugzilla-daemon at portal.open-bio.org Tue Jan 15 16:50:13 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Tue, 15 Jan 2008 16:50:13 -0500
Subject: [Bioperl-guts-l] [Bug 2420] Bio::Index::Blast fails with blastall
2.2.16
In-Reply-To:
Message-ID: <200801152150.m0FLoD67032016@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2420
------- Comment #2 from cjfields at uiuc.edu 2008-01-15 16:50 EST -------
Josh, second chance. If we don't receive any example data/script we can't fix
the bug (and I have to rule this as invalid).
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From cjfields at dev.open-bio.org Tue Jan 15 16:56:49 2008
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Tue, 15 Jan 2008 16:56:49 -0500
Subject: [Bioperl-guts-l] [14439] bioperl-live/trunk/Bio/Tools/Primer3.pm:
Bug 2426
Message-ID: <200801152156.m0FLuneI015419@dev.open-bio.org>
Revision: 14439
Author: cjfields
Date: 2008-01-15 16:56:48 -0500 (Tue, 15 Jan 2008)
Log Message:
-----------
Bug 2426
Modified Paths:
--------------
bioperl-live/trunk/Bio/Tools/Primer3.pm
Modified: bioperl-live/trunk/Bio/Tools/Primer3.pm
===================================================================
--- bioperl-live/trunk/Bio/Tools/Primer3.pm 2008-01-15 19:25:33 UTC (rev 14438)
+++ bioperl-live/trunk/Bio/Tools/Primer3.pm 2008-01-15 21:56:48 UTC (rev 14439)
@@ -384,7 +384,7 @@
if ($tempkey =~ s/_(\d+)//) {
$location=$1;
if ($location > $maxlocation) {$maxlocation = $location}
- } elsif ( $tempkey =~ /PRIMER_(RIGHT|LEFT)/ ) {
+ } elsif ( $tempkey =~ /PRIMER_(RIGHT|LEFT)_SEQUENCE/ ) {
# first primers reported without a number, therefore set $location to 0
$location = 0;
if ($location > $maxlocation) {$maxlocation = $location}
From bugzilla-daemon at portal.open-bio.org Tue Jan 15 16:57:13 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Tue, 15 Jan 2008 16:57:13 -0500
Subject: [Bioperl-guts-l] [Bug 2426] Bio::Tools::Primer3 returns wrong
result count under certain situation
In-Reply-To:
Message-ID: <200801152157.m0FLvDjl032479@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2426
------- Comment #2 from cjfields at uiuc.edu 2008-01-15 16:57 EST -------
Fixed in Subversion. Thanks!
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From scain at dev.open-bio.org Tue Jan 15 21:46:08 2008
From: scain at dev.open-bio.org (Scott Cain)
Date: Tue, 15 Jan 2008 21:46:08 -0500
Subject: [Bioperl-guts-l] [14440] bioperl-live/trunk/Bio/SeqIO/genbank.pm:
fixing the missing space between the feature type name and the location
when the type name is longer than 15 char .
Message-ID: <200801160246.m0G2k82p016284@dev.open-bio.org>
Revision: 14440
Author: scain
Date: 2008-01-15 21:46:08 -0500 (Tue, 15 Jan 2008)
Log Message:
-----------
fixing the missing space between the feature type name and the location when the type name is longer than 15 char.
Modified Paths:
--------------
bioperl-live/trunk/Bio/SeqIO/genbank.pm
Modified: bioperl-live/trunk/Bio/SeqIO/genbank.pm
===================================================================
--- bioperl-live/trunk/Bio/SeqIO/genbank.pm 2008-01-15 21:56:48 UTC (rev 14439)
+++ bioperl-live/trunk/Bio/SeqIO/genbank.pm 2008-01-16 02:46:08 UTC (rev 14440)
@@ -1053,7 +1053,8 @@
if( ! ref $fth || ! $fth->isa('Bio::SeqIO::FTHelper') ) {
$fth->warn("$fth is not a FTHelper class. Attempting to print, but there could be tears!");
}
- $self->_write_line_GenBank_regex(sprintf(" %-16s",$fth->key),
+ my $spacer = (length $fth->key >= 15) ? ' ' : '';
+ $self->_write_line_GenBank_regex(sprintf(" %-16s%s",$fth->key,$spacer),
" "x21,
$fth->loc,"\,\|\$",80);
foreach my $tag ( keys %{$fth->field} ) {
From sendu at dev.open-bio.org Wed Jan 16 05:50:34 2008
From: sendu at dev.open-bio.org (Senduran Balasubramaniam)
Date: Wed, 16 Jan 2008 05:50:34 -0500
Subject: [Bioperl-guts-l] [14441] bioperl-run/trunk: first version of Gerp
wrapper, usable
Message-ID: <200801161050.m0GAoYWI017074@dev.open-bio.org>
Revision: 14441
Author: sendu
Date: 2008-01-16 05:50:33 -0500 (Wed, 16 Jan 2008)
Log Message:
-----------
first version of Gerp wrapper, usable
Added Paths:
-----------
bioperl-run/trunk/Bio/Tools/Run/Phylo/Gerp.pm
bioperl-run/trunk/t/Gerp.t
bioperl-run/trunk/t/data/gerp/
bioperl-run/trunk/t/data/gerp/ENr111.gerp.tree
bioperl-run/trunk/t/data/gerp/ENr111.mfa.gz
Added: bioperl-run/trunk/Bio/Tools/Run/Phylo/Gerp.pm
===================================================================
--- bioperl-run/trunk/Bio/Tools/Run/Phylo/Gerp.pm (rev 0)
+++ bioperl-run/trunk/Bio/Tools/Run/Phylo/Gerp.pm 2008-01-16 10:50:33 UTC (rev 14441)
@@ -0,0 +1,320 @@
+# $Id: Gerp.pm,v 1.3 2007/05/25 10:14:55 sendu Exp $
+#
+# BioPerl module for Bio::Tools::Run::Phylo::Gerp
+#
+# Cared for by Sendu Bala
+#
+# Copyright Sendu Bala
+#
+# You may distribute this module under the same terms as perl itself
+
+# POD documentation - main docs before the code
+
+=head1 NAME
+
+Bio::Tools::Run::Gerp - Wrapper for GERP
+
+=head1 SYNOPSIS
+
+ use Bio::Tools::Run::Phylo::Gerp;
+
+ # Make a Gerp factory
+ $factory = Bio::Tools::Run::Phylo::Gerp->new();
+
+ # Run Gerp with an alignment and tree file
+ my $parser = $factory->run($alignfilename, $treefilename);
+
+ # or with alignment object and tree object (which needs branch lengths)
+ $parser = $factory->run($bio_simplalign, $bio_tree_tree);
+
+ # (mixtures of the above are possible)
+
+ # look at the results
+ while (my $feat = $parser->next_result) {
+ my $start = $feat->start;
+ my $end = $feat->end;
+ my $rs_score = $feat->score;
+ my $p_value = ($feat->annotation->get_Annotations('p-value'))[0]->value;
+ }
+
+=head1 DESCRIPTION
+
+This is a wrapper for running the GERP (v2) programs 'gerpcol' and 'gerpelem' by
+Eugene Davydov (originally Gregory M. Cooper et al.). You can get details here:
+http://mendel.stanford.edu/sidowlab/. GERP can be used for phylogenetic
+footprinting/ shadowing (it finds 'constrained elements in multiple
+alignments').
+
+You can try supplying normal gerpcol/gerpelem command-line arguments to new(),
+eg. $factory->new(-e => 0.05) or calling arg-named methods, eg.
+$factory->e(0.05). The filename-related args (t, f, x) are handled internally
+by the run() method. This wrapper currently only supports running GERP on a
+single alignment at a time (ie. F isn't used at all, nor are multiple fs
+possible).
+
+
+You will need to enable this GERP wrapper to find the GERP executables.
+This can be done in (at least) three ways:
+
+ 1. Make sure gerpcol and gerpelem are in your path.
+ 2. Define an environmental variable GERPDIR which is a
+ directory which contains the GERP executables:
+ In bash:
+
+ export GERPDIR=/home/username/gerp/
+
+ In csh/tcsh:
+
+ setenv GERPDIR /home/username/gerp
+
+ 3. Include a definition of an environmental variable GERPDIR in
+ every script that will use this GERP wrapper module, e.g.:
+
+ BEGIN { $ENV{GERPDIR} = '/home/username/gerp/' }
+ use Bio::Tools::Run::Phylo::Gerp;
+
+=head1 FEEDBACK
+
+=head2 Mailing Lists
+
+User feedback is an integral part of the evolution of this and other
+Bioperl modules. Send your comments and suggestions preferably to
+the Bioperl mailing list. Your participation is much appreciated.
+
+ bioperl-l at bioperl.org - General discussion
+ http://bioperl.org/wiki/Mailing_lists - About the mailing lists
+
+=head2 Reporting Bugs
+
+Report bugs to the Bioperl bug tracking system to help us keep track
+of the bugs and their resolution. Bug reports can be submitted via
+the web:
+
+ http://bugzilla.open-bio.org/
+
+=head1 AUTHOR - Sendu Bala
+
+Email bix at sendu.me.uk
+
+=head1 APPENDIX
+
+The rest of the documentation details each of the object methods.
+Internal methods are usually preceded with a _
+
+=cut
+
+package Bio::Tools::Run::Phylo::Gerp;
+use strict;
+
+use Cwd;
+use File::Spec;
+use File::Basename;
+use Bio::AlignIO;
+use Bio::TreeIO;
+use Bio::Tools::Phylo::Gerp;
+
+use base qw(Bio::Tools::Run::Phylo::PhyloBase);
+
+our $PROGRAM_NAME = 'gerpcol';
+our $PROGRAM_DIR;
+
+# methods for the gerp args we support
+our @COLPARAMS = qw(r n s);
+our @ELEMPARAMS = qw(l L t d p b a c r e);
+our @SWITCHES = qw(v);
+
+# just to be explicit, args we don't support (yet) or we handle ourselves
+our @UNSUPPORTED = qw(h t f F x);
+
+BEGIN {
+ # lets add all the gerp executables to the path
+ $PROGRAM_DIR = $ENV{'GERPDIR'};
+ $ENV{PATH} = "$PROGRAM_DIR:$ENV{PATH}" if $PROGRAM_DIR;
+}
+
+=head2 program_name
+
+ Title : program_name
+ Usage : $factory>program_name()
+ Function: holds the program name
+ Returns : string
+ Args : None
+
+=cut
+
+sub program_name {
+ my $self = shift;
+ if (@_) { $self->{program_name} = shift }
+ return $self->{program_name} || $PROGRAM_NAME;
+}
+
+=head2 program_dir
+
+ Title : program_dir
+ Usage : $factory->program_dir(@params)
+ Function: returns the program directory, obtiained from ENV variable.
+ Returns : string
+ Args : None
+
+=cut
+
+sub program_dir {
+ return $PROGRAM_DIR;
+}
+
+=head2 new
+
+ Title : new
+ Usage : $factory = Bio::Tools::Run::Phylo::Gerp->new()
+ Function: creates a new GERP factory
+ Returns : Bio::Tools::Run::Phylo::Gerp
+ Args : Most options understood by GERP can be supplied as key =>
+ value pairs.
+
+ These options can NOT be used with this wrapper:
+ h, t, f, F and x
+
+=cut
+
+sub new {
+ my ($class, @args) = @_;
+ my $self = $class->SUPER::new(@args);
+
+ $self->_set_from_args(\@args, -methods => [@COLPARAMS, @ELEMPARAMS,
+ @SWITCHES, 'quiet'],
+ -create => 1);
+
+ return $self;
+}
+
+=head2 run
+
+ Title : run
+ Usage : $parser = $factory->run($align_file, $tree_file);
+ -or-
+ $parser = $factory->run($align_object, $tree_object);
+ Function: Runs GERP on an alignment.
+ Returns : Bio::Tools::Phylo::Gerp parser object, containing the results
+ Args : The first argument represents an alignment, the second argument
+ a phylogenetic tree with branch lengths.
+ The alignment can be provided as a MAF format alignment
+ filename, or a Bio::Align::AlignI complient object (eg. a
+ Bio::SimpleAlign).
+ The species tree can be provided as a newick format tree filename
+ or a Bio::Tree::TreeI complient object.
+
+ In all cases, the alignment sequence names must correspond to node
+ ids in the tree. Multi-word species names should have the
+ spaces replaced with underscores (eg. Homo_sapiens)
+
+=cut
+
+sub run {
+ my ($self, $aln, $tree) = @_;
+ $self->_alignment($aln || $self->throw("An alignment must be supplied"));
+ $self->_tree($tree || $self->throw("A phylo tree must be supplied"));
+
+ # check node and seq names match
+ $self->_check_names;
+
+ return $self->_run;
+}
+
+sub _run {
+ my $self = shift;
+
+ $self->executable || return;
+
+ # cd to a temp dir
+ my $temp_dir = $self->tempdir;
+ my $cwd = Cwd->cwd();
+ chdir($temp_dir) || $self->throw("Couldn't change to temp dir '$temp_dir'");
+
+ foreach my $prog ('gerpcol', 'gerpelem') {
+ delete $self->{'_pathtoexe'};
+ $self->program_name($prog);
+ my $exe = $self->executable || $self->throw("'$prog' executable not found");
+
+ my $command = $exe.$self->_setparams($prog);
+ $self->debug("gerp command = $command\n");
+
+ #eval {
+ # local $SIG{ALRM} = sub { die "alarm\n" };
+ # alarm 60;
+ # system($command) && $self->throw("gerp call ($command) failed: $! | $?");
+ # alarm 0;
+ #};
+ #die if $@ && $@ ne "alarm\n";
+ #if ($@) {
+ # die "Gerp timed out\n";
+ #}
+ #
+ # system("rm -fr $cwd/gerp_dir; cp -R $temp_dir $cwd/gerp_dir");
+
+ open(my $pipe, "$command |") || $self->throw("gerp call ($command) failed to start: $? | $!");
+ my $error = '';
+ my $warning = '';
+ while (<$pipe>) {
+ if ($self->quiet) {
+ $error .= $_;
+ $warning .= $_ if /warning/i;
+ }
+ else {
+ print;
+ }
+ }
+ close($pipe) || ($error ? $self->throw("gerp call ($command) failed: $error") : $self->throw("gerp call ($command) crashed: $?"));
+
+ # (throws most likely due to seg fault in gerpelem when ~25000 entries
+ # in rates file, not much I can do about it!)
+
+ $self->warn("GERP: ".$warning) if $warning;
+ }
+
+ #system("rm -fr $cwd/gerp_dir; cp -R $temp_dir $cwd/gerp_dir");
+
+ my $result_file = $self->{align_base}.'.rates.elems';
+ my $parser = Bio::Tools::Phylo::Gerp->new(-file => $result_file);
+
+ # cd back again
+ chdir($cwd) || $self->throw("Couldn't change back to working directory '$cwd'");
+
+ return $parser;
+}
+
+=head2 _setparams
+
+ Title : _setparams
+ Usage : Internal function, not to be called directly
+ Function: Creates a string of params to be used in the command string
+ Returns : string of params
+ Args : none
+
+=cut
+
+sub _setparams {
+ my ($self, $prog) = @_;
+
+ my $param_string;
+ if ($prog eq 'gerpcol') {
+ my $align_file = $self->_write_alignment;
+ $param_string .= ' -f '.$align_file;
+ $self->{align_base} = basename($align_file);
+ $param_string .= ' -t '.$self->_write_tree;
+ $param_string .= $self->SUPER::_setparams(-params => \@COLPARAMS,
+ -switches => \@SWITCHES,
+ -dash => 1);
+ }
+ else {
+ $param_string .= ' -f '.$self->{align_base}.'.rates';
+ $param_string .= $self->SUPER::_setparams(-params => \@ELEMPARAMS,
+ -switches => \@SWITCHES,
+ -dash => 1);
+ }
+
+ $param_string .= " 2>&1";
+
+ return $param_string;
+}
+
+1;
Property changes on: bioperl-run/trunk/Bio/Tools/Run/Phylo/Gerp.pm
___________________________________________________________________
Name: svn:executable
+ *
Added: bioperl-run/trunk/t/Gerp.t
===================================================================
--- bioperl-run/trunk/t/Gerp.t (rev 0)
+++ bioperl-run/trunk/t/Gerp.t 2008-01-16 10:50:33 UTC (rev 14441)
@@ -0,0 +1,93 @@
+# -*-Perl-*-
+## Bioperl Test Harness Script for Modules
+
+use strict;
+
+BEGIN {
+ eval {require Test::More;};
+ if ($@) {
+ use lib 't/lib';
+ }
+ use Test::More;
+
+ plan tests => 33;
+
+ use_ok('Bio::Tools::Run::Phylo::Gerp');
+ use_ok('Bio::AlignIO');
+ use_ok('Bio::TreeIO');
+ use_ok('Bio::Root::Utilities');
+}
+
+# setup input files etc
+my $alignfilename = File::Spec->catfile('t', 'data', 'gerp', 'ENr111.mfa.gz');
+my $treefilename = File::Spec->catfile('t', 'data', 'gerp', 'ENr111.gerp.tree');
+ok (-e $alignfilename, 'Found input alignment file');
+ok (-e $treefilename, 'Found input tree file');
+
+my $factory = Bio::Tools::Run::Phylo::Gerp->new(-verbose => -1,
+ -quiet => 1);
+isa_ok($factory, 'Bio::Tools::Run::Phylo::Gerp');
+ok $factory->can('e'), 'has a created method not in args supplied to new';
+is $factory->quiet, 1, 'quiet was set';
+
+# test default factory values
+is ($factory->program_dir, $ENV{'GERPDIR'}, 'program_dir returned correct default');
+is ($factory->program_name(), 'gerpcol', 'Correct exe default name');
+
+# test the program itself
+SKIP: {
+ skip("Couldn't find the gerp executable", 22) unless defined $factory->executable();
+
+ my $util = Bio::Root::Utilities->new();
+ $alignfilename = $util->uncompress(-file => $alignfilename,
+ -tmp => 1);
+
+ skip("Couldn't uncompress the alingment input file", 22) unless $alignfilename;
+
+ # using filename input
+ ok my $parser = $factory->run($alignfilename, $treefilename), 'got results using filename input';
+ my @result1;
+ while (my $result = $parser->next_result) {
+ push(@result1, $result);
+ }
+ ok close_enough(scalar(@result1), 121, 20), 'reasonable number of results using filename input';
+
+ # using SimpleAlign and Bio::Tree::Tree input
+ my $alignio = Bio::AlignIO->new(-file => $alignfilename);
+ my $aln = $alignio->next_aln;
+ my $treeio = Bio::TreeIO->new(-verbose => -1, -file => $treefilename);
+ my $tree = $treeio->next_tree;
+ ok $parser = $factory->run($aln, $tree), 'got results using object input';
+ my @result2;
+ while (my $result = $parser->next_result) {
+ push(@result2, $result);
+ }
+ ok close_enough(scalar(@result2), 121, 20), 'reasonable number of results using object input';
+
+ # spot-test the results
+ my @spot_results = ($result1[0], $result1[1], $result1[2]);
+
+ foreach my $expected ([294576, 294688, 56.5, 1.76552e-57],
+ [337735, 337898, 50.9, 3.19063e-57],
+ [285430, 285608, 44.3, 1.41149e-54]) {
+ my $feat = shift(@spot_results);
+ isa_ok $feat, 'Bio::SeqFeature::Annotated';
+ is $feat->source->value, 'GERP', 'correct source';
+ ok close_enough($feat->start, shift(@{$expected}), 10), 'feature start close enough';
+ ok close_enough($feat->end, shift(@{$expected}), 10), 'feature end close enough';
+ ok close_enough($feat->score, shift(@{$expected}), 5), 'feature score close enough';
+ my ($p_value) = $feat->get_Annotations('pvalue');
+ ok close_enough(ref $p_value ? $p_value->value : $p_value, shift(@{$expected}), 100e-57), 'feature pvalue close enough';
+ }
+}
+
+sub close_enough {
+ my ($actual, $expected, $variance) = @_;
+ return 1 if $actual == $expected;
+
+ if ($actual >= ($expected - $variance) &&
+ $actual <= ($expected + $variance)) {
+ return 1;
+ }
+ return 0;
+}
Added: bioperl-run/trunk/t/data/gerp/ENr111.gerp.tree
===================================================================
--- bioperl-run/trunk/t/data/gerp/ENr111.gerp.tree (rev 0)
+++ bioperl-run/trunk/t/data/gerp/ENr111.gerp.tree 2008-01-16 10:50:33 UTC (rev 14441)
@@ -0,0 +1 @@
+(platypus:0.13,monodelphis:0.152013,((elephant:0.05,tenrec:0.085):0.02,(armadillo:0.063747,((shrew:0.088,(rfbat:0.047,(dog:0.049162,cow:0.045317):0.000798):0.001802):0.004810,((rabbit:0.057760,(mouse:0.029443,rat:0.032846):0.085321):0.011253,(galago:0.044986,(marmoset:0.021531,((baboon:0.002469,macaque:0.002468):0.013886,(chimp:0.002271,human:0.002259):0.006817):0.005489):0.018117):0.004605):0.004931):0.011979):0.01):0.07);
Added: bioperl-run/trunk/t/data/gerp/ENr111.mfa.gz
===================================================================
(Binary files differ)
Property changes on: bioperl-run/trunk/t/data/gerp/ENr111.mfa.gz
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
From sendu at dev.open-bio.org Wed Jan 16 05:51:53 2008
From: sendu at dev.open-bio.org (Senduran Balasubramaniam)
Date: Wed, 16 Jan 2008 05:51:53 -0500
Subject: [Bioperl-guts-l] [14442] bioperl-live/trunk: first version of Gerp
parser, usable
Message-ID: <200801161051.m0GAprRr017105@dev.open-bio.org>
Revision: 14442
Author: sendu
Date: 2008-01-16 05:51:53 -0500 (Wed, 16 Jan 2008)
Log Message:
-----------
first version of Gerp parser, usable
Added Paths:
-----------
bioperl-live/trunk/Bio/Tools/Phylo/Gerp.pm
bioperl-live/trunk/t/data/ENr111.mfa.example.elems
bioperl-live/trunk/t/gerp.t
Added: bioperl-live/trunk/Bio/Tools/Phylo/Gerp.pm
===================================================================
--- bioperl-live/trunk/Bio/Tools/Phylo/Gerp.pm (rev 0)
+++ bioperl-live/trunk/Bio/Tools/Phylo/Gerp.pm 2008-01-16 10:51:53 UTC (rev 14442)
@@ -0,0 +1,147 @@
+# $Id: Gumby.pm,v 1.2 2007/06/14 18:01:52 nathan Exp $
+#
+# BioPerl module for Bio::Tools::Phylo::Gerp
+#
+# Cared for by Sendu Bala
+#
+# Copyright Sendu Bala
+#
+# You may distribute this module under the same terms as perl itself
+
+# POD documentation - main docs before the code
+
+=head1 NAME
+
+Bio::Tools::Phylo::Gerp - Parses output from GERP
+
+=head1 SYNOPSIS
+
+ use strict;
+
+ use Bio::Tools::Phylo::Gerp;
+
+ my $parser = Bio::Tools::Phylo::Gerp->new(-file => "alignment.rates.elems");
+
+ while (my $feat = $parser->next_result) {
+ my $start = $feat->start;
+ my $end = $feat->end;
+ my $rs_score = $feat->score;
+ my $p_value = ($feat->annotation->get_Annotations('p-value'))[0]->value;
+ }
+
+=head1 DESCRIPTION
+
+This module is used to parse the output from 'GERP' (v2) by Eugene Davydov
+(originally Gregory M. Cooper et al.). You can get details here:
+http://mendel.stanford.edu/sidowlab/
+
+It works on the .elems files produced by gerpelem.
+
+Each result is a Bio::SeqFeature::Annotated representing a single contrained
+element.
+
+=head1 FEEDBACK
+
+=head2 Mailing Lists
+
+User feedback is an integral part of the evolution of this and other
+Bioperl modules. Send your comments and suggestions preferably to
+the Bioperl mailing list. Your participation is much appreciated.
+
+ bioperl-l at bioperl.org - General discussion
+ http://bioperl.org/wiki/Mailing_lists - About the mailing lists
+
+=head2 Reporting Bugs
+
+Report bugs to the Bioperl bug tracking system to help us keep track
+of the bugs and their resolution. Bug reports can be submitted via the
+web:
+
+ http://bugzilla.open-bio.org/
+
+=head1 AUTHOR - Sendu Bala
+
+Email bix at sendu.me.uk
+
+=head1 APPENDIX
+
+The rest of the documentation details each of the object methods.
+Internal methods are usually preceded with a _
+
+=cut
+
+# Let the code begin...
+
+package Bio::Tools::Phylo::Gerp;
+use strict;
+
+use Bio::SeqFeature::Annotated;
+use Bio::Annotation::SimpleValue;
+
+use base qw(Bio::Root::Root Bio::Root::IO);
+
+
+=head2 new
+
+ Title : new
+ Usage : my $obj = Bio::Tools::Phylo::Gerp->new();
+ Function: Builds a new Bio::Tools::Phylo::Gerp object
+ Returns : Bio::Tools::Phylo::Gerp
+ Args : -file (or -fh) should contain the contents of a gerpelem .elems file
+
+=cut
+
+sub new {
+ my ($class, @args) = @_;
+ my $self = $class->SUPER::new(@args);
+
+ $self->_initialize_io(@args);
+
+ return $self;
+}
+
+=head2 next_result
+
+ Title : next_result
+ Usage : $result = $obj->next_result();
+ Function: Returns the next result available from the input, or undef if there
+ are no more results.
+ Returns : Bio::SeqFeature::Annotated object. Features are annotated with a tag
+ for 'pvalue', and a 'predicted' tag. They have no sequence id unless
+ the input GERP file is non-standard, with the seq id as the 6th
+ column.
+ Args : none
+
+=cut
+
+sub next_result {
+ my ($self) = @_;
+
+ my $line = $self->_readline || return;
+
+ while ($line !~ /^\d+\s+\d+\s+\d+\s+\S+\s+\S+\s*(?:\S+\s*)?$/) {
+ $line = $self->_readline || return;
+ }
+
+ #start end length RS-score p-value
+ # code elsewhere adds seq_id on the end (not valid GERP), so we capture that
+ # if present
+ my ($start, $end, undef, $rs_score, $p_value, $seq_id) = split(/\s+/, $line);
+ my $feat = Bio::SeqFeature::Annotated->new(
+ $seq_id ? (-seq_id => $seq_id) : (),
+ -start => $start,
+ -end => $end,
+ -strand => 1,
+ -score => $rs_score,
+ #-type => 'conserved_region', ***causes 740x increase in SeqFeatureDB storage requirments!
+ -source => 'GERP');
+
+ my $sv = Bio::Annotation::SimpleValue->new(-tagname => 'predicted', -value => 1);
+ $feat->annotation->add_Annotation($sv);
+ $sv = Bio::Annotation::SimpleValue->new(-tagname => 'pvalue', -value => $p_value);
+ $feat->annotation->add_Annotation($sv);
+
+ return $feat;
+}
+
+1;
Property changes on: bioperl-live/trunk/Bio/Tools/Phylo/Gerp.pm
___________________________________________________________________
Name: svn:executable
+ *
Added: bioperl-live/trunk/t/data/ENr111.mfa.example.elems
===================================================================
--- bioperl-live/trunk/t/data/ENr111.mfa.example.elems (rev 0)
+++ bioperl-live/trunk/t/data/ENr111.mfa.example.elems 2008-01-16 10:51:53 UTC (rev 14442)
@@ -0,0 +1,10 @@
+## Note that element detection relies on computing a false positive rate that uses random permutations of the original data.
+## Due to the stochastic nature of the permutations, you may see subtle differences from run to run.
+## Do not expect these test results to be precisely what you will get when you do your own run on the test dataset.
+
+500000 3.85
+334180 334352 173 449 1.03744e-165
+337735 337915 181 458.2 5.02405e-164
+262604 262861 258 473.1 3.64789e-117
+285427 285608 182 386.1 8.42494e-113
+309563 309744 182 383.6 2.88895e-111
Added: bioperl-live/trunk/t/gerp.t
===================================================================
--- bioperl-live/trunk/t/gerp.t (rev 0)
+++ bioperl-live/trunk/t/gerp.t 2008-01-16 10:51:53 UTC (rev 14442)
@@ -0,0 +1,36 @@
+# -*-Perl-*- Test Harness script for Bioperl
+# $Id: gerp.t,v 1.15 2007/06/27 10:16:38 sendu Exp $
+
+use strict;
+
+BEGIN {
+ use lib 't/lib';
+ use BioperlTest;
+
+ test_begin(-tests => 33);
+
+ use_ok('Bio::Tools::Phylo::Gerp');
+}
+
+ok my $parser = Bio::Tools::Phylo::Gerp->new(-file => test_input_file('ENr111.mfa.example.elems'));
+
+my $count = 0;
+my @expected = ([qw(334180 334352 449 1.03744e-165)],
+ [qw(337735 337915 458.2 5.02405e-164)],
+ [qw(262604 262861 473.1 3.64789e-117)],
+ [qw(285427 285608 386.1 8.42494e-113)],
+ [qw(309563 309744 383.6 2.88895e-111)]);
+while (my $feat = $parser->next_result) {
+ $count++;
+ my @exp = @{shift(@expected)};
+
+ isa_ok $feat, 'Bio::SeqFeature::Annotated';
+ is $feat->source->value, 'GERP', 'correct source';
+ is $feat->start, shift(@exp), 'feature start correct';
+ is $feat->end, shift(@exp), 'feature end correct';
+ is $feat->score, shift(@exp), 'feature score correct';
+ my ($p_value) = $feat->get_Annotations('pvalue');
+ is ref $p_value ? $p_value->value : $p_value, shift(@exp), 'feature pvalue correct';
+}
+
+is $count, 5, "correct number of results parsed out";
From sendu at dev.open-bio.org Wed Jan 16 05:54:01 2008
From: sendu at dev.open-bio.org (Senduran Balasubramaniam)
Date: Wed, 16 Jan 2008 05:54:01 -0500
Subject: [Bioperl-guts-l] [14443] bioperl-live/trunk/Bio/FeatureIO/bed.pm:
improved handling of different kinds of feature object
Message-ID: <200801161054.m0GAs1oB017136@dev.open-bio.org>
Revision: 14443
Author: sendu
Date: 2008-01-16 05:54:01 -0500 (Wed, 16 Jan 2008)
Log Message:
-----------
improved handling of different kinds of feature object
Modified Paths:
--------------
bioperl-live/trunk/Bio/FeatureIO/bed.pm
Modified: bioperl-live/trunk/Bio/FeatureIO/bed.pm
===================================================================
--- bioperl-live/trunk/Bio/FeatureIO/bed.pm 2008-01-16 10:51:53 UTC (rev 14442)
+++ bioperl-live/trunk/Bio/FeatureIO/bed.pm 2008-01-16 10:54:01 UTC (rev 14443)
@@ -184,6 +184,13 @@
} else {
$name = 'anonymous';
}
+
+ if (ref($name)) {
+ $name = $name->value;
+ }
+ if (ref($chrom)) {
+ $chrom = $chrom->value;
+ }
my $score = $feature->score || 0;
my $strand = $feature->strand == 0 ? '-' : '+'; #default to +
@@ -194,7 +201,7 @@
my $block_sizes = ''; #not implemented, used for sub features
my $block_starts = ''; #not implemented, used for sub features
- $self->_print(join("\t",($chrom->value,$chrom_start,$chrom_end,$name->value,$score,$strand,$thick_start,$thick_end,$reserved,$block_count,$block_sizes, $block_starts))."\n");
+ $self->_print(join("\t",($chrom,$chrom_start,$chrom_end,$name,$score,$strand,$thick_start,$thick_end,$reserved,$block_count,$block_sizes, $block_starts))."\n");
$self->write_feature($_) foreach $feature->get_SeqFeatures();
}
From bugzilla-daemon at portal.open-bio.org Wed Jan 16 21:19:23 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 16 Jan 2008 21:19:23 -0500
Subject: [Bioperl-guts-l] [Bug 2356] Bio::TreeIO::pag outputs
In-Reply-To:
Message-ID: <200801170219.m0H2JNh0031082@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2356
cjfields at uiuc.edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
------- Comment #1 from cjfields at uiuc.edu 2008-01-16 21:19 EST -------
This appears to be a problem with NEXUS tree parsing (Bio::TreeIO::nexus), not
with Bio::TreeIO::pag. Attaching some demo code.
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From bugzilla-daemon at portal.open-bio.org Wed Jan 16 21:23:11 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 16 Jan 2008 21:23:11 -0500
Subject: [Bioperl-guts-l] [Bug 2356] Bio::TreeIO::pag outputs
In-Reply-To:
Message-ID: <200801170223.m0H2NBMx031225@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2356
------- Comment #2 from cjfields at uiuc.edu 2008-01-16 21:23 EST -------
Created an attachment (id=845)
--> (http://bugzilla.open-bio.org/attachment.cgi?id=845&action=view)
simple demo script
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From bugzilla-daemon at portal.open-bio.org Wed Jan 16 21:23:52 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 16 Jan 2008 21:23:52 -0500
Subject: [Bioperl-guts-l] [Bug 2356] Bio::TreeIO::pag outputs
In-Reply-To:
Message-ID: <200801170223.m0H2NqHr031273@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2356
------- Comment #3 from cjfields at uiuc.edu 2008-01-16 21:23 EST -------
Created an attachment (id=846)
--> (http://bugzilla.open-bio.org/attachment.cgi?id=846&action=view)
NEXUS file (from bioperl test data)
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From cjfields at dev.open-bio.org Wed Jan 16 21:57:05 2008
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Wed, 16 Jan 2008 21:57:05 -0500
Subject: [Bioperl-guts-l] [14444]
bioperl-live/trunk/Bio/SearchIO/Writer/HTMLResultWriter.pm: bug 2431
Message-ID: <200801170257.m0H2v59A019054@dev.open-bio.org>
Revision: 14444
Author: cjfields
Date: 2008-01-16 21:57:04 -0500 (Wed, 16 Jan 2008)
Log Message:
-----------
bug 2431
Modified Paths:
--------------
bioperl-live/trunk/Bio/SearchIO/Writer/HTMLResultWriter.pm
Modified: bioperl-live/trunk/Bio/SearchIO/Writer/HTMLResultWriter.pm
===================================================================
--- bioperl-live/trunk/Bio/SearchIO/Writer/HTMLResultWriter.pm 2008-01-16 10:54:01 UTC (rev 14443)
+++ bioperl-live/trunk/Bio/SearchIO/Writer/HTMLResultWriter.pm 2008-01-17 02:57:04 UTC (rev 14444)
@@ -417,7 +417,7 @@
length($hspvals[2]->{'start'}),
length($hspvals[2]->{'end'}));
my $count = 0;
- while ( $count <= $hsp->length('total') ) {
+ while ( $count < $hsp->length('total') ) {
foreach my $v ( @hspvals ) {
my $piece = substr($v->{'seq'}, $v->{'index'} + $count,
$AlignmentLineWidth);
From bugzilla-daemon at portal.open-bio.org Wed Jan 16 22:01:02 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 16 Jan 2008 22:01:02 -0500
Subject: [Bioperl-guts-l] [Bug 2431] BLAST HTMLWriter makes empty lines
In-Reply-To:
Message-ID: <200801170301.m0H312e8000415@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2431
cjfields at uiuc.edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Comment #4 from cjfields at uiuc.edu 2008-01-16 22:01 EST -------
Fix committed. To get this go here, click on the 'Checkout' link, and save to
your local installation:
http://code.open-bio.org/svnweb/index.cgi/bioperl/view/bioperl-live/trunk/Bio/SearchIO/Writer/HTMLResultWriter.pm
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From bugzilla-daemon at portal.open-bio.org Wed Jan 16 22:22:18 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 16 Jan 2008 22:22:18 -0500
Subject: [Bioperl-guts-l] [Bug 2428] GenPept Taxon SEQIO problem
In-Reply-To:
Message-ID: <200801170322.m0H3MIsE001376@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2428
cjfields at uiuc.edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WORKSFORME
------- Comment #1 from cjfields at uiuc.edu 2008-01-16 22:22 EST -------
This has been fixed and should be present in the latest version, which can be
retrieved using Subversion.
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From bugzilla-daemon at portal.open-bio.org Wed Jan 16 22:24:21 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 16 Jan 2008 22:24:21 -0500
Subject: [Bioperl-guts-l] [Bug 2430] SeqIO wrong parse of Species and
Taxonomic Class in GBK, fix proposed
In-Reply-To:
Message-ID: <200801170324.m0H3OLNc001464@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2430
cjfields at uiuc.edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
------- Comment #2 from cjfields at uiuc.edu 2008-01-16 22:24 EST -------
This is a duplicate of bug 2195.
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From bugzilla-daemon at portal.open-bio.org Wed Jan 16 22:24:23 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 16 Jan 2008 22:24:23 -0500
Subject: [Bioperl-guts-l] [Bug 2428] GenPept Taxon SEQIO problem
In-Reply-To:
Message-ID: <200801170324.m0H3ONqO001476@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2428
Bug 2428 depends on bug 2430, which changed state.
Bug 2430 Summary: SeqIO wrong parse of Species and Taxonomic Class in GBK, fix proposed
http://bugzilla.open-bio.org/show_bug.cgi?id=2430
What |Old Value |New Value
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From cjfields at dev.open-bio.org Thu Jan 17 01:09:34 2008
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Thu, 17 Jan 2008 01:09:34 -0500
Subject: [Bioperl-guts-l] [14445] bioperl-live/trunk: bug 2423
Message-ID: <200801170609.m0H69YdR019309@dev.open-bio.org>
Revision: 14445
Author: cjfields
Date: 2008-01-17 01:09:34 -0500 (Thu, 17 Jan 2008)
Log Message:
-----------
bug 2423
Modified Paths:
--------------
bioperl-live/trunk/Bio/Tools/Glimmer.pm
bioperl-live/trunk/t/Genpred.t
Modified: bioperl-live/trunk/Bio/Tools/Glimmer.pm
===================================================================
--- bioperl-live/trunk/Bio/Tools/Glimmer.pm 2008-01-17 02:57:04 UTC (rev 14444)
+++ bioperl-live/trunk/Bio/Tools/Glimmer.pm 2008-01-17 06:09:34 UTC (rev 14445)
@@ -462,15 +462,15 @@
# Glimmer 2.X prediction
(/^\s+(\d+)\s+ # gene num
(\d+)\s+(\d+)\s+ # start, end
- \[([\+\-])\d{1}\s+ # strand
+ \[([\+\-])(\d{1})\s+ # strand, frame
/ox ) ||
# Glimmer 3.X prediction
(/^[^\d]+(\d+)\s+ # orf (numeric portion)
(\d+)\s+(\d+)\s+ # start, end
- ([\+\-])\d{1}\s+ # strand
+ ([\+\-])(\d{1})\s+ # strand, frame
([\d\.]+) # score
/ox)) {
- my ($genenum,$start,$end,$strand,$score) =
+ my ($genenum,$start,$end,$strand,$frame,$score) =
( $1,$2,$3,$4,$5 );
my $circular_prediction = 0;
@@ -545,11 +545,15 @@
my $location_object =
$location_factory->from_string($location_string);
+ # convert glimmer's frame range from 1-3 to SeqFeature's 0-2.
+ $frame--;
+
my $gene = Bio::SeqFeature::Generic->new
(
'-seq_id' => $seqname,
'-location' => $location_object,
'-strand' => $strand eq '-' ? '-1' : '1',
+ '-frame' => $frame,
'-source_tag' => $source,
'-display_name' => "orf$genenum",
'-primary_tag'=> 'gene',
Modified: bioperl-live/trunk/t/Genpred.t
===================================================================
--- bioperl-live/trunk/t/Genpred.t 2008-01-17 02:57:04 UTC (rev 14444)
+++ bioperl-live/trunk/t/Genpred.t 2008-01-17 06:09:34 UTC (rev 14445)
@@ -7,7 +7,7 @@
use lib 't/lib';
use BioperlTest;
- test_begin(-tests => 157);
+ test_begin(-tests => 163);
use_ok('Bio::Tools::Genscan');
use_ok('Bio::Tools::Genemark');
@@ -203,6 +203,7 @@
is($g2gene->primary_tag, 'gene');
is($g2gene->start, 292);
is($g2gene->end, 1623);
+is($g2gene->frame, 0);
is($g2gene->strand, 1);
$i = 1;
@@ -212,6 +213,7 @@
is($g2gene->start, 2230);
is($g2gene->end, 2349);
is($g2gene->strand, -1);
+ is($g2gene->frame, 0);
} elsif ($i == 25) {
isa_ok($g2gene->location, 'Bio::Location::SplitLocationI');
my @sublocations = $g2gene->location->sub_Location();
@@ -221,6 +223,7 @@
is($sublocations[1]->start, 1);
is($sublocations[1]->end, 9);
is($g2gene->strand, 1);
+ is($g2gene->frame, 0);
}
}
is($i, 25);
@@ -242,7 +245,7 @@
is($sublocations[0]->end, 29940);
is($sublocations[1]->start, 1);
is($sublocations[1]->end, 9);
-is($g3gene->strand, 1);
+is($g3gene->frame, 0);
$i = 1;
while ($g3gene = $glimmer_3->next_prediction) {
@@ -251,6 +254,8 @@
is($g3gene->start, 13804);
is($g3gene->end, 14781);
is($g3gene->strand, -1);
+ is($g3gene->frame, 0);
+
my ($orfid) = $g3gene->has_tag('Group') ? $g3gene->get_tag_values('Group') : undef;
is($orfid, 'GenePrediction_00015');
}
@@ -271,12 +276,14 @@
is $g3gene_a->location->max_start(), 1;
is $g3gene_a->location->end_pos_type(), 'EXACT';
is $g3gene_a->location->end(), 674;
+is $g3gene_a->frame(), 2;
for (1..3) { $g3gene_a = $glimmer_3a->next_prediction; }
isa_ok $g3gene_a->location(), 'Bio::Location::Fuzzy';
is $g3gene_a->location->start_pos_type(), 'EXACT';
is $g3gene_a->location->start(), 2677;
+is $g3gene_a->frame(), 0;
is $g3gene_a->location->end_pos_type(), 'AFTER';
is $g3gene_a->location->min_end(), 2932;
From bugzilla-daemon at portal.open-bio.org Thu Jan 17 01:10:40 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 17 Jan 2008 01:10:40 -0500
Subject: [Bioperl-guts-l] [Bug 2423] Bio::Tools::Glimmer - frame support for
Glimmer2/3 parser
In-Reply-To:
Message-ID: <200801170610.m0H6AemF009279@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2423
cjfields at uiuc.edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Comment #2 from cjfields at uiuc.edu 2008-01-17 01:10 EST -------
Patch accepted. I also added some tests to Genpred.t. Thanks!
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From sendu at dev.open-bio.org Thu Jan 17 06:08:19 2008
From: sendu at dev.open-bio.org (Senduran Balasubramaniam)
Date: Thu, 17 Jan 2008 06:08:19 -0500
Subject: [Bioperl-guts-l] [14446] bioperl-live/trunk/Bio/Tree/Compatible.pm:
fixed synopsis code to work
Message-ID: <200801171108.m0HB8JvG019965@dev.open-bio.org>
Revision: 14446
Author: sendu
Date: 2008-01-17 06:08:19 -0500 (Thu, 17 Jan 2008)
Log Message:
-----------
fixed synopsis code to work
Modified Paths:
--------------
bioperl-live/trunk/Bio/Tree/Compatible.pm
Modified: bioperl-live/trunk/Bio/Tree/Compatible.pm
===================================================================
--- bioperl-live/trunk/Bio/Tree/Compatible.pm 2008-01-17 06:09:34 UTC (rev 14445)
+++ bioperl-live/trunk/Bio/Tree/Compatible.pm 2008-01-17 11:08:19 UTC (rev 14446)
@@ -20,11 +20,11 @@
use Bio::Tree::Compatible;
use Bio::TreeIO;
my $input = Bio::TreeIO->new('-format' => 'newick',
- '-file' => 'input.tre');
+ '-file' => 'input.tre');
my $t1 = $input->next_tree;
my $t2 = $input->next_tree;
- my ($incompat, $ilabels, $inodes) = $t1->is_compatible($t2);
+ my ($incompat, $ilabels, $inodes) = Bio::Tree::Compatible::is_compatible($t1,$t2);
if ($incompat) {
my %cluster1 = %{ $t1->cluster_representation };
my %cluster2 = %{ $t2->cluster_representation };
From sendu at dev.open-bio.org Thu Jan 17 06:15:53 2008
From: sendu at dev.open-bio.org (Senduran Balasubramaniam)
Date: Thu, 17 Jan 2008 06:15:53 -0500
Subject: [Bioperl-guts-l] [14447] bioperl-live/trunk/Bio/Tree/Compatible.pm:
more fixes for synopsis code, added warning to description
Message-ID: <200801171115.m0HBFrRv019996@dev.open-bio.org>
Revision: 14447
Author: sendu
Date: 2008-01-17 06:15:53 -0500 (Thu, 17 Jan 2008)
Log Message:
-----------
more fixes for synopsis code, added warning to description
Modified Paths:
--------------
bioperl-live/trunk/Bio/Tree/Compatible.pm
Modified: bioperl-live/trunk/Bio/Tree/Compatible.pm
===================================================================
--- bioperl-live/trunk/Bio/Tree/Compatible.pm 2008-01-17 11:08:19 UTC (rev 14446)
+++ bioperl-live/trunk/Bio/Tree/Compatible.pm 2008-01-17 11:15:53 UTC (rev 14447)
@@ -26,8 +26,8 @@
my ($incompat, $ilabels, $inodes) = Bio::Tree::Compatible::is_compatible($t1,$t2);
if ($incompat) {
- my %cluster1 = %{ $t1->cluster_representation };
- my %cluster2 = %{ $t2->cluster_representation };
+ my %cluster1 = %{ Bio::Tree::Compatible::cluster_representation($t1) };
+ my %cluster2 = %{ Bio::Tree::Compatible::cluster_representation($t2) };
print "incompatible trees\n";
if (scalar(@$ilabels)) {
foreach my $label (@$ilabels) {
@@ -57,6 +57,10 @@
=head1 DESCRIPTION
+NB: This module has exclusively class methods that work on Bio::Tree::TreeI
+objects. An instance of Bio::Tree::Compatible cannot itself represent a tree,
+and so typically there is no need to create one.
+
Bio::Tree::Compatible is a Perl tool for testing compatibility of
phylogenetic trees with nested taxa represented as Bio::Tree::Tree
objects. It is based on a recent characterization of ancestral
From bugzilla-daemon at portal.open-bio.org Thu Jan 17 08:24:12 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 17 Jan 2008 08:24:12 -0500
Subject: [Bioperl-guts-l] [Bug 2356] Bio::TreeIO::pag outputs (NEXUS parsing)
In-Reply-To:
Message-ID: <200801171324.m0HDOCYx000565@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2356
cjfields at uiuc.edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Bio::TreeIO::pag outputs |Bio::TreeIO::pag outputs
| |(NEXUS parsing)
------- Comment #4 from cjfields at uiuc.edu 2008-01-17 08:24 EST -------
Modify summary to reflect bug.
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From bugzilla-daemon at portal.open-bio.org Thu Jan 17 12:13:48 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 17 Jan 2008 12:13:48 -0500
Subject: [Bioperl-guts-l] [Bug 2424] Out of memory on SeqIO
In-Reply-To:
Message-ID: <200801171713.m0HHDm88016267@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2424
------- Comment #3 from cjfields at uiuc.edu 2008-01-17 12:13 EST -------
I downloaded nc1220.gnp.gz and parsed it using bioperl-live w/o seeing any
significant memory leak; the same results were seen using perl 5.8.8 and perl
5.10. It's possible this was fixed post-1.5.2, so I would recommend
downloading the latest code from Subversion.
Seeing as you have Leopard installed (which comes with svn), you can get the
latest code this way:
svn co svn://code.open-bio.org/bioperl/bioperl-live/trunk bioperl-live
This will check out the latest core code into a bioperl-live directory. You
can then install it directly, add it to PERL5LIB, or add a 'use lib' directive
including the bioperl-live directory. It's possible you'll need to install the
Developer Tools to get svn (I'm not sure).
If the above fixes the error you can close this out, otherwise I'll give it a
month and close if I don't hear back.
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From bugzilla-daemon at portal.open-bio.org Thu Jan 17 12:14:38 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 17 Jan 2008 12:14:38 -0500
Subject: [Bioperl-guts-l] [Bug 2426] Bio::Tools::Primer3 returns wrong
result count under certain situation
In-Reply-To:
Message-ID: <200801171714.m0HHEcRe016355@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2426
cjfields at uiuc.edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Comment #3 from cjfields at uiuc.edu 2008-01-17 12:14 EST -------
Thought I closed this. Oops!
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From cjfields at dev.open-bio.org Thu Jan 17 12:35:00 2008
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Thu, 17 Jan 2008 12:35:00 -0500
Subject: [Bioperl-guts-l] [14448]
bioperl-live/trunk/Bio/SearchIO/cross_match.pm: Tentative fix for bug 2427
Message-ID: <200801171735.m0HHZ02s023580@dev.open-bio.org>
Revision: 14448
Author: cjfields
Date: 2008-01-17 12:35:00 -0500 (Thu, 17 Jan 2008)
Log Message:
-----------
Tentative fix for bug 2427
Modified Paths:
--------------
bioperl-live/trunk/Bio/SearchIO/cross_match.pm
Modified: bioperl-live/trunk/Bio/SearchIO/cross_match.pm
===================================================================
--- bioperl-live/trunk/Bio/SearchIO/cross_match.pm 2008-01-17 11:15:53 UTC (rev 14447)
+++ bioperl-live/trunk/Bio/SearchIO/cross_match.pm 2008-01-17 17:35:00 UTC (rev 14448)
@@ -121,8 +121,8 @@
} elsif(/^(\d+) matching entries/) {
$self->{'_end_document'} = 1;
return;
- } elsif(($start || $self->{'_result_count'}) && /^ (\d+)/) {
- $self->{'_result_count'} ++;
+ } elsif(($start || $self->{'_result_count'}) && /^\s+(\d+)/xms) {
+ $self->{'_result_count'}++;
return $self->_parse($_);
} elsif(! $self->{_parameters}) {
if(/.*?\s+(\-.*?)$/) {
From bugzilla-daemon at portal.open-bio.org Thu Jan 17 12:39:57 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 17 Jan 2008 12:39:57 -0500
Subject: [Bioperl-guts-l] [Bug 2427] error while using
Bio::Search::cross_match
In-Reply-To:
Message-ID: <200801171739.m0HHdvnb018313@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2427
------- Comment #2 from cjfields at uiuc.edu 2008-01-17 12:39 EST -------
I committed a fix which can be found here (you may have to give it some time to
sync with the dev repository):
http://code.open-bio.org/svnweb/index.cgi/bioperl/checkout/bioperl-live/trunk/Bio/SearchIO/cross_match.pm
I haven't extensively tested this; unfortunately there aren't any cross_match
tests set up yet in core.
I'll leave this open for now until we can get some tests added; I may use your
example to get the ball rolling.
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From cjfields at dev.open-bio.org Thu Jan 17 13:11:38 2008
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Thu, 17 Jan 2008 13:11:38 -0500
Subject: [Bioperl-guts-l] [14449] bioperl-live/trunk/t: Starter cross_match
tests and sample data.
Message-ID: <200801171811.m0HIBcrA024635@dev.open-bio.org>
Revision: 14449
Author: cjfields
Date: 2008-01-17 13:11:38 -0500 (Thu, 17 Jan 2008)
Log Message:
-----------
Starter cross_match tests and sample data. Needs much more testing (see notes in test file)
Added Paths:
-----------
bioperl-live/trunk/t/cross_match.t
bioperl-live/trunk/t/data/testdata.crossmatch
Added: bioperl-live/trunk/t/cross_match.t
===================================================================
--- bioperl-live/trunk/t/cross_match.t (rev 0)
+++ bioperl-live/trunk/t/cross_match.t 2008-01-17 18:11:38 UTC (rev 14449)
@@ -0,0 +1,62 @@
+# -*-Perl-*- Test Harness script for Bioperl
+# $Id: cross_match.t 11788 2007-12-03 23:37:59Z jason $
+
+use strict;
+
+BEGIN {
+ use lib 't/lib';
+ use BioperlTest;
+
+ test_begin(-tests => 15);
+
+ use_ok('Bio::SearchIO');
+}
+
+my ($searchio, $result,$iter,$hit,$hsp);
+
+# The cross_match SearchIO parser is not event-based; it directly adds
+# information to the relevant Bio::Search objects as the report is parsed.
+# The parser currently misses much information present in the report. Also,
+# methods expected to work somehow don't (hsp->length('hsp'), for instance).
+# Unsure if this parses non-alignment-based cross-match reports accurately
+# (see bioperl-live/t/data/consed_project/edit_dir/test_project.screen.out for
+# an example).
+
+# Note lots of ResultI/HitI/HSPI methods not tested yet!
+
+$searchio = Bio::SearchIO->new('-format' => 'cross_match',
+ '-file' => test_input_file('testdata.crossmatch'));
+
+$result = $searchio->next_result;
+
+is($result->algorithm, 'cross_match');
+is($result->algorithm_version, '0.990329');
+
+my @valid = ( [ 'msx1_ens2', 0]);
+my $count = 0;
+while( $hit = $result->next_hit ) {
+ my $d = shift @valid;
+
+ is($hit->name, shift @$d);
+ is($hit->length, shift @$d);
+
+ if( $count == 0 ) {
+ my $hsps_left = 1;
+ while( my $hsp = $hit->next_hsp ) {
+ is($hsp->query->start, 19);
+ is($hsp->query->end, 603);
+ is($hsp->hit->start, 2824);
+ is($hsp->hit->end, 3409);
+ #is($hsp->length('hsp'), 820); # shouldn't this work?
+ is($hsp->start('hit'), $hsp->hit->start);
+ is($hsp->end('query'), $hsp->query->end);
+ is($hsp->strand('sbjct'), $hsp->subject->strand);# alias for hit
+ is($hsp->gaps, 0);
+ $hsps_left--;
+ }
+ is($hsps_left, 0);
+ }
+ last if( $count++ > @valid );
+}
+
+is(@valid, 0);
Property changes on: bioperl-live/trunk/t/cross_match.t
___________________________________________________________________
Name: svn:eol-style
+ native
Added: bioperl-live/trunk/t/data/testdata.crossmatch
===================================================================
--- bioperl-live/trunk/t/data/testdata.crossmatch (rev 0)
+++ bioperl-live/trunk/t/data/testdata.crossmatch 2008-01-17 18:11:38 UTC (rev 14449)
@@ -0,0 +1,98 @@
+cross_match 34_1_5_MSX1DF.seq msx1_ens2.fasta -alignments
+cross_match version 0.990329
+
+Run date:time 080103:101214
+Query file(s): 34_1_5_MSX1DF.seq
+Subject file(s): msx1_ens2.fasta
+Presumed sequence type: DNA
+
+Pairwise comparison algorithm: banded Smith-Waterman
+
+Score matrix (set by value of penalty: -2)
+ A C G T N X
+A 1 -2 -2 -2 0 -3
+C -2 1 -2 -2 0 -3
+G -2 -2 1 -2 0 -3
+T -2 -2 -2 1 0 -3
+N 0 0 0 0 0 0
+X -3 -3 -3 -3 0 -3
+
+Gap penalties: gap_init: -4, gap_ext: -3, ins_gap_ext: -3, del_gap_ext: -3,
+Using complexity-adjusted scores. Assumed background frequencies:
+ A: 0.250 C: 0.250 G: 0.250 T: 0.250 N: 0.000 X: 0.000
+
+minmatch: 14, maxmatch: 14, max_group_size: 20, minscore: 30, bandwidth: 14, indexwordsize: 10
+vector_bound: 0
+word_raw: 0
+masklevel: 80
+
+Sequence file: 34_1_5_MSX1DF.seq 1 entries
+Residue counts:
+ A 123
+ C 148
+ G 170
+ N 1
+ T 161
+Total 603
+
+NO QUALITY FILE 34_1_5_MSX1DF.seq.qual WAS FOUND. REMAINING INPUT QUALITIES SET TO 15.
+Maximal single base matches (low complexity regions):
+
+ 538 1.37 0.51 0.34 C:\Program 19 603 (0) msx1_ens2 2824 3409 (3856)
+
+ C:\Program 19 TCCCAA-CGTCTAAGACTGAGCCATTAA-GTGGACTCCAGGTGCCCAAGG 66
+ - i -
+ msx1_ens2 2824 TCCCAAACGTCTAGGACTGAGCCATTAAAGTGGACTCCAGGTGCCCAAGG 2873
+
+ C:\Program 67 CGGTTCGCTCCAAGGCCTCACGGCCCCCTGGCTGCTCTACTCAGAGAACA 116
+
+ msx1_ens2 2874 CGGTTCGCTCCAAGGCCTCACGGCCCCCTGGCTGCTCTACTCAGAGAACA 2923
+
+ C:\Program 117 CGCTCGGAGATATTTCAGGAGCACGGGAAATTCCCAAGTTTTCCTCGTTT 166
+
+ msx1_ens2 2924 CGCTCGGAGATATTTCAGGAGCACGGGAAATTCCCAAGTTTTCCTCGTTT 2973
+
+ C:\Program 167 CCTCCGATTATTTTGCTCGGCATAATAGCAGCCAGATTTCAATGGCGTGA 216
+
+ msx1_ens2 2974 CCTCCGATTATTTTGCTCGGCATAATAGCAGCCAGATTTCAATGGCGTGA 3023
+
+ C:\Program 217 TGCTGAGGAATGATTTTTATCTGGGGATTAAACGTCTTTGAAAGGCCAGT 266
+
+ msx1_ens2 3024 TGCTGAGGAATGATTTTTATCTGGGGATTAAACGTCTTTGAAAGGCCAGT 3073
+
+ C:\Program 267 CCCTCCCTAAGCCTAATGGCCGGAGAAGGTGGCCCCGCTCTGGGTTGTCG 316
+
+ msx1_ens2 3074 CCCTCCCTAAGCCTAATGGCCGGAGAAGGTGGCCCCGCTCTGGGTTGTCG 3123
+
+ C:\Program 317 CCGCTGAAGGGAGTGACGTTTCTCTCGGCGCCCGCCCCTCGGGCGGCCCG 366
+
+ msx1_ens2 3124 CCGCTGAAGGGAGTGACGTTTCTCTCGGCGCCCGCCCCTCGGGCGGCCCG 3173
+
+ C:\Program 367 GCGGAAAGCTAGTTGGGGGCCAAGCGCTTCCCGGACTCCCGGTGGCCTCC 416
+
+ msx1_ens2 3174 GCGGAAAGCTAGTTGGGGGCCAAGCGCTTCCCGGACTCCCGGTGGCCTCC 3223
+
+ C:\Program 417 AGCAGGGAAGAAGCGGGGTGTTAACACGAGATTTCGTTTTGACTCACATC 466
+ -
+ msx1_ens2 3224 AGCAGGGAAGAAGCGGGGTGTTAACACGAGATTTCGTTT-GACTCACATC 3272
+
+ C:\Program 467 CTGGTGGTCTGAAAGTCCAAAGGATCGTTGTGTTTTCTTTGTTTAGTCAT 516
+ v iv
+ msx1_ens2 3273 CTGGTGGTCTGAAAGTCCAAAGGATCGTTGTGTTTTCTTTGTTTTGTTTT 3322
+
+ C:\Program 517 GTTTNTTCTGTTTGTTTGTGGTTGTTTTTTAGAGAGGTGTGAAAAAATGC 566
+ ?
+ msx1_ens2 3323 GTTTTTTCTGTTTGTTTGTGGTTGTTTTTTAGAGAGGTGTGAAAAAATGC 3372
+
+ C:\Program 567 ATACTTAGGGCAAAACCGCGGTGGTGAA-CATCTTCGA 603
+ - vvv -
+ msx1_ens2 3373 ATACTTAGG-CAAAACCCGCGTGGTGAAACATCTTCGA 3409
+
+Transitions / transversions = 0.40 (2 / 5)
+Gap_init rate = 0.01 (5 / 586), avg. gap size = 1.00 (5 / 5)
+
+
+1 matching entries (first file).
+
+Discrepancy summary:
+Qual algn cum rcum (%) unalgn X N sub del ins total (%) cum rcum (%)
Property changes on: bioperl-live/trunk/t/data/testdata.crossmatch
___________________________________________________________________
Name: svn:eol-style
+ native
From bugzilla-daemon at portal.open-bio.org Thu Jan 17 13:54:23 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 17 Jan 2008 13:54:23 -0500
Subject: [Bioperl-guts-l] [Bug 2433] Please add quality score support to
Bio::DB::GenBank
In-Reply-To:
Message-ID: <200801171854.m0HIsN1x023417@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2433
------- Comment #1 from cjfields at uiuc.edu 2008-01-17 13:54 EST -------
The bug is in the bp_fetch.pl script; using Bio:DB::GenBank directly works.
I'll try to add this to bp_fetch, but you can use the following as well:
use Bio::DB::GenBank;
use Bio::SeqIO;
my $acc = shift || die;
my $format = 'qual';
my $factory = Bio::DB::GenBank->new(-format => $format);
my $out = Bio::SeqIO->new(-format => $format,
-fh => \*STDOUT);
my $seq = $factory->get_Seq_by_acc($acc);
$out->write_seq($seq);
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From cjfields at dev.open-bio.org Thu Jan 17 13:58:46 2008
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Thu, 17 Jan 2008 13:58:46 -0500
Subject: [Bioperl-guts-l] [14450]
bioperl-live/trunk/scripts/index/bp_fetch.PLS: bug 2433
Message-ID: <200801171858.m0HIwkVn025361@dev.open-bio.org>
Revision: 14450
Author: cjfields
Date: 2008-01-17 13:58:46 -0500 (Thu, 17 Jan 2008)
Log Message:
-----------
bug 2433
Modified Paths:
--------------
bioperl-live/trunk/scripts/index/bp_fetch.PLS
Modified: bioperl-live/trunk/scripts/index/bp_fetch.PLS
===================================================================
--- bioperl-live/trunk/scripts/index/bp_fetch.PLS 2008-01-17 18:11:38 UTC (rev 14449)
+++ bioperl-live/trunk/scripts/index/bp_fetch.PLS 2008-01-17 18:58:46 UTC (rev 14450)
@@ -228,12 +228,12 @@
$_ = $meta;
/^net$/ && do {
if( $db =~ /genbank/i ) {
- $dbobj = Bio::DB::GenBank->new();
+ $dbobj = Bio::DB::GenBank->new(-format => $fmt);
}
elsif( $db =~ /genpept/i ) {
$dbobj = Bio::DB::GenPept->new();
} elsif( $db =~ /embl/i ) {
- $dbobj = Bio::DB::EMBL->new();
+ $dbobj = Bio::DB::EMBL->new(-format => $fmt);
} else {
die "Net database $db not available";
}
@@ -309,10 +309,3 @@
$out->write_seq($seq);
}
-
-
-
-
-
-
-
From bugzilla-daemon at portal.open-bio.org Thu Jan 17 14:00:14 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 17 Jan 2008 14:00:14 -0500
Subject: [Bioperl-guts-l] [Bug 2433] Please add quality score support to
Bio::DB::GenBank
In-Reply-To:
Message-ID: <200801171900.m0HJ0EQb023663@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2433
cjfields at uiuc.edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Comment #2 from cjfields at uiuc.edu 2008-01-17 14:00 EST -------
Committed a fix to bp_fetch.PLS. Retrieve it here (you may want to wait for
about an hour):
http://code.open-bio.org/svnweb/index.cgi/bioperl/checkout/bioperl-live/trunk/scripts/index/bp_fetch.PLS
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From bugzilla-daemon at portal.open-bio.org Thu Jan 17 14:12:40 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 17 Jan 2008 14:12:40 -0500
Subject: [Bioperl-guts-l] [Bug 2415] Wrong tree coloring by
Tree::Draw::Cladogram
In-Reply-To:
Message-ID: <200801171912.m0HJCeHj024443@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2415
------- Comment #2 from cjfields at uiuc.edu 2008-01-17 14:12 EST -------
The fix is relatively straightforward but without a demonstration or example
code I am reluctant to commit this.
Before we accept your patched version we'll need a script and data
demonstrating the issue.
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From cjfields at dev.open-bio.org Thu Jan 17 14:26:34 2008
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Thu, 17 Jan 2008 14:26:34 -0500
Subject: [Bioperl-guts-l] [14451]
bioperl-live/trunk/scripts/index/bp_fetch.PLS: remove format option for
EMBL just in case...
Message-ID: <200801171926.m0HJQYh2025513@dev.open-bio.org>
Revision: 14451
Author: cjfields
Date: 2008-01-17 14:26:34 -0500 (Thu, 17 Jan 2008)
Log Message:
-----------
remove format option for EMBL just in case...
Modified Paths:
--------------
bioperl-live/trunk/scripts/index/bp_fetch.PLS
Modified: bioperl-live/trunk/scripts/index/bp_fetch.PLS
===================================================================
--- bioperl-live/trunk/scripts/index/bp_fetch.PLS 2008-01-17 18:58:46 UTC (rev 14450)
+++ bioperl-live/trunk/scripts/index/bp_fetch.PLS 2008-01-17 19:26:34 UTC (rev 14451)
@@ -233,7 +233,7 @@
elsif( $db =~ /genpept/i ) {
$dbobj = Bio::DB::GenPept->new();
} elsif( $db =~ /embl/i ) {
- $dbobj = Bio::DB::EMBL->new(-format => $fmt);
+ $dbobj = Bio::DB::EMBL->new();
} else {
die "Net database $db not available";
}
From bugzilla-daemon at portal.open-bio.org Thu Jan 17 23:24:25 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 17 Jan 2008 23:24:25 -0500
Subject: [Bioperl-guts-l] [Bug 2069] Bio::Tools:pSW stop codon bug
In-Reply-To:
Message-ID: <200801180424.m0I4OPLE020246@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2069
------- Comment #3 from cjfields at uiuc.edu 2008-01-17 23:24 EST -------
Bio::Tools::pSW appears sensitive to odd compile-time issues which affect the
alignment produced; this only appears to occur when '*' is present. Not sure
what's causing them beyond it having something to do with the BEGIN block in
Bio::Tools::pSW and the inheritance tree. Using certain modules also cause the
same problem. I'll see if I can come up with a script to demo the error.
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From bugzilla-daemon at portal.open-bio.org Thu Jan 17 23:38:17 2008
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 17 Jan 2008 23:38:17 -0500
Subject: [Bioperl-guts-l] [Bug 2069] Bio::Tools:pSW stop codon bug
In-Reply-To:
Message-ID: <200801180438.m0I4cH7L020930@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2069
------- Comment #4 from cjfields at uiuc.edu 2008-01-17 23:38 EST -------
Created an attachment (id=847)
--> (http://bugzilla.open-bio.org/attachment.cgi?id=847&action=view)
test script
This script demos the bug and the odd compile-time issues (tested on Mac OSX
Leopard, perl 5.8.8 and 5.10). Running the script as is gets one alignment,
but uncommenting one or both 'use' statements changes the results. Maybe
something to do with AUTOLOAD and symbol generation (I'm not sure but it's
odd).
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
From cjfields at dev.open-bio.org Mon Jan 21 17:41:33 2008
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Mon, 21 Jan 2008 17:41:33 -0500
Subject: [Bioperl-guts-l] [14452] bioperl-live/trunk/Build.PL: Use db
settings for both BioDBGFF and BioDBSeqFeature_mysql ( needs bypass testing
for Pg and other drivers)
Message-ID: <200801212241.m0LMfXkA005799@dev.open-bio.org>
Revision: 14452
Author: cjfields
Date: 2008-01-21 17:41:33 -0500 (Mon, 21 Jan 2008)
Log Message:
-----------
Use db settings for both BioDBGFF and BioDBSeqFeature_mysql (needs bypass testing for Pg and other drivers)
Modified Paths:
--------------
bioperl-live/trunk/Build.PL
Modified: bioperl-live/trunk/Build.PL
===================================================================
--- bioperl-live/trunk/Build.PL 2008-01-17 19:26:34 UTC (rev 14451)
+++ bioperl-live/trunk/Build.PL 2008-01-21 22:41:33 UTC (rev 14452)
@@ -15,6 +15,8 @@
our @drivers;
+my $mysql_ok = 0;
+
# Set up the ModuleBuildBioperl object
my $build = ModuleBuildBioperl->new(
module_name => 'Bio',
@@ -90,7 +92,7 @@
BioDBSeqFeature_mysql => {
description => "MySQL tests for Bio::DB::SeqFeature::Store",
feature_requires => { 'DBI' => 0, 'DBD::mysql' => 0 },
- test => \&test_db
+ test => \&test_db_sf
},
Network => {
description => "Enable tests that need an internet connection",
@@ -105,17 +107,18 @@
#script_files => [] # scripts in scripts directory are installed on-demand
);
+prompt_for_biodb() if $build->feature('BioDBGFF') || $build->feature('BioDBSeqFeature_mysql');
+
# Handle auto features
if ($build->feature('BioDBSeqFeature_BDB')) {
make_bdb_test();
}
-if ($build->feature('BioDBSeqFeature_mysql')) {
+if ($build->feature('BioDBSeqFeature_mysql') && $mysql_ok) {
make_dbi_test();
}
# Ask questions
$build->choose_scripts;
-prompt_for_biodbgff() if $build->feature('BioDBGFF');
{
if ($build->args('network')) {
if ($build->feature('Network')) {
@@ -147,7 +150,6 @@
exit;
-
sub make_bdb_test {
my $path0 = File::Spec->catfile('t', 'BioDBSeqFeature.t');
my $path = File::Spec->catfile('t', 'BioDBSeqFeature_BDB.t');
@@ -160,20 +162,30 @@
$build->add_to_manifest_skip($path);
}
-sub test_db {
+sub test_db_sf {
eval {require DBI;}; # if not installed, this sub won't actually be called
- unless (eval {DBI->connect('dbi:mysql:test',undef,undef,{RaiseError=>0,PrintError=>0})}) {
- return "Could not connect to test database";
+ @drivers = DBI->available_drivers;
+ unless (grep {/mysql/i} @drivers) {
+ $mysql_ok = 0;
+ return "Only MySQL DBI driver supported for BioDBSeqFeature_mysql tests";
}
+ $mysql_ok = 1;
return;
}
sub make_dbi_test {
my $path0 = File::Spec->catfile('t', 'BioDBSeqFeature.t');
my $path = File::Spec->catfile('t', 'BioDBSeqFeature_mysql.t');
+ my $test_db = $build->notes('test_db');
+ my $dsn = $build->notes('test_dsn');
+ my $user = $build->notes('test_user');
+ my $pass = $build->notes('test_pass');
open my $F,">$path";
+ my $str = "$path0 -adaptor DBI::mysql -create 1 -temp 1 -dsn $dsn";
+ $str .= " -user $user" if $user;
+ $str .= " -password $pass" if $pass;
print $F <add_to_cleanup($path);
@@ -189,8 +201,10 @@
return;
}
-sub prompt_for_biodbgff {
- my $proceed = $build->y_n("Do you want to run the BioDBGFF live database tests? y/n", 'n');
+sub prompt_for_biodb {
+ my $proceed = $build->y_n("Do you want to run the BioDBGFF or ".
+ "BioDBSeqFeature_mysql live database tests? ".
+ "y/n", 'n');
if ($proceed) {
my @driver_choices;
@@ -214,9 +228,11 @@
$driver = 'mysql';
}
elsif ($driver =~ /^[pP]/) {
+ $mysql_ok = 0;
$driver = 'Pg';
}
elsif ($driver =~ /^[oO]/) {
+ $mysql_ok = 0;
$driver = 'Oracle';
}
@@ -248,12 +264,14 @@
$build->notes(test_pass => $test_pass eq 'undef' ? undef : $test_pass);
$build->notes(test_dsn => $test_dsn);
- $build->log_info(" - will run the BioDBGFF tests with database driver '$driver' and these settings:\n",
+ $build->log_info(" - will run tests with database driver '$driver' and these settings:\n",
" Database $test_db\n",
" Host $test_host\n",
" DSN $test_dsn\n",
" User $test_user\n",
" Password $test_pass\n");
+ $build->log_info(" - will not run the BioDBSeqFeature_mysql live ".
+ "database tests (requires MySQL driver)\n") unless $mysql_ok;
}
else {
$build->log_info(" - will not run the BioDBGFF live database tests\n");
From cjfields at dev.open-bio.org Mon Jan 21 18:57:48 2008
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Mon, 21 Jan 2008 18:57:48 -0500
Subject: [Bioperl-guts-l] [14453]
bioperl-live/trunk/Bio/SeqIO/entrezgene.pm: get rid of annoying '
pseudohashes' error; tests now pass on perl 5.8.8, perl 5.10
Message-ID: <200801212357.m0LNvmL8005947@dev.open-bio.org>
Revision: 14453
Author: cjfields
Date: 2008-01-21 18:57:48 -0500 (Mon, 21 Jan 2008)
Log Message:
-----------
get rid of annoying 'pseudohashes' error; tests now pass on perl 5.8.8, perl 5.10
Modified Paths:
--------------
bioperl-live/trunk/Bio/SeqIO/entrezgene.pm
Modified: bioperl-live/trunk/Bio/SeqIO/entrezgene.pm
===================================================================
--- bioperl-live/trunk/Bio/SeqIO/entrezgene.pm 2008-01-21 22:41:33 UTC (rev 14452)
+++ bioperl-live/trunk/Bio/SeqIO/entrezgene.pm 2008-01-21 23:57:48 UTC (rev 14453)
@@ -104,7 +104,7 @@
#use Bio::Ontology::Ontology; Relationships.... later
use Bio::Ontology::Term;
use Bio::Annotation::OntologyTerm;
-#use Data::Dumper;
+use Data::Dumper;
use base qw(Bio::SeqIO);
@@ -443,9 +443,11 @@
my (%cann, at feat, at uncaptured, at comments, at sfann);
if ((ref($prod) eq 'HASH') && (exists($prod->{comment}))) {
$prod=$prod->{comment};
- }
- if (ref($prod) eq 'ARRAY') { @comments=@{$prod}; }
- else {push @comments,$prod;}
+ } elsif (ref($prod) eq 'ARRAY') {
+ @comments=@{$prod};
+ } else {
+ push @comments,$prod;
+ }
for my $i (0..$#comments) {#Each comments is a
my ($desc,$nfeat,$add, at ann, at comm);
my $comm=$comments[$i];
@@ -488,7 +490,7 @@
else {
push @comm,$comm;
}
- foreach my $ccomm (@comm) {
+ for my $ccomm (@comm) {
next unless ($ccomm);
if (exists($ccomm->{source})) {
my ($uncapt,$allann,$anchor) = _process_src($ccomm->{source});
@@ -506,51 +508,51 @@
else {
push @loc,$ccomm;
}
- foreach my $loc (@loc) {
- if ((exists($loc->{text}))&&($loc->{text}=~/Location/i)){
- my ($l1,$rest)=split(/-/,$loc->{text});
- $l1=~s/\D//g;
- $rest=~s/^\s//;
- my ($l2,$scorestr)=split(/\s/,$rest,2);
- my ($scoresrc,$score)=split(/:/,$scorestr);
- $score=~s/\D//g;
- my (%tags,$tag);
- unless ($l1) {
- next;
- }
- $nfeat=Bio::SeqFeature::Generic->new(-start=>$l1,
- -end=>$l2,
- -strand=>$tags{strand},
- -source=>$loc->{type},
- -seq_id=>$desc,
- -primary=>$heading,
- -score=>$score,
- -tag => {score_src=>$scoresrc});
- my $sfeatann=Bio::Annotation::Collection->new();
- foreach my $sfann (@sfann) {
- $sfeatann->add_Annotation('dblink',$sfann);
- }
- undef @sfann;
- $nfeat->annotation($sfeatann);#Thus the annotation will be available both in the seq and seqfeat?
- push @feat,$nfeat;
- delete $loc->{text};
- delete $loc->{type};
- }
- elsif (exists($loc->{label})) {
- my $simann=Bio::Annotation::SimpleValue->new(-value=>$loc->{text},-tagname=>$loc->{label});
- delete $loc->{text};
- delete $loc->{label};
- push @{$cann{'simple'}},$simann;
- push @uncaptured,$loc;
- }
- elsif (exists($loc->{text})) {
- my $simann=Bio::Annotation::SimpleValue->new(-value=>$loc->{text},-tagname=>$heading);
- delete $loc->{text};
- push @{$cann{'simple'}},$simann;
- push @uncaptured,$loc;
- }
-
- }
+ foreach my $loc (@loc) {
+ if ((exists($loc->{text}))&&($loc->{text}=~/Location/i)){
+ my ($l1,$rest)=split(/-/,$loc->{text});
+ $l1=~s/\D//g;
+ $rest=~s/^\s//;
+ my ($l2,$scorestr)=split(/\s/,$rest,2);
+ my ($scoresrc,$score)=split(/:/,$scorestr);
+ $score=~s/\D//g;
+ my (%tags,$tag);
+ unless ($l1) {
+ next;
+ }
+ $nfeat=Bio::SeqFeature::Generic->new(-start=>$l1,
+ -end=>$l2,
+ -strand=>$tags{strand},
+ -source=>$loc->{type},
+ -seq_id=>$desc,
+ -primary=>$heading,
+ -score=>$score,
+ -tag => {score_src=>$scoresrc});
+ my $sfeatann=Bio::Annotation::Collection->new();
+ foreach my $sfann (@sfann) {
+ $sfeatann->add_Annotation('dblink',$sfann);
+ }
+ undef @sfann;
+ $nfeat->annotation($sfeatann);#Thus the annotation will be available both in the seq and seqfeat?
+ push @feat,$nfeat;
+ delete $loc->{text};
+ delete $loc->{type};
+ }
+ elsif (exists($loc->{label})) {
+ my $simann=Bio::Annotation::SimpleValue->new(-value=>$loc->{text},-tagname=>$loc->{label});
+ delete $loc->{text};
+ delete $loc->{label};
+ push @{$cann{'simple'}},$simann;
+ push @uncaptured,$loc;
+ }
+ elsif (exists($loc->{text})) {
+ my $simann=Bio::Annotation::SimpleValue->new(-value=>$loc->{text},-tagname=>$heading);
+ delete $loc->{text};
+ push @{$cann{'simple'}},$simann;
+ push @uncaptured,$loc;
+ }
+
+ }
}#Bit clumsy but that's what we get from the low level parser
}
}
From cjfields at dev.open-bio.org Mon Jan 21 19:16:02 2008
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Mon, 21 Jan 2008 19:16:02 -0500
Subject: [Bioperl-guts-l] [14454]
bioperl-live/trunk/Bio/SeqIO/entrezgene.pm: revert last commit;
problem more serious than initially appears (will require more debugging)
Message-ID: <200801220016.m0M0G2YI005980@dev.open-bio.org>
Revision: 14454
Author: cjfields
Date: 2008-01-21 19:16:02 -0500 (Mon, 21 Jan 2008)
Log Message:
-----------
revert last commit; problem more serious than initially appears (will require more debugging)
Modified Paths:
--------------
bioperl-live/trunk/Bio/SeqIO/entrezgene.pm
Modified: bioperl-live/trunk/Bio/SeqIO/entrezgene.pm
===================================================================
--- bioperl-live/trunk/Bio/SeqIO/entrezgene.pm 2008-01-21 23:57:48 UTC (rev 14453)
+++ bioperl-live/trunk/Bio/SeqIO/entrezgene.pm 2008-01-22 00:16:02 UTC (rev 14454)
@@ -104,7 +104,7 @@
#use Bio::Ontology::Ontology; Relationships.... later
use Bio::Ontology::Term;
use Bio::Annotation::OntologyTerm;
-use Data::Dumper;
+#use Data::Dumper;
use base qw(Bio::SeqIO);
@@ -443,11 +443,9 @@
my (%cann, at feat, at uncaptured, at comments, at sfann);
if ((ref($prod) eq 'HASH') && (exists($prod->{comment}))) {
$prod=$prod->{comment};
- } elsif (ref($prod) eq 'ARRAY') {
- @comments=@{$prod};
- } else {
- push @comments,$prod;
- }
+ }
+ if (ref($prod) eq 'ARRAY') { @comments=@{$prod}; }
+ else {push @comments,$prod;}
for my $i (0..$#comments) {#Each comments is a
my ($desc,$nfeat,$add, at ann, at comm);
my $comm=$comments[$i];
@@ -490,7 +488,7 @@
else {
push @comm,$comm;
}
- for my $ccomm (@comm) {
+ foreach my $ccomm (@comm) {
next unless ($ccomm);
if (exists($ccomm->{source})) {
my ($uncapt,$allann,$anchor) = _process_src($ccomm->{source});
@@ -508,51 +506,51 @@
else {
push @loc,$ccomm;
}
- foreach my $loc (@loc) {
- if ((exists($loc->{text}))&&($loc->{text}=~/Location/i)){
- my ($l1,$rest)=split(/-/,$loc->{text});
- $l1=~s/\D//g;
- $rest=~s/^\s//;
- my ($l2,$scorestr)=split(/\s/,$rest,2);
- my ($scoresrc,$score)=split(/:/,$scorestr);
- $score=~s/\D//g;
- my (%tags,$tag);
- unless ($l1) {
- next;
- }
- $nfeat=Bio::SeqFeature::Generic->new(-start=>$l1,
- -end=>$l2,
- -strand=>$tags{strand},
- -source=>$loc->{type},
- -seq_id=>$desc,
- -primary=>$heading,
- -score=>$score,
- -tag => {score_src=>$scoresrc});
- my $sfeatann=Bio::Annotation::Collection->new();
- foreach my $sfann (@sfann) {
- $sfeatann->add_Annotation('dblink',$sfann);
- }
- undef @sfann;
- $nfeat->annotation($sfeatann);#Thus the annotation will be available both in the seq and seqfeat?
- push @feat,$nfeat;
- delete $loc->{text};
- delete $loc->{type};
- }
- elsif (exists($loc->{label})) {
- my $simann=Bio::Annotation::SimpleValue->new(-value=>$loc->{text},-tagname=>$loc->{label});
- delete $loc->{text};
- delete $loc->{label};
- push @{$cann{'simple'}},$simann;
- push @uncaptured,$loc;
- }
- elsif (exists($loc->{text})) {
- my $simann=Bio::Annotation::SimpleValue->new(-value=>$loc->{text},-tagname=>$heading);
- delete $loc->{text};
- push @{$cann{'simple'}},$simann;
- push @uncaptured,$loc;
- }
-
- }
+ foreach my $loc (@loc) {
+ if ((exists($loc->{text}))&&($loc->{text}=~/Location/i)){
+ my ($l1,$rest)=split(/-/,$loc->{text});
+ $l1=~s/\D//g;
+ $rest=~s/^\s//;
+ my ($l2,$scorestr)=split(/\s/,$rest,2);
+ my ($scoresrc,$score)=split(/:/,$scorestr);
+ $score=~s/\D//g;
+ my (%tags,$tag);
+ unless ($l1) {
+ next;
+ }
+ $nfeat=Bio::SeqFeature::Generic->new(-start=>$l1,
+ -end=>$l2,
+ -strand=>$tags{strand},
+ -source=>$loc->{type},
+ -seq_id=>$desc,
+ -primary=>$heading,
+ -score=>$score,
+ -tag => {score_src=>$scoresrc});
+ my $sfeatann=Bio::Annotation::Collection->new();
+ foreach my $sfann (@sfann) {
+ $sfeatann->add_Annotation('dblink',$sfann);
+ }
+ undef @sfann;
+ $nfeat->annotation($sfeatann);#Thus the annotation will be available both in the seq and seqfeat?
+ push @feat,$nfeat;
+ delete $loc->{text};
+ delete $loc->{type};
+ }
+ elsif (exists($loc->{label})) {
+ my $simann=Bio::Annotation::SimpleValue->new(-value=>$loc->{text},-tagname=>$loc->{label});
+ delete $loc->{text};
+ delete $loc->{label};
+ push @{$cann{'simple'}},$simann;
+ push @uncaptured,$loc;
+ }
+ elsif (exists($loc->{text})) {
+ my $simann=Bio::Annotation::SimpleValue->new(-value=>$loc->{text},-tagname=>$heading);
+ delete $loc->{text};
+ push @{$cann{'simple'}},$simann;
+ push @uncaptured,$loc;
+ }
+
+ }
}#Bit clumsy but that's what we get from the low level parser
}
}
From lstein at dev.open-bio.org Tue Jan 22 15:48:43 2008
From: lstein at dev.open-bio.org (Lincoln Stein)
Date: Tue, 22 Jan 2008 15:48:43 -0500
Subject: [Bioperl-guts-l] [14455]
bioperl-live/trunk/Bio/Graphics/Glyph/gene.pm: fixed up the gene glyph so
that it works properly with CDS-only genes
Message-ID: <200801222048.m0MKmhiI007977@dev.open-bio.org>
Revision: 14455
Author: lstein
Date: 2008-01-22 15:48:42 -0500 (Tue, 22 Jan 2008)
Log Message:
-----------
fixed up the gene glyph so that it works properly with CDS-only genes
Modified Paths:
--------------
bioperl-live/trunk/Bio/Graphics/Glyph/gene.pm
Modified: bioperl-live/trunk/Bio/Graphics/Glyph/gene.pm
===================================================================
--- bioperl-live/trunk/Bio/Graphics/Glyph/gene.pm 2008-01-22 00:16:02 UTC (rev 14454)
+++ bioperl-live/trunk/Bio/Graphics/Glyph/gene.pm 2008-01-22 20:48:42 UTC (rev 14455)
@@ -44,7 +44,9 @@
sub bump {
my $self = shift;
- return 1 if $self->{level} == 0; # top level bumps, other levels don't unless specified in config
+ return 1
+ if $self->{level} == 0
+ && lc $self->feature->primary_tag eq 'gene'; # top level bumps, other levels don't unless specified in config
return $self->SUPER::bump;
}
@@ -92,12 +94,16 @@
sub _subfeat {
my $class = shift;
my $feature = shift;
- if ($feature->primary_tag eq 'gene') {
+ if (lc $feature->primary_tag eq 'gene') {
my @transcripts;
for my $t (qw/mRNA tRNA snRNA snoRNA miRNA ncRNA pseudogene/) {
push @transcripts, $feature->get_SeqFeatures($t);
}
return @transcripts;
+ } elsif (lc $feature->primary_tag eq 'cds') {
+ my @parts = $feature->get_SeqFeatures();
+ return ($feature) if $class->{level} == 0 and !@parts;
+ return @parts;
}
my @subparts;
From lstein at dev.open-bio.org Tue Jan 22 15:49:14 2008
From: lstein at dev.open-bio.org (Lincoln Stein)
Date: Tue, 22 Jan 2008 15:49:14 -0500
Subject: [Bioperl-guts-l] [14456] bioperl-live/trunk/Bio/Graphics/Glyph.pm:
new feature of -strand_arrow option allows you to specify arrowheads only
on first and last segment
Message-ID: <200801222049.m0MKnEOf008002@dev.open-bio.org>
Revision: 14456
Author: lstein
Date: 2008-01-22 15:49:14 -0500 (Tue, 22 Jan 2008)
Log Message:
-----------
new feature of -strand_arrow option allows you to specify arrowheads only on first and last segment
Modified Paths:
--------------
bioperl-live/trunk/Bio/Graphics/Glyph.pm
Modified: bioperl-live/trunk/Bio/Graphics/Glyph.pm
===================================================================
--- bioperl-live/trunk/Bio/Graphics/Glyph.pm 2008-01-22 20:48:42 UTC (rev 14455)
+++ bioperl-live/trunk/Bio/Graphics/Glyph.pm 2008-01-22 20:49:14 UTC (rev 14456)
@@ -1134,7 +1134,7 @@
my $panel = $self->panel;
return unless $x2 >= $panel->left and $x1 <= $panel->right;
- if ($self->option('strand_arrow') || $self->option('stranded')) {
+ if ($self->stranded) {
$self->filled_arrow($gd,$self->feature->strand,
$x1, $y1,
$x2, $y2)
@@ -1145,7 +1145,21 @@
}
}
+sub stranded {
+ my $self = shift;
+ my $s = $self->option('strand_arrow') || $self->option('stranded');
+ return unless $s;
+ return 1 unless $s eq 'ends';
+ my $f = $self->feature;
+ my $strand = $f->strand;
+ $strand *= -1 if $self->{flip};
+ my $part_no = $self->{partno};
+ my $parts = $self->{total_parts};
+ return ($strand > 0 && $part_no == $parts-1)
+ || ($strand < 0 && $part_no == 0);
+}
+
sub no_subparts {
return shift->option('no_subparts');
}
@@ -1671,6 +1685,10 @@
-strand_arrow Whether to indicate undef (false)
strandedness
+ -stranded Whether to indicate undef (false)
+ strandedness
+ (same as above))
+
-label Whether to draw a label undef (false)
-description Whether to draw a description undef (false)
@@ -1740,7 +1758,11 @@
The B<-strand_arrow> option, if true, requests that the glyph indicate
which strand it is on, usually by drawing an arrowhead. Not all
glyphs will respond to this request. For historical reasons,
-B<-stranded> is a synonym for this option.
+B<-stranded> is a synonym for this option. Multisegmented features
+will draw an arrowhead on each component unless you specify a value of
+"ends" to -strand_arrow, in which case only the rightmost component
+(for + strand features) or the leftmost component (for - strand
+features) will have arrowheads.
B: By default, features are drawn with a layout based only on the
position of the feature, assuring a maximal "packing" of the glyphs
From cjfields at dev.open-bio.org Thu Jan 24 08:51:11 2008
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Thu, 24 Jan 2008 08:51:11 -0500
Subject: [Bioperl-guts-l] [14457]
bioperl-live/trunk/Bio/SeqIO/entrezgene.pm: Stefan' s fix for entrezgene
which includes a fix for pseudohash warnings; works now using perl 5.10.
Message-ID: <200801241351.m0ODpBCf016190@dev.open-bio.org>
Revision: 14457
Author: cjfields
Date: 2008-01-24 08:51:10 -0500 (Thu, 24 Jan 2008)
Log Message:
-----------
Stefan's fix for entrezgene which includes a fix for pseudohash warnings; works now using perl 5.10.
Modified Paths:
--------------
bioperl-live/trunk/Bio/SeqIO/entrezgene.pm
Modified: bioperl-live/trunk/Bio/SeqIO/entrezgene.pm
===================================================================
--- bioperl-live/trunk/Bio/SeqIO/entrezgene.pm 2008-01-22 20:49:14 UTC (rev 14456)
+++ bioperl-live/trunk/Bio/SeqIO/entrezgene.pm 2008-01-24 13:51:10 UTC (rev 14457)
@@ -104,8 +104,7 @@
#use Bio::Ontology::Ontology; Relationships.... later
use Bio::Ontology::Term;
use Bio::Annotation::OntologyTerm;
-#use Data::Dumper;
-
+use Data::Dumper;
use base qw(Bio::SeqIO);
%main::eg_to_ll =('Official Full Name' => 'OFFICIAL_GENE_NAME',
@@ -139,7 +138,7 @@
# record being parsed. 2 indicates the recommended
# trimming mode of the data structure
#I use 1 as I prefer not to descend into size 0 arrays
- return unless ($value);
+ return unless ($value);
my $debug=$self->{_debug};
$self->{_ann} = Bio::Annotation::Collection->new();
$self->{_currentann} = Bio::Annotation::Collection->new();
@@ -147,6 +146,8 @@
# parse the entry
#my @keys=keys %{$value}; obsolete
$xval=$value->[0];
+ #return unless ($xval->{gene}->{desc} eq 'albumin');
+ #return new Bio::Seq (-id=>'Generif service record', -seq=>'') unless ($xval->{'track-info'}{geneid}== 283);
return new Bio::Seq (-id=>'Generif service record', -seq=>'') if (($self->{_service_record} ne 'yes')&&
($xval->{gene}->{desc} =~ /record to support submission of generifs for a gene not in entrez/i));
#Basic data
@@ -208,8 +209,10 @@
}
}
$ncbiid= $ncbiid||$xval->{source}{org}{db}{tag}{id};
- my $specie=Bio::Species->new(-classification=>[@lineage],
- -ncbi_taxid=>$ncbiid);
+ my $s1=shift @lineage;
+ my $s2=shift @lineage;
+ my $specie=Bio::Species->new(-classification=>[$s1 , $s2],
+ -ncbi_taxid=>$ncbiid);
$specie->common_name($xval->{source}{org}{common});
if (exists($xval->{source}->{subtype}) && ($xval->{source}->{subtype})) {
if (ref($xval->{source}->{subtype}) eq 'ARRAY') {
@@ -231,26 +234,27 @@
$self->_add_to_ann($xval->{gene}->{syn},'ALIAS_SYMBOL') if ($xval->{gene}->{syn});
}
-
#COMMENTS (STS not dealt with yet)
- if (ref($xval->{comments}) eq 'ARRAY') {
- for my $i (0..$#{$xval->{comments}}) {
- $self->{_current}=$xval->{comments}->[$i];
- push @alluncaptured,$self->_process_all_comments();
- }
+ if (exists($xval->{comments})) {
+ if (ref($xval->{comments}) eq 'ARRAY') {
+ for my $i (0..$#{$xval->{comments}}) {
+ $self->{_current}=$xval->{comments}->[$i];
+ push @alluncaptured,$self->_process_all_comments();
+ }
+ }
+ else {
+ $self->{_current}=$xval->{comments};
+ push @alluncaptured,$self->_process_all_comments();
+ }
}
- else {
- $self->{_current}=$xval->{comments};
- push @alluncaptured,$self->_process_all_comments();
- }
#Gene
if (exists($xval->{gene}->{db})) {
- if (ref($xval->{gene}->{db}) eq 'ARRAY') {
- foreach my $genedb (@{$xval->{gene}->{db}}) {
- my $id=exists($genedb->{tag}->{id})?$genedb->{tag}->{id}:$genedb->{tag}->{str};
- $self->_add_to_ann($id,$genedb->{db});
+ if (ref($xval->{gene}->{db}) eq 'ARRAY') {
+ foreach my $genedb (@{$xval->{gene}->{db}}) {
+ my $id=exists($genedb->{tag}->{id})?$genedb->{tag}->{id}:$genedb->{tag}->{str};
+ $self->_add_to_ann($id,$genedb->{db});
+ }
}
- }
else {
my $id=($xval->{gene}->{db}->{tag}->{id})?
$xval->{gene}->{db}->{tag}->{id}:$xval->{gene}->{db}->{tag}->{str};
@@ -258,7 +262,7 @@
}
$self->_add_to_ann($xval->{gene}->{'locus-tag'},'LOCUS_SYNONYM');
delete $xval->{gene}->{db} unless ($debug eq 'off');
- }
+ }
#LOCATION To do: uncaptured stuff
if (exists($xval->{location})) {
if (ref($xval->{location}) eq 'ARRAY') {
@@ -335,31 +339,37 @@
delete $xval->{status};
}
push @alluncaptured,$xval;
- undef %seqcollection;
- undef $xval;
- #print 'x';
+ undef %seqcollection;
$seq->annotation(_backcomp_ll($self->{_ann})) if ($self->{_locuslink} eq 'convert');#Fix this!
return wantarray ? ($seq,$cluster,\@alluncaptured):$seq;#Hilmar's suggestion
}
-sub _process_refseq {
+sub _process_refseq {
my $self=shift;
my $products=shift;
my $ns=shift;
+my $iter=shift;
+$iter++;
my $pid;
my (@uncaptured, at products);
if (ref($products) eq 'ARRAY') { @products=@{$products}; }
else {push @products,$products ;}
foreach my $product (@products) {
- if (ref($product) eq 'ARRAY') {
- $self->_process_refseq($product,$ns);
+ if ((ref($product) eq 'ARRAY')&&($#{$product}>-1)) {
+ $self->_process_refseq($product,$ns,$iter);
next;
}
if ((exists($product->{products})&&(!exists($product->{accession})))) {
$self->_process_refseq($product->{products},$ns);
next;
}
- if (($product->{seqs}->{whole}->{gi})||($product->{accession})){#Minimal data required
+ #if ((exists($product->{products})&&($product->{products}))) {
+ # $self->_process_refseq($product->{products},$ns,$iter);
+ #}
+ if ((exists($product->{seqs}->{whole}->{gi}))&&(ref($product->{seqs}->{whole}->{gi}) eq 'ARRAY')) {
+ $product->{seqs}->{whole}->{gi}=$product->{seqs}->{whole}->{gi}->[0];
+ } #Lose some data
+ if ((exists($product->{seqs}->{whole}->{gi}))||(exists($product->{accession}))){#Minimal data required
my $cann=Bio::Annotation::Collection->new();
$pid=$product->{accession};
my $authority=exists($product->{type})?$product->{type}:$product->{heading};
@@ -368,15 +378,18 @@
-display_id=>$product->{accession},
-authority=> $authority, -namespace=>$ns
);
- if ($product->{source}) {
- unless (($nseq->authority)&&(exists($product->{source}->{src}))&&(exists($product->{source}->{src}->{db}))) {$nseq->authority($product->{source}->{src}->{db})};
- my ($uncapt,$allann)=_process_src($product->{source});
- delete $product->{source};
- push @uncaptured,$uncapt;
- foreach my $annotation (@{$allann}) {
- $cann->add_Annotation('dblink',$annotation);
+ if (exists($product->{source})&&($product->{source})) {
+ if ((!defined($nseq->authority))&&(exists($product->{source}->{src}))&&(exists($product->{source}->{src}->{db}))) {
+ $nseq->authority($product->{source}->{src}->{db})
+ }
+ my ($uncapt,$allann)=_process_src($product->{source});
+ push @uncaptured,$uncapt;
+ delete $product->{source};
+ foreach my $annotation (@{$allann}) {
+ $cann->add_Annotation('dblink',$annotation);
+ }
}
- }
+
delete $product->{seqs}->{whole}->{gi};
delete $product->{accession};
delete $product->{source};
@@ -386,7 +399,7 @@
foreach my $feat (@{$cfeat}) {
$nseq->add_SeqFeature($feat);
}
- if ($product->{products}) {
+ if (exists($product->{products})&&($product->{products})) {
my ($uncapt,$prodid)=$self->_process_refseq($product->{products});
push @uncaptured,$uncapt;
my $simann=Bio::Annotation::SimpleValue->new(-value=>$prodid,-tagname=>'product');
@@ -397,11 +410,16 @@
$cann->add_Annotation($key,$val);
}
}
- $nseq->annotation($cann);
+ $nseq->annotation($cann);
push @{$seqcollection{seq}},$nseq;
}
}
-return \@uncaptured,$pid,$seqcollection{seq};
+undef @products;
+undef $products;
+#my $ti2=new Benchmark;
+# my $td= timediff($ti2, $ti1);
+# print "\tITER $iter:",timestr($td),"\n";
+return \@uncaptured,$pid,$seqcollection{seq},$iter;
}
sub _process_links {
@@ -410,14 +428,14 @@
my (@annot, at uncapt);
if (ref($links) eq 'ARRAY') {
foreach my $link (@$links) {
- my ($uncapt,$annot)=_process_src($link->{source});
+ my ($uncapt,$annot)=_process_src($link->{source}) if (exists($link->{source}));
push @uncapt,$uncapt;
foreach my $annotation (@$annot) {
$self->{_ann}->add_Annotation('dblink',$annotation);
}
}
}
- else { my ($uncapt,$annot)=_process_src($links->{source});
+ else { my ($uncapt,$annot)=_process_src($links->{source}) if (exists($links->{source}));
push @uncapt,$uncapt;
foreach my $annotation (@$annot) {
$self->{_ann}->add_Annotation('dblink',$annotation);
@@ -444,18 +462,28 @@
if ((ref($prod) eq 'HASH') && (exists($prod->{comment}))) {
$prod=$prod->{comment};
}
- if (ref($prod) eq 'ARRAY') { @comments=@{$prod}; }
- else {push @comments,$prod;}
- for my $i (0..$#comments) {#Each comments is a
+ if (ref($prod) eq 'ARRAY') {
+ @comments=@{$prod};
+ }
+ else {
+ push @comments,$prod;
+ }
+ my $i = 0;
+ for my $comm (@comments) { # Each comments is a hash reference
+ $self->throw("Comment not a hash reference") unless ref($comm) eq 'HASH';
my ($desc,$nfeat,$add, at ann, at comm);
- my $comm=$comments[$i];
# next unless (exists($comm->{comment}));#Should be more careful when calling _process_comment:To do
my $heading=$comm->{heading} || 'description';
- unless (exists($comm->{comment})) {
- if (($comm->{type})&&($self->{_current_heading})) {
+ if (!exists($comm->{comment})) {
+ if ((exists($comm->{type})) &&
+ ($comm->{type}) &&
+ ($self->{_current_heading})) {
$comm->{type}=$self->{_current_heading};
}
- if ((exists($comm->{type})) && (exists($comm->{text}))&& ($comm->{type} ne 'comment')) {
+ if ((exists($comm->{source})) &&
+ (exists($comm->{type})) &&
+ (exists($comm->{text})) &&
+ ($comm->{type} ne 'comment')) {
my ($uncapt,$annot,$anchor)=_process_src($comm->{source});
my $cann=shift (@$annot);
if (defined $cann) {
@@ -465,116 +493,132 @@
push @sfann,$cann;
}
}
- undef $comm->{comment}; $add=1;#Trick in case we miss something
}
- while ((exists($comm->{comment})&&$comm->{comment})) {
- if ($comm->{source}) {
- my ($uncapt,$allann,$anchor) = _process_src($comm->{source});
- if ($allann) {
- delete $comm->{source};
- push @uncaptured,$uncapt;
- foreach my $annotation (@{$allann}) {
- if ($annotation->{_anchor}) {$desc.=$annotation->{_anchor}.' ';}
- $annotation->optional_id($heading);
- push @sfann,$annotation;
- push @{$cann{'dblink'}},$annotation;
- }
- }
- }
- $comm=$comm->{comment};#DOES THIS NEED TO BE REC CYCLE?
- if (ref($comm) eq 'ARRAY') {
- @comm=@{$comm};
- }
- else {
- push @comm,$comm;
- }
- foreach my $ccomm (@comm) {
- next unless ($ccomm);
- if (exists($ccomm->{source})) {
- my ($uncapt,$allann,$anchor) = _process_src($ccomm->{source});
- if ($allann) {
- @sfann=@{$allann};
- delete $ccomm->{source};