From bugzilla-daemon at portal.open-bio.org Sun Mar 1 14:25:20 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sun, 1 Mar 2009 14:25:20 -0500
Subject: [Bioperl-guts-l] [Bug 2775] New: is_circular not maintained through
->trunc
Message-ID:
http://bugzilla.open-bio.org/show_bug.cgi?id=2775
Summary: is_circular not maintained through ->trunc
Product: BioPerl
Version: 1.6 branch
Platform: All
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Core Components
AssignedTo: bioperl-guts-l at bioperl.org
ReportedBy: david_j at users.sourceforge.net
I think PrimarySeqI's is_circular should be maintained in the new object
returned from ->trunc methods - it isn't at the moment.
--
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 Sun Mar 1 14:27:20 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sun, 1 Mar 2009 14:27:20 -0500
Subject: [Bioperl-guts-l] [Bug 2775] is_circular not maintained through
->trunc
In-Reply-To:
Message-ID: <200903011927.n21JRKDu017744@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2775
------- Comment #1 from david_j at users.sourceforge.net 2009-03-01 14:27 EST -------
Created an attachment (id=1252)
--> (http://bugzilla.open-bio.org/attachment.cgi?id=1252&action=view)
proposed fix and test as diff to trunk
--
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 Sun Mar 1 14:30:08 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sun, 1 Mar 2009 14:30:08 -0500
Subject: [Bioperl-guts-l] [Bug 2775] is_circular not maintained through
->revcom
In-Reply-To:
Message-ID: <200903011930.n21JU865018032@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2775
david_j at users.sourceforge.net changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|is_circular not maintained |is_circular not maintained
|through ->trunc |through ->revcom
------- Comment #2 from david_j at users.sourceforge.net 2009-03-01 14:30 EST -------
Sorry - I meant ->revcom has the problem. I think ->trunc probably should
return linear 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 bugzilla-daemon at portal.open-bio.org Sun Mar 1 14:33:33 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sun, 1 Mar 2009 14:33:33 -0500
Subject: [Bioperl-guts-l] [Bug 2766] SeqUtils not copying SeqFeature tags
In-Reply-To:
Message-ID: <200903011933.n21JXXhI018364@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2766
david_j at users.sourceforge.net changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #1243|text/x-diff |text/plain
mime type| |
Attachment #1243 is|0 |1
patch| |
--
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 lstein at dev.open-bio.org Mon Mar 2 00:43:29 2009
From: lstein at dev.open-bio.org (Lincoln Stein)
Date: Mon, 2 Mar 2009 00:43:29 -0500
Subject: [Bioperl-guts-l] [15583] bioperl-live/trunk/Bio/DB: berkeleydb
database now autoindexes wig files and locks correctly
Message-ID: <200903020543.n225hTiM030659@dev.open-bio.org>
Revision: 15583
Author: lstein
Date: 2009-03-02 00:43:27 -0500 (Mon, 02 Mar 2009)
Log Message:
-----------
berkeleydb database now autoindexes wig files and locks correctly
Modified Paths:
--------------
bioperl-live/trunk/Bio/DB/Fasta.pm
bioperl-live/trunk/Bio/DB/SeqFeature/Store/GFF3Loader.pm
bioperl-live/trunk/Bio/DB/SeqFeature/Store/berkeleydb.pm
Modified: bioperl-live/trunk/Bio/DB/Fasta.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/Fasta.pm 2009-03-01 00:12:13 UTC (rev 15582)
+++ bioperl-live/trunk/Bio/DB/Fasta.pm 2009-03-02 05:43:27 UTC (rev 15583)
@@ -554,7 +554,6 @@
# find all fasta files
my @files = glob("$dir/$self->{glob}");
-# $self->throw( "no fasta files in $dir") unless @files;
return unless @files;
# get name of index
Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store/GFF3Loader.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store/GFF3Loader.pm 2009-03-01 00:12:13 UTC (rev 15582)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store/GFF3Loader.pm 2009-03-02 05:43:27 UTC (rev 15583)
@@ -627,8 +627,8 @@
$allow_it = $loader->allow_whitespace([$newvalue]);
-Get or set the allow_whitespace flag. If true, then GFF3 files are allowed to
-be delimited with whitespace in addition to tabs.
+Get or set the allow_whitespace flag. If true, then GFF3 files are
+allowed to be delimited with whitespace in addition to tabs.
=cut
Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store/berkeleydb.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store/berkeleydb.pm 2009-03-01 00:12:13 UTC (rev 15582)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store/berkeleydb.pm 2009-03-02 05:43:27 UTC (rev 15583)
@@ -2,15 +2,18 @@
# $Id$
-
use strict;
use base 'Bio::DB::SeqFeature::Store';
use Bio::DB::GFF::Util::Rearrange 'rearrange';
-use Bio::DB::Fasta;
use DB_File;
-use Fcntl qw(O_RDWR O_CREAT);
+use Fcntl qw(O_RDWR O_CREAT :flock);
+use IO::File;
use File::Temp 'tempdir';
use File::Path 'rmtree','mkpath';
+use File::Basename;
+use File::Spec;
+use Carp 'carp';
+
use constant BINSIZE => 10_000;
use constant MININT => -999_999_999_999;
use constant MAXINT => 999_999_999_999;
@@ -140,7 +143,8 @@
populate it using the GFF3 loader, or you can monitor a directory of
preexisting GFF3 and FASTA files and rebuild the indexes whenever one
or more of the fields changes. The last mode is probably the most
-convenient.
+convenient. Note that the indexer will only pay attention to files
+that end with .gff3, .wig and .fa.
=over 4
@@ -219,6 +223,9 @@
-dsn => '/var/databases/fly4.3',
-dir => '/home/gff3_files/fly4.3');
+To be indexed, files must end with one of .gff3 (GFF3 format), .fa
+(FASTA format) or .wig (WIG format).
+
B<-autoindex> is an alias for B<-dir>.
=back
@@ -258,9 +265,9 @@
$pacname =~ s/:+/_/g;
}
$directory = tempdir($pacname.'_XXXXXX',
- TMPDIR=>1,
- CLEANUP=>1,
- DIR=>$directory) if $is_temporary;
+ TMPDIR => 1,
+ CLEANUP => 1,
+ DIR => $directory) if $is_temporary;
mkpath($directory);
-d $directory or $self->throw("Invalid directory $directory");
@@ -274,6 +281,10 @@
$self->directory($directory);
$self->temporary($is_temporary);
$self->_delete_databases() if $create;
+ if ($autoindex && -d $autoindex) {
+ $self->reindex($autoindex);
+ }
+ $self->lock('shared');
$self->_open_databases($write,$create,$autoindex);
$self->_permissions($write,$create);
return $self;
@@ -281,67 +292,160 @@
sub can_store_parentage { 1 }
-sub post_init {
- my $self = shift;
- my ($autodir) = rearrange([['DIR','AUTOINDEX']], at _);
- return unless $autodir && -d $autodir;
+sub reindex {
+ my $self = shift;
+ my $autodir = shift;
+ my $result = $self->needs_auto_reindexing($autodir);
- my $maxtime = 0;
+ if (%$result) {
+ $self->lock('exclusive');
+ $self->reindex_wigfiles($result->{wig},$autodir) if $result->{wig};
+ $self->reindex_gff3files($result->{gff},$autodir) if $result->{gff};
+ $self->dna_db(Bio::DB::Fasta::Subdir->new($autodir));
+ $self->unlock;
+ }
- opendir (my $D,$autodir) or $self->throw("Couldn't open directory $autodir for reading: $!");
- my @reindex;
- my $fasta_files_present;
-
- while (defined (my $node = readdir($D))) {
- next if $node =~ /^\./;
- my $path = "$autodir/$node";
- next unless -f $path;
-
- # skip fasta files - the Bio::DB::Fasta module indexes them on its own
- if ($node =~ /\.(?:fa|fasta|dna)(?:\.gz)?$/) {
- $fasta_files_present++;
- next;
+ else {
+ $self->dna_db(Bio::DB::Fasta::Subdir->new($autodir));
}
+}
- # skip index files
- next if $node =~ /\.(?:bdb|idx|index|stamp)/;
+sub reindex_gff3files {
+ my $self = shift;
+ my $files = shift;
+ my $autodir = shift;
- # skip autosave files, etc
- next if $node =~ /^\#/;
- next if $node =~ /~$/;
-
- my $mtime = _mtime(\*_); # not a typo
- $maxtime = $mtime if $mtime > $maxtime;
- push @reindex,$path;
- }
-
- close $D;
-
- my $timestamp_time = _mtime($self->_mtime_path) || 0;
-
- if ($maxtime > $timestamp_time) {
- warn "Reindexing... this may take a while.\n";
+ warn "Reindexing GFF3 files...\n";
$self->_permissions(1,1);
$self->_close_databases();
$self->_open_databases(1,1);
require Bio::DB::SeqFeature::Store::GFF3Loader
- unless Bio::DB::SeqFeature::Store::GFF3Loader->can('new');
+ unless Bio::DB::SeqFeature::Store::GFF3Loader->can('new');
my $loader = Bio::DB::SeqFeature::Store::GFF3Loader->new(-store => $self,
- -sf_class => $self->seqfeature_class)
- or $self->throw("Couldn't create GFF3Loader");
- $loader->load(@reindex);
+ -sf_class => $self->seqfeature_class)
+ or $self->throw("Couldn't create GFF3Loader");
+ my %seen;
+ $loader->load(grep {!$seen{$_}++} @$files);
$self->_touch_timestamp;
- }
+}
- if ($fasta_files_present) {
- my $dna_db = Bio::DB::Fasta->new($autodir);
- $self->dna_db($dna_db);
- }
+sub reindex_wigfiles {
+ my $self = shift;
+ my $files = shift;
+ my $autodir = shift;
+
+ warn "reindexing wig files";
+
+ unless (Bio::Graphics::Wiggle::Loader->can('new')) {
+ eval "require Bio::Graphics::Wiggle::Loader; 1"
+ or return;
+ }
+
+ for my $wig (@$files) {
+ my ($wib_name) = fileparse($wig,qr/\.[^.]*/);
+ my $gff3_name = "$wib_name.gff3";
+
+ # unlink all wib files that share the basename
+ my $wib_glob = File::Spec->catfile($self->directory,"$wib_name*.wib");
+ unlink glob($wib_glob);
+
+ my $loader = Bio::Graphics::Wiggle::Loader->new($self->directory,$wib_name);
+ my $fh = IO::File->new($wig) or die "Can't open $wig: $!";
+ $loader->load($fh); # will create one or more .wib files
+ $fh->close;
+ my $gff3_data = $loader->featurefile('gff3','microarray_oligo',$wib_name);
+ my $gff3_path = File::Spec->catfile($autodir,$gff3_name);
+ $fh = IO::File->new($gff3_path,'>')
+ or die "Can't open $gff3_path for writing: $!";
+ $fh->print($gff3_data);
+ $fh->close;
+ }
}
+# returns the following hashref
+# empty hash if nothing needs reindexing
+# {fasta => 1} if DNA database needs reindexing
+# {gff => [list,of,gff,paths]} if gff3 files need reindexing
+# {wig => [list,of,wig,paths]} if wig files need reindexing
+sub needs_auto_reindexing {
+ my $self = shift;
+ my $autodir = shift;
+ my $result = {};
+
+ # first interrogate the GFF3 files, using the timestamp file
+ # as modification comparison
+ my (@gff3, at wig,$fasta,$fasta_index_time);
+ opendir (my $D,$autodir)
+ or $self->throw("Couldn't open directory $autodir for reading: $!");
+
+ my $maxtime = 0;
+ while (defined (my $node = readdir($D))) {
+ next if $node =~ /^\./;
+ my $path = File::Spec->catfile($autodir,$node);
+ next unless -f $path;
+
+ if ($path =~ /\.gff3?$/i) {
+ my $mtime = _mtime(\*_); # not a typo
+ $maxtime = $mtime if $mtime > $maxtime;
+ push @gff3,$path;
+ }
+
+ elsif ($path =~ /\.wig$/i) {
+ my $wig = $path;
+ (my $gff_file = $wig) =~ s/\.wig$/\.gff3/i;
+ next if -e $gff_file && _mtime($gff_file) > _mtime($path);
+ push @wig,$wig;
+ push @gff3,$gff_file;
+ $maxtime = time();
+ }
+
+ elsif ($path =~ /\.(fa|fasta|dna)$/i) {
+ $fasta_index_time =
+ _mtime(File::Spec->catfile($self->directory,'fasta.index'))||0
+ unless defined $fasta_index_time;
+ $fasta++ if _mtime($path) > $fasta_index_time;
+ }
+ }
+ closedir $D;
+ my $timestamp_time = _mtime($self->_mtime_path) || 0;
+
+ $result->{gff} = \@gff3 if $maxtime > $timestamp_time;
+ $result->{wig} = \@wig if @wig;
+ $result->{fasta}++ if $fasta;
+ return $result;
+}
+
+
+sub lock {
+ my $self = shift;
+ my $mode = shift;
+
+ my $flag = $mode eq 'exclusive' ? LOCK_EX : LOCK_SH;
+ my $lockfile = File::Spec->catfile($self->directory,'lock');
+ my $open = -e $lockfile ? '<' : '>';
+ my $fh = IO::File->new($lockfile,$open) or die "Cannot open $lockfile: $!";
+ flock($fh,$flag);
+ $self->_flock_fh($fh);
+}
+
+sub unlock {
+ my $self = shift;
+ my $fh = $self->_flock_fh or return;
+ flock($fh,LOCK_UN);
+ $self->_flock_fh(undef);
+}
+
+sub _flock_fh {
+ my $self = shift;
+ my $d = $self->{flock_fh};
+ $self->{flock_fh} = shift if @_;
+ $d;
+}
+
sub _open_databases {
my $self = shift;
my ($write,$create,$ignore_errors) = @_;
+ return if $self->db; # already open - don't reopen
my $directory = $self->directory;
unless (-d $directory) { # directory does not exist
@@ -356,6 +460,7 @@
# Create the main database; this is a DB_HASH implementation
my %h;
my $result = tie (%h,'DB_File',$self->_features_path,$flags,0666,$DB_HASH);
+
unless ($result) {
return if $ignore_errors; # autoindex set, so defer this
$self->throw("Couldn't tie: ".$self->_features_path . " $!");
@@ -386,7 +491,8 @@
$self->parentage_db(\%p);
if (-e $self->_fasta_path) {
- my $dna_db = Bio::DB::Fasta->new($self->_fasta_path) or $self->throw("Can't reindex sequence file: $@");
+ my $dna_db = Bio::DB::Fasta::Subdir->new($self->_fasta_path)
+ or $self->throw("Can't reindex sequence file: $@");
$self->dna_db($dna_db);
}
@@ -402,9 +508,9 @@
@@ Diff output truncated at 10000 characters. @@
From bosborne at dev.open-bio.org Mon Mar 2 09:51:43 2009
From: bosborne at dev.open-bio.org (Brian Osborne)
Date: Mon, 2 Mar 2009 09:51:43 -0500
Subject: [Bioperl-guts-l] [15584] bioperl-live/trunk/INSTALL: Remove mention
of GD
Message-ID: <200903021451.n22EphYL032204@dev.open-bio.org>
Revision: 15584
Author: bosborne
Date: 2009-03-02 09:51:42 -0500 (Mon, 02 Mar 2009)
Log Message:
-----------
Remove mention of GD
Modified Paths:
--------------
bioperl-live/trunk/INSTALL
Modified: bioperl-live/trunk/INSTALL
===================================================================
--- bioperl-live/trunk/INSTALL 2009-03-02 05:43:27 UTC (rev 15583)
+++ bioperl-live/trunk/INSTALL 2009-03-02 14:51:42 UTC (rev 15584)
@@ -60,8 +60,6 @@
NOTE: These are severely out-of-date and require MacPerl
(the latest version of which is 5.6.1rc1). As such, we do
not currently support BioPerl on OS 9
- * OS X - http://www.tc.umn.edu/~cann0010/Bioperl_OSX_install.html
- (outdated, but useful for libgd installation notes)
* OS X - Installing using Fink (in Getting BioPerl)
PRELIMINARY PREPARATION
@@ -86,10 +84,8 @@
cpan>o conf commit
cpan>q
- * Install the expat and libgd libraries by whatever method is
- appropriate for your system. If you install libgd in a
- non-standard location, that is fine: when installing the perl
- module that needs it you will be asked where you installed it.
+ * Install the expat library by whatever method is
+ appropriate for your system.
* If your expat library is installed in a non-standard location,
tell CPAN about it:
From maj at dev.open-bio.org Tue Mar 3 21:52:49 2009
From: maj at dev.open-bio.org (Mark Allen Jensen)
Date: Tue, 3 Mar 2009 21:52:49 -0500
Subject: [Bioperl-guts-l] [15585] bioperl-live/trunk/Build.PL: adding
recommendation for XML::Simple (reqd by Bio::Tools::EUtilities,
Message-ID: <200903040252.n242qnDR003814@dev.open-bio.org>
Revision: 15585
Author: maj
Date: 2009-03-03 21:52:48 -0500 (Tue, 03 Mar 2009)
Log Message:
-----------
adding recommendation for XML::Simple (reqd by Bio::Tools::EUtilities,
Bio::DB::HIV, Bio::DB::Query::HIVQuery)
Modified Paths:
--------------
bioperl-live/trunk/Build.PL
Modified: bioperl-live/trunk/Build.PL
===================================================================
--- bioperl-live/trunk/Build.PL 2009-03-02 14:51:42 UTC (rev 15584)
+++ bioperl-live/trunk/Build.PL 2009-03-04 02:52:48 UTC (rev 15585)
@@ -72,6 +72,7 @@
'XML::Parser::PerlSAX' => '0/parsing xml/Bio::SeqIO::tinyseq,Bio::SeqIO::game::gameSubs,Bio::OntologyIO::InterProParser,Bio::ClusterIO::dbsnp',
'XML::SAX' => '0.15/parsing xml/Bio::SearchIO::blastxml,Bio::SeqIO::tigrxml,Bio::SeqIO::bsml_sax',
'XML::SAX::Writer' => '0/writing xml/Bio::SeqIO::tigrxml',
+ 'XML::Simple' => '0/reading custom XML/Bio::Tools::EUtilities,Bio::DB::HIV,Bio::DB::Query::HIVQuery',
'XML::Twig' => '0/parsing xml/Bio::Variation::IO::xml,Bio::DB::Taxonomy::entrez,Bio::DB::Biblio::eutils',
'XML::Writer' => '0.4/parsing and writing xml/Bio::SeqIO::agave,Bio::SeqIO::game::gameWriter,Bio::SeqIO::chadoxml,Bio::SeqIO::tinyseq,Bio::Variation::IO::xml,Bio::SearchIO::Writer::BSMLResultWriter',
},
From bugzilla-daemon at portal.open-bio.org Wed Mar 4 00:09:35 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 4 Mar 2009 00:09:35 -0500
Subject: [Bioperl-guts-l] [Bug 2775] is_circular not maintained through
->revcom
In-Reply-To:
Message-ID: <200903040509.n2459Z9R001919@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2775
maj at fortinbras.us changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |maj at fortinbras.us
------- Comment #3 from maj at fortinbras.us 2009-03-04 00:09 EST -------
This looks like a special case of the 'properties not propagated' issue I
raised in http://bugzilla.open-bio.org/show_bug.cgi?id=2673. I'd definitely
like to revisit this when Core has time. David, you may want to have a look at
the patches there.
--
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 Mar 4 11:33:28 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 4 Mar 2009 11:33:28 -0500
Subject: [Bioperl-guts-l] [Bug 2764] enhance SwissProt retreival by id using
IDTracker
In-Reply-To:
Message-ID: <200903041633.n24GXSY0031638@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2764
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Group|Bioperl |
------- Comment #1 from cjfields at bioperl.org 2009-03-04 11:33 EST -------
Changing this so everyone can see it.
--
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 Mar 4 11:39:36 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Wed, 4 Mar 2009 11:39:36 -0500
Subject: [Bioperl-guts-l] [15586] bioperl-live/trunk: [bug 2766]
Message-ID: <200903041639.n24GdagD005165@dev.open-bio.org>
Revision: 15586
Author: cjfields
Date: 2009-03-04 11:39:35 -0500 (Wed, 04 Mar 2009)
Log Message:
-----------
[bug 2766]
* patch committed, courtesy of David Jackson
Modified Paths:
--------------
bioperl-live/trunk/Bio/SeqUtils.pm
bioperl-live/trunk/t/SeqTools/SeqUtils.t
Modified: bioperl-live/trunk/Bio/SeqUtils.pm
===================================================================
--- bioperl-live/trunk/Bio/SeqUtils.pm 2009-03-04 02:52:48 UTC (rev 15585)
+++ bioperl-live/trunk/Bio/SeqUtils.pm 2009-03-04 16:39:35 UTC (rev 15586)
@@ -546,6 +546,9 @@
$newfeat->annotation->add_Annotation($key, $value);
}
}
+ foreach my $key ( $feat->get_all_tags() ) {
+ $newfeat->add_tag_value($key, $feat->get_tag_values($key));
+ }
if (@loc==1) {
$newfeat->location($loc[0])
} else {
Modified: bioperl-live/trunk/t/SeqTools/SeqUtils.t
===================================================================
--- bioperl-live/trunk/t/SeqTools/SeqUtils.t 2009-03-04 02:52:48 UTC (rev 15585)
+++ bioperl-live/trunk/t/SeqTools/SeqUtils.t 2009-03-04 16:39:35 UTC (rev 15586)
@@ -7,7 +7,7 @@
use lib '.';
use Bio::Root::Test;
- test_begin(-tests => 41);
+ test_begin(-tests => 43);
use_ok('Bio::PrimarySeq');
use_ok('Bio::SeqUtils');
@@ -185,6 +185,7 @@
-end => 4,
-strand => 1,
-primary => 'source',
+ -tag => {note => 'note2'},
);
@@ -192,6 +193,7 @@
-end => 3,
-strand => 1,
-primary => 'hotspot',
+ -tag => {note => ['note3a','note3b']},
);
$seq2->add_SeqFeature($ft2);
@@ -201,14 +203,18 @@
ok (Bio::SeqUtils->cat($seq1, $seq2));
is $seq1->seq, 'aaaattttcccctttt';
is scalar $seq1->annotation->get_Annotations, 5;
+my @tags;
+lives_ok {
+ @tags = map{$_->get_tag_values(q(note))}$seq1->get_SeqFeatures ;
+} 'tags transfered (no throw)';
+cmp_ok(scalar(@tags),'==',3, 'tags transfered (correct count)') ;
my $protseq = Bio::PrimarySeq->new(-id => 2, -seq => 'MVTF'); # protein seq
-eval {
+throws_ok {
Bio::SeqUtils->cat($seq1, $protseq);
-};
-ok $@;
+} qr/different alphabets:/, 'different alphabets' ;
#
From bugzilla-daemon at portal.open-bio.org Wed Mar 4 11:40:59 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 4 Mar 2009 11:40:59 -0500
Subject: [Bioperl-guts-l] [Bug 2766] SeqUtils not copying SeqFeature tags
In-Reply-To:
Message-ID: <200903041640.n24Gexu3032456@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2766
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Comment #2 from cjfields at bioperl.org 2009-03-04 11:40 EST -------
Patch committed to svn. 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 bugzilla-daemon at portal.open-bio.org Wed Mar 4 11:44:46 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 4 Mar 2009 11:44:46 -0500
Subject: [Bioperl-guts-l] [Bug 2773] Bio::Tree::Node gets destroyed even
though it is still live
In-Reply-To:
Message-ID: <200903041644.n24Gikn7000488@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2773
------- Comment #1 from cjfields at bioperl.org 2009-03-04 11:44 EST -------
Agreed about weaken/is_weak hackiness, but that's unfortunately what's in place
(and removing it results in serious memory leaks). Maybe a second round of
refactors is in order?
--
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 Mar 5 12:00:57 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 5 Mar 2009 12:00:57 -0500
Subject: [Bioperl-guts-l] [Bug 2782] New:
Bio::Tools::Run::Phylo::Phylip::SeqBoot WON'T RUN
Message-ID:
http://bugzilla.open-bio.org/show_bug.cgi?id=2782
Summary: Bio::Tools::Run::Phylo::Phylip::SeqBoot WON'T RUN
Product: BioPerl
Version: unspecified
Platform: Sun
OS/Version: SunOS
Status: NEW
Severity: normal
Priority: P2
Component: bioperl-run
AssignedTo: bioperl-guts-l at bioperl.org
ReportedBy: j.m.herbert at bham.ac.uk
Hi there.
I can't get seqboot to work (from phylip) with the
Bio::Tools::Run::Phylo::Phylip::SeqBoot package. I use the example script, only
changing the protein file it needs and it can't find the infile needed by
seqboot. Please can you help me fix this problem? Thanks a lot.
John.
# PROGRAM MADE AND RAN ==================================
#!/usr/bin/perl
use Bio::Tools::Run::Phylo::Phylip::SeqBoot;
use Bio::Tools::Run::Alignment::Clustalw;
#Create a SimpleAlign object
@params = ('ktuple' => 2, 'matrix' => 'BLOSUM');
$factory = Bio::Tools::Run::Alignment::Clustalw->new(@params);
$inputfilename = './prots';
$aln = $factory->align($inputfilename); # $aln is a SimpleAlign object.
# Use seqboot to generate bootstap alignments
my @params = ('datatype'=>'SEQUENCE','replicates'=>100);
my $seq = Bio::Tools::Run::Phylo::Phylip::SeqBoot->new(@params);
my $aln_ref = $seq->run($aln);
my $aio = Bio::AlignIO->new(-file=>">alignment.bootstrap",-format=>"phylip");
foreach my $ai(@{$aln_ref}){
$aio->write_aln($ai);
}
#================== OUTPUT FROM THIS PROGRAM =====================
jherbert at orac [rhbdf2_xenopus]$ ./test.pl
CLUSTAL W (1.83) Multiple Sequence Alignments
Sequence format is Pearson
Sequence 1: h_rhbdf1 855 aa
Sequence 2: x_rhbdf1 292 aa
Start of Pairwise alignments
Aligning...
Sequences (1:2) Aligned. Score: 77
Guide tree file created: [./prots.dnd]
Start of Multiple Alignment
There are 1 groups
Aligning...
Group 1: Sequences: 2 Score:4867
Alignment Score 1553
GCG-Alignment file created [/tmp/xsUHP13FGA/PgxpwKJ9Yz]
seqboot: can't find input file "infile"
Please enter a new file name>
Bootstrapping algorithm, version 3.63
Settings for this run:
D Sequence, Morph, Rest., Gene Freqs? Molecular sequences
J Bootstrap, Jackknife, Permute, Rewrite? Bootstrap
% Regular or altered sampling fraction? regular
B Block size for block-bootstrapping? 1 (regular bootstrap)
R How many replicates? 100
W Read weights of characters? No
C Read categories of sites? No
S Write out data sets or just weights? Data sets
I Input sequences interleaved? Yes
0 Terminal type (IBM PC, ANSI, none)? ANSI
1 Print out the data at start of run No
2 Print indications of progress of run Yes
Y to accept these or type the letter for one to change
Not a possible option!
Bootstrapping algorithm, version 3.63
Settings for this run:
D Sequence, Morph, Rest., Gene Freqs? Molecular sequences
J Bootstrap, Jackknife, Permute, Rewrite? Bootstrap
% Regular or altered sampling fraction? regular
B Block size for block-bootstrapping? 1 (regular bootstrap)
R How many replicates? 100
W Read weights of characters? No
C Read categories of sites? No
S Write out data sets or just weights? Data sets
I Input sequences interleaved? Yes
0 Terminal type (IBM PC, ANSI, none)? ANSI
1 Print out the data at start of run No
2 Print indications of progress of run Yes
Y to accept these or type the letter for one to change
Number of replicates?
Bootstrapping algorithm, version 3.63
Settings for this run:
D Sequence, Morph, Rest., Gene Freqs? Molecular sequences
J Bootstrap, Jackknife, Permute, Rewrite? Bootstrap
% Regular or altered sampling fraction? regular
B Block size for block-bootstrapping? 1 (regular bootstrap)
R How many replicates? 100
W Read weights of characters? No
C Read categories of sites? No
S Write out data sets or just weights? Data sets
I Input sequences interleaved? Yes
0 Terminal type (IBM PC, ANSI, none)? ANSI
1 Print out the data at start of run No
2 Print indications of progress of run Yes
Y to accept these or type the letter for one to change
Random number seed (must be odd)?
Random number seed (must be odd)?
Random number seed (must be odd)?
Random number seed (must be odd)?
Random number seed (must be odd)?
Random number seed (must be odd)?
Random number seed (must be odd)?
Random number seed (must be odd)?
Random number seed (must be odd)?
Random number seed (must be odd)?
ERROR: Made 10 attempts to read input in loop. Aborting run.
------------- EXCEPTION -------------
MSG: SeqBoot did not create files correctly (/tmp/3EVNzzxryA/outfile)
STACK Bio::Tools::Run::Phylo::Phylip::SeqBoot::_run
/usr/local/lib/perl5/site_perl/5.8.3/Bio/Tools/Run/Phylo/Phylip/SeqBoot.pm:361
STACK Bio::Tools::Run::Phylo::Phylip::SeqBoot::run
/usr/local/lib/perl5/site_perl/5.8.3/Bio/Tools/Run/Phylo/Phylip/SeqBoot.pm:311
STACK toplevel ./test.pl:17
--------------------------------------
--
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 Mar 5 13:26:12 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 5 Mar 2009 13:26:12 -0500
Subject: [Bioperl-guts-l] [Bug 2782] Bio::Tools::Run::Phylo::Phylip::SeqBoot
WON'T RUN
In-Reply-To:
Message-ID: <200903051826.n25IQCdH032612@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2782
------- Comment #1 from cjfields at bioperl.org 2009-03-05 13:26 EST -------
This is working for me off the main trunk, though I had a few modifications
(I'm a 'use strict/warnings' stickler). Using:
Mac OS X (10.5.6)
perl 5.10.0
bioperl, bioperl-run from svn
Clustalw 2.0.10
phylip 3.68
# NEW VERSION ===============================
#!/usr/bin/perl
use strict;
use warnings;
use Bio::Tools::Run::Phylo::Phylip::SeqBoot;
use Bio::Tools::Run::Alignment::Clustalw;
#Create a SimpleAlign object
my @params = ('ktuple' => 2, 'matrix' => 'BLOSUM');
my $factory = Bio::Tools::Run::Alignment::Clustalw->new(@params);
my $inputfilename = './prots.faa';
my $aln = $factory->align($inputfilename);
# Use seqboot to generate bootstap alignments
@params = ('datatype'=>'SEQUENCE','replicates'=>100);
my $seq = Bio::Tools::Run::Phylo::Phylip::SeqBoot->new(@params);
my $aln_ref = $seq->run($aln);
my $aio = Bio::AlignIO->new(-file=>">alignment.bootstrap",-format=>"phylip");
foreach my $ai(@{$aln_ref}){
$aio->write_aln($ai);
}
--
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 Mar 5 23:50:34 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Thu, 5 Mar 2009 23:50:34 -0500
Subject: [Bioperl-guts-l] [15587] bioperl-live/trunk: * NCBI allows 3
requests per second now
Message-ID: <200903060450.n264oYOS007950@dev.open-bio.org>
Revision: 15587
Author: cjfields
Date: 2009-03-05 23:50:33 -0500 (Thu, 05 Mar 2009)
Log Message:
-----------
* NCBI allows 3 requests per second now
* fix failing test due to change of webenv length
Modified Paths:
--------------
bioperl-live/trunk/Bio/DB/EUtilities.pm
bioperl-live/trunk/Bio/DB/GenericWebAgent.pm
bioperl-live/trunk/t/RemoteDB/EUtilities.t
Modified: bioperl-live/trunk/Bio/DB/EUtilities.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/EUtilities.pm 2009-03-04 16:39:35 UTC (rev 15586)
+++ bioperl-live/trunk/Bio/DB/EUtilities.pm 2009-03-06 04:50:33 UTC (rev 15587)
@@ -186,14 +186,15 @@
Returns : number of seconds to delay
Args : none
- NOTE: NCBI requests a delay of 3 seconds between requests. This method
- implements that policy. This may change to check time of day for lengthening delays if needed
+ NOTE: NCBI requests a delay of 3 requests per second. This method implements
+ that policy. This will likely change to check time of day or number of
+ requests for lengthening delays.
=cut
sub delay_policy {
- my $self = shift;
- return 3;
+ my $self = shift;
+ return 1/3;
}
=head2 get_Parser
Modified: bioperl-live/trunk/Bio/DB/GenericWebAgent.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/GenericWebAgent.pm 2009-03-04 16:39:35 UTC (rev 15586)
+++ bioperl-live/trunk/Bio/DB/GenericWebAgent.pm 2009-03-06 04:50:33 UTC (rev 15587)
@@ -91,6 +91,17 @@
my $LAST_INVOCATION_TIME = 0;
+my $TIME_HIRES = 0;
+
+BEGIN {
+ eval {
+ use Time::HiRes;
+ };
+ unless ($@) {
+ $TIME_HIRES = 1;
+ }
+}
+
=head2 new
Title : new
@@ -176,7 +187,7 @@
=cut
-# TODO deal with small state-related bug where file
+# TODO deal with small state-related bug with file
sub get_Response {
my ($self, @args) = @_;
@@ -285,14 +296,23 @@
=cut
sub _sleep {
- my $self = shift;
- my $last_invocation = $LAST_INVOCATION_TIME;
- if (time - $LAST_INVOCATION_TIME < $self->delay) {
- my $delay = $self->delay - (time - $LAST_INVOCATION_TIME);
- $self->debug("sleeping for $delay seconds\n");
- sleep $delay;
- }
- $LAST_INVOCATION_TIME = time;
+ my $self = shift;
+ my $last_invocation = $LAST_INVOCATION_TIME;
+ if (time - $LAST_INVOCATION_TIME < $self->delay) {
+ my $delay = $self->delay - (time - $LAST_INVOCATION_TIME);
+ $self->debug("sleeping for $delay seconds\n");
+ if ($TIME_HIRES) {
+ # allows precise sleep timeout (builtin only allows integer seconds)
+ Time::HiRes::sleep($delay);
+ } else {
+ # allows precise sleep timeout (builtin only allows integer seconds)
+
+ # I hate this hack , but needed if we support 5.6.1 and
+ # don't want additional Time::HiRes prereq
+ select undef, undef, undef, $delay;
+ }
+ }
+ $LAST_INVOCATION_TIME = time;
}
=head1 LWP::UserAgent related methods
Modified: bioperl-live/trunk/t/RemoteDB/EUtilities.t
===================================================================
--- bioperl-live/trunk/t/RemoteDB/EUtilities.t 2009-03-04 16:39:35 UTC (rev 15586)
+++ bioperl-live/trunk/t/RemoteDB/EUtilities.t 2009-03-06 04:50:33 UTC (rev 15587)
@@ -142,7 +142,7 @@
# check the actual History
my ($webenv, $key) = $history->history;
- like($webenv, qr{^\S{50}}, '$epost WebEnv');
+ like($webenv, qr{^\S{25}}, '$epost WebEnv');
like($key, qr{^\d+}, '$epost query key');
# can we fetch the sequences?
From bugzilla-daemon at portal.open-bio.org Sat Mar 7 04:34:29 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sat, 7 Mar 2009 04:34:29 -0500
Subject: [Bioperl-guts-l] [Bug 2784] New: DBSOURCE DB.t test failure
Message-ID:
http://bugzilla.open-bio.org/show_bug.cgi?id=2784
Summary: DBSOURCE DB.t test failure
Product: BioPerl
Version: main-trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Bio::SeqIO
AssignedTo: bioperl-guts-l at bioperl.org
ReportedBy: pgarland at gmail.com
Hello,
I noticed that some tests fail in DB.t:
$ ./Build test --test_files t/RemoteDB/DB.t
t/RemoteDB/DB....NOK 83/113
# Failed test at t/RemoteDB/DB.t line 297.
# '1'
# >
# '31'
t/RemoteDB/DB....NOK 84/113
# Failed test at t/RemoteDB/DB.t line 298.
# got: 'GenBank'
# expected: 'swissprot'
t/RemoteDB/DB....NOK 85/113
# Failed test at t/RemoteDB/DB.t line 299.
# got: 'L05146'
# expected: '2AAA_YEAST'
Can't call method "value" on an undefined value at t/RemoteDB/DB.t line 300.
# Looks like you planned 113 tests but only ran 85.
# Looks like you failed 3 tests of 85 run.
# Looks like your test died just after 85.
t/RemoteDB/DB....dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 83-113
This happens because the DBSOURCES section of genpept records seems to have
changed: 'UniProtKB' has replaced 'swissprot' as an identifer in genpept
records.
With the attached patch to genbank.pm, the all DB.t tests are successful.
The patch also adds to the list of databases that may be cross referenced in
DBSOURCE sections and fixes 2 minor bugs in parsing date information in the
DBSOURCE section:
* create annotations for multiple updates to the protein record, rather that
just for the first update
* record the regexp that captures the date of the update, rather that the type
of update
I understand that the cleaner gbdriver parser will soon replace the genbank
parser, but I hope this is helpful in the interim.
~Phillip
--
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 Sat Mar 7 04:40:52 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sat, 7 Mar 2009 04:40:52 -0500
Subject: [Bioperl-guts-l] [Bug 2784] DBSOURCE DB.t test failure
In-Reply-To:
Message-ID: <200903070940.n279eq3R016971@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2784
------- Comment #1 from pgarland at gmail.com 2009-03-07 04:40 EST -------
Created an attachment (id=1260)
--> (http://bugzilla.open-bio.org/attachment.cgi?id=1260&action=view)
fix genbank.pm parsing of DBSOURCE section of swissprot/UniProt records
--
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 Sat Mar 7 18:00:47 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sat, 7 Mar 2009 18:00:47 -0500
Subject: [Bioperl-guts-l] [Bug 2785] New: genbank to chadoxml
Message-ID:
http://bugzilla.open-bio.org/show_bug.cgi?id=2785
Summary: genbank to chadoxml
Product: BioPerl
Version: 1.6 branch
Platform: Other
OS/Version: Linux
Status: NEW
Severity: critical
Priority: P2
Component: Bio::SeqIO
AssignedTo: bioperl-guts-l at bioperl.org
ReportedBy: valmik at bioanalysis.org
CC: valmik at bioanalysis.org
I have bioperl 1.0069
-bash-3.2$ perl -MBio::Root::Version -e 'print
$Bio::Root::Version::VERSION,"\n"'
1.0069
Bio::SeqIO::chadoxml seems to have a bug. When converting a genbank file to a
chadoxml file using the bioperl script bp_seqconvert.pl, it gives an error
which can be traced to chadoxml not recognizing the end of genbank record line
"//".
The error looks like following:
Can't locate object method "type" via package "Bio::Seq::RichSeq" at
usr/lib/perl5/site_perl/5.8.8/Bio/SeqIO/chadoxml.pm line 511, line
130853.
I also get the same error with Perl 5.8.10.
Has anyone come across this error/bug?
I modified my local bioperl code
/usr/lib/perl5/site_perl/5.8.8/Bio/SeqIO/chadoxml.pm but I am not sure if this
is the best way to fix it.
if(length $seq_so_type > 0) {
if (defined $seq_so_type) {
$ftype = $seq_so_type;
}
elsif ($seq->type) {
$ftype = ($seq->type =~ /(.*):/)
? $1
: $seq->type;
}
else {
$ftype = $gb_type;
}
}
else {
$ftype = $gb_type;
}
--
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 Mon Mar 9 16:16:53 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 9 Mar 2009 16:16:53 -0400
Subject: [Bioperl-guts-l] [Bug 2786] New: StandAlone Blast problem
Message-ID:
http://bugzilla.open-bio.org/show_bug.cgi?id=2786
Summary: StandAlone Blast problem
Product: BioPerl
Version: unspecified
Platform: PC
OS/Version: Windows XP
Status: NEW
Keywords: Bioperl
Severity: normal
Priority: P3
Component: bioperl-run
AssignedTo: bioperl-guts-l at bioperl.org
ReportedBy: antonina.iagovitina at epfl.ch
#!/usr/bin/perl -w
use Bio::SeqIO;
use strict;
use Bio::DB::Fasta;
use Bio::Tools::Run::StandAloneBlast;
use Bio::Seq;
my $dbfile = 'dsim-all-gene_extended2000-r1.3.Fasta';
my $db =Bio::DB::Fasta->new($dbfile);
my $str=Bio::SeqIO->new(-file => 'B4.Fasta', -format =>'Fasta');
my $input=$str->next_seq();
my @params=('program' =>'blastn','database'=>$db,'outfile'=>'blast1.out');
my $blast_obj = Bio::Tools::Run::StandAloneBlast->new(@params);
my $blast_report=$blast_obj->blastall($input);
--
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 Mar 9 22:31:39 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Mon, 9 Mar 2009 22:31:39 -0400
Subject: [Bioperl-guts-l] [15588] bioperl-live/trunk/Bio/Index/Hmmer.pm:
speling
Message-ID: <200903100231.n2A2VdVp014161@dev.open-bio.org>
Revision: 15588
Author: cjfields
Date: 2009-03-09 22:31:38 -0400 (Mon, 09 Mar 2009)
Log Message:
-----------
speling
Modified Paths:
--------------
bioperl-live/trunk/Bio/Index/Hmmer.pm
Modified: bioperl-live/trunk/Bio/Index/Hmmer.pm
===================================================================
--- bioperl-live/trunk/Bio/Index/Hmmer.pm 2009-03-06 04:50:33 UTC (rev 15587)
+++ bioperl-live/trunk/Bio/Index/Hmmer.pm 2009-03-10 02:31:38 UTC (rev 15588)
@@ -19,7 +19,7 @@
=head1 SYNOPSIS
- # Complete Code for indexing a set off report files
+ # Complete Code for indexing a set of report files
#!/usr/bin/perl -w
use strict;
use Bio::Index::Hmmer;
From bugzilla-daemon at portal.open-bio.org Thu Mar 12 07:37:55 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 12 Mar 2009 07:37:55 -0400
Subject: [Bioperl-guts-l] [Bug 2789] New: Script submission: reverse
translate Profam motifs
Message-ID:
http://bugzilla.open-bio.org/show_bug.cgi?id=2789
Summary: Script submission: reverse translate Profam motifs
Product: BioPerl
Version: main-trunk
Platform: All
OS/Version: Linux
Status: NEW
Keywords: Bioperl
Severity: normal
Priority: P2
Component: Unclassified
AssignedTo: bioperl-guts-l at bioperl.org
ReportedBy: vecchi.b at gmail.com
This script reverse translates Profam motifs into its correspondent degenerate
nucleotide sequences. It was requested as a feature on the bioperl mailing list
on December 2008 by Samantha Thompson; Chris Fields and Brian Osborne agreed on
it being a valuable addition (thread titled Degenerate primer Calculation).
I suggest adding it either to bioperl-live/scripts/utilities, or
bioperl-live/examples/contributed.
--
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 Mar 12 07:39:39 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 12 Mar 2009 07:39:39 -0400
Subject: [Bioperl-guts-l] [Bug 2789] Script submission: reverse translate
Profam motifs
In-Reply-To:
Message-ID: <200903121139.n2CBddH4018476@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2789
------- Comment #1 from vecchi.b at gmail.com 2009-03-12 07:39 EST -------
Created an attachment (id=1261)
--> (http://bugzilla.open-bio.org/attachment.cgi?id=1261&action=view)
The 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 bosborne at dev.open-bio.org Thu Mar 12 10:13:51 2009
From: bosborne at dev.open-bio.org (Brian Osborne)
Date: Thu, 12 Mar 2009 10:13:51 -0400
Subject: [Bioperl-guts-l] [15589]
bioperl-live/trunk/scripts/utilities/revtrans-motif.PLS: Add Bruno' s
script
Message-ID: <200903121413.n2CEDpsi009678@dev.open-bio.org>
Revision: 15589
Author: bosborne
Date: 2009-03-12 10:13:50 -0400 (Thu, 12 Mar 2009)
Log Message:
-----------
Add Bruno's script
Added Paths:
-----------
bioperl-live/trunk/scripts/utilities/revtrans-motif.PLS
Added: bioperl-live/trunk/scripts/utilities/revtrans-motif.PLS
===================================================================
--- bioperl-live/trunk/scripts/utilities/revtrans-motif.PLS (rev 0)
+++ bioperl-live/trunk/scripts/utilities/revtrans-motif.PLS 2009-03-12 14:13:50 UTC (rev 15589)
@@ -0,0 +1,584 @@
+#!/usr/bin/perl
+# $Id$
+use warnings;
+use strict;
+
+use Bio::Seq;
+use Bio::Tools::CodonTable;
+
+use List::MoreUtils qw(uniq);
+use Carp qw(croak);
+
+use Getopt::Long;
+use Pod::Usage;
+
+=head1 NAME
+
+revtrans-motif - Reverse translate a Profam-like protein motif
+
+=head1 VERSION
+
+Version 0.01
+
+=cut
+
+our $VERSION = '0.01';
+
+=head1 SYNOPSIS
+
+From a file:
+
+ revtrans-motif.pl -i motifs.txt
+
+Using pipes:
+
+ revtrans-motif.pl < motifs.txt > output.txt
+
+Using interactively at the command prompt:
+
+ $ revtrans-motif.pl
+ MAAEEL[VIKP]
+ 1. ATGGCNGCNGARGARYTNVHN
+ [^P]H(IW){2,3}
+ 2. NDNCAY(ATHTGG){2,3}
+
+=cut
+
+# File IO, default to STDIN.
+my ($help, $infile);
+GetOptions( "h|help" => \$help, "i|infile:s" => \$infile );
+
+# Parse command line arguments.
+unless (defined $infile) { $infile = '-' };
+open( my $fh, "<$infile" ) or die "Couldn't open file $infile: $!\n";
+
+if ($help) { pod2usage(-verbose => 3) };
+
+# Process each line, output to STDOUT.
+while (my $motif = <$fh>) {
+ if ($motif =~ /^\s*#/) { next }; # Ignore comments.
+ chomp $motif;
+ my $line = $.;
+
+ my $result;
+ eval { $result = reverse_translate_motif($motif) };
+ if ($@) { warn $@; next }
+
+ print $line, ".\t", $result, "\n";
+}
+
+sub reverse_translate_motif {
+ # Main subroutine. It takes a Profam-like motif and returns its
+ # reverse translation using degenerate codons.
+
+ # Steps:
+ # 1. Tokenize, then parse tokens.
+ # 2. Reverse translate each token type.
+ # 3. Join tokens in original order. Return the resulting string.
+
+ my $motif = shift;
+
+ $motif =~ s/\./X/g;
+ $motif = uc $motif;
+
+ ### 1. Tokenize, parse the motif.
+ my ( $ordered, $classified ) = parse_motif($motif);
+
+ ### 2. Reverse translate each token type.
+ # Reverse translate the plain (unambiguous) tokens.
+ my $ct = Bio::Tools::CodonTable->new;
+ foreach my $seq ( @{ $classified->{plain} } ) {
+ my $seqO
+ = Bio::Seq->new( -seq => $$seq, -alphabet => 'protein' );
+ $$seq = $ct->reverse_translate_all($seqO);
+ }
+
+ # Reverse translate the ambiguous tokens.
+ foreach my $token ( @{ $classified->{ambiguous} } ) {
+ my ($aas) = $$token =~ m(([A-Za-z\.]+));
+ my @codons_to_contract;
+
+ foreach my $residue ( split '', $aas ) {
+ push @codons_to_contract, $ct->revtranslate($residue);
+ }
+
+ my $ambiguous_codon = contract_codons(@codons_to_contract);
+ $$token = $ambiguous_codon;
+ }
+
+ # Reverse translate the negated residues.
+ foreach my $token ( @{ $classified->{negated} } ) {
+ my ($aas) = $$token =~ m(([A-Za-z\.]+));
+ my $ambiguous_codon = negated_aas_to_codon($aas);
+ $$token = $ambiguous_codon;
+ }
+
+ ### 3. Join the profile back from its tokens.
+ return join '', map {$$_} @{$ordered};
+
+}
+
+sub parse_motif {
+ # Profam-like motif parser. It takes the pattern as a string, and
+ # returns two data structures that contain the tokens, organized
+ # by order of appearance in the pattern (first return value) and by
+ # category (second return value).
+
+ my $motif = shift;
+ my $parser = tokenize_motif($motif);
+ my ( %tokens, @tokens );
+
+ while ( my $token = $parser->() ) {
+ croak "Unknown syntax token: <", $token->[1], ">"
+ if ( $token->[0] eq 'UNKNOWN' );
+ push @{ $tokens{ $token->[0] } }, \$token->[1];
+ push @tokens, \$token->[1];
+ }
+ return ( \@tokens, \%tokens );
+}
+
+sub tokenize_motif {
+
+ # Return a tokenizer iterator that sequentially recognizes and
+ # returns each token in the input pattern.
+ # Examples of each token type:
+
+ # ambiguous: a position with more than one possible residue.
+ # eg. [ALEP]
+ # negated: a position in which some residues are excluded.
+ # eg. [^WY]
+ # plain: a common sequence of residues. One position, one residue.
+ # eg. MAAEIK
+ # open_par, close_par: tags surrounding a motif that is repeated
+ # a certain number of times.
+ # eg. (...){3}
+
+ my $target = shift;
+ return sub {
+ return [ 'ambiguous', $1 ]
+ if $target =~ /\G (\[[A-Za-z\.]+\]) /gcx;
+ return [ 'negated', $1 ]
+ if $target =~ /\G (\[\^[A-Za-z\.]+\]) /gcx;
+ return [ 'plain', $1 ]
+ if $target =~ /\G ([A-Za-z\.]+) /gcx;
+ return [ 'open_par', $1 ]
+ if $target =~ /\G (\() /gcx;
+ return [ 'close_par', $1 ]
+ if $target =~ /\G (\)[\{\d+[,\d+]*\}]*) /gcx;
+ return [ 'UNKNOWN', $1 ]
+ if $target =~ /\G (.) /gcx;
+ return;
+ };
+}
+
+sub contract_codons {
+
+ # Take a list of codons, return an ambiguous codon.
+ my @codons = map { uc $_ } @_;
+
+ my @by_letter = ( [], [], [], );
+ my $ambiguous_codon;
+ foreach my $codon (@codons) {
+ my @letters = split '', $codon;
+ for my $i ( 0 .. 2 ) {
+ push @{ $by_letter[$i] }, $letters[$i];
+ }
+ }
+ for my $i ( 0 .. 2 ) {
+ $ambiguous_codon
+ .= convert( 'dna', uniq_string( @{ $by_letter[$i] } ) );
+ }
+ return $ambiguous_codon;
+}
+
+sub expand_codon {
+
+ # Given a degenerate codon, return a list with all its
+ # constituents. Takes a three-letter string (codon) as
+ # input, returns a list with three-letter scalars.
+
+ my $codon = shift;
+ die "Wrong codon length!\n" if length $codon != 3;
+
+
+ my ( @codons, @return_bases );
+ my @orig_bases = split '', $codon;
+
+ for my $i ( 0 .. 2 ) {
+
+ # from each redundant base, create a list with all their
+ # components (e.g., N -> (A, C, G, T) );
+ my @components = split '', convert('dna', $orig_bases[$i] );
+ $orig_bases[$i] = [@components];
+ }
+
+ # Combine all the bases of each of the three positions of the
+ # codons, and build the return list.
+ for my $i ( @{ $orig_bases[0] } ) {
+ for my $j ( @{ $orig_bases[1] } ) {
+ for my $k ( @{ $orig_bases[2] } ) {
+ push @return_bases, $i . $j . $k;
+ }
+ }
+ }
+ return @return_bases;
+}
+
+{
+ my %convert;
+
+ sub convert {
+ # Interconvert between redundant and non-redundant protein and
+ # dna alphabets. Takes an alphabet (protein or dna) and a string
+ # with the letter, and returns its equivalent in
+ # redundant/non-redundant alphabet. Example ACTG -> N.
+
+ my ($alphabet, $letter) = @_;
+ unless (
+ $alphabet and $alphabet =~ /^dna$|^protein$/i
+ and $letter and length $letter <= 4
+ ) { croak "Wrong arguments!\n"; }
+
+ unless (%convert) {
+ %convert = (
+ 'dna' => {
+ qw(N ACGT B CGT D AGT H ACT V ACG K GT
+ M AC R AG S CG W AT Y CT A A C C T T G G)
+ },
+ 'protein' => {
+ '.' => 'ACDEFGHIJKLMNOPQRSTUVWY',
+ X => 'ACDEFGHIJKLMNOPQRSTUVWY',
+ Z => 'QE',
+ B => 'ND',
+ },
+ );
+
+ # Make %convert hash key/value agnostic.
+ foreach my $alphabet ( keys %convert ) {
+ map { $convert{$alphabet}->{ $convert{$alphabet}{$_} } = $_ }
+ keys %{ $convert{$alphabet} };
+ }
+ }
+
+ return $convert{$alphabet}{$letter};
+ }
+
+}
+
+sub uniq_string {
+ # Takes a list of letters and returns an alphabetically sorted
+ # list with unique elements.
+
+ my @letters = @_;
+ return join '', sort { $a cmp $b } uniq @letters;
+}
+
+{
+ my ( @codon_library, $ct );
+
+ sub negated_aas_to_codon {
+
+ # Given a string of residues, returns a degenerate codon that will
+ # not be translated into any of them, while maximizing degeneracy
+ # (ie, it tries to also translate into as many residues as possible).
+
+ # This functionality is required for reverse translating profiles
+ # that contain negative patterns: [^X]. This means that the current
+ # position should not contain aminoacid X, but can have any of the
+ # others. The reverse translated nucleotide sequence should
+ # reflect this.
+
+ # Approach: construct a list of all possible codons, incluiding all
+ # degenerate bases. This is an array of 15x15x15 = 3375 elements.
+ # Order them by descendent "degeneracy".
+ # Return the first one whose expansion in 4-lettered codons
+ # doesn't contain a codon that translates into any of the
+ # non-wanted residues.
+
+ # * Since this takes some time, I presorted them and saved them.
+ # Reading them from a file takes a fraction of the time that it taes
+ # to re-sort them every time the application is launched.
+
+ my $aas_to_avoid = shift;
+
+ # Initialize reusable variables if it's the first time the sub
+ # is called.
+ unless (@codon_library) {
+ while () { chomp; push @codon_library, split ' ', $_ }
+ }
+ unless ($ct) { $ct = Bio::Tools::CodonTable->new; }
+
+ # Reverse translate the unwanted aminoacids to unwanted codons.
+ my @unwanted_codons;
+ foreach my $aa ( split '', $aas_to_avoid ) {
+ push @unwanted_codons, $ct->revtranslate($aa);
+ }
+
+ foreach my $degenerate_codon (@codon_library) {
+ my @codons = expand_codon($degenerate_codon);
+ my $success = 1;
+
+ foreach my $unwanted (@unwanted_codons) {
+ if ( grep { uc $unwanted eq $_ } @codons ) {
+ $success = 0;
+ }
+ }
+
+ if ($success) { return $degenerate_codon }
+ }
+ }
+
+}
+
+=head1 DESCRIPTION
+
+This script takes a protein motif as input and returns a degenerate
+oligonucleotide sequence corresponding to it. The main reason for doing this
+is to design degenerate primers that amplify a given sequence pattern.
+
@@ Diff output truncated at 10000 characters. @@
From bugzilla-daemon at portal.open-bio.org Thu Mar 12 10:36:00 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 12 Mar 2009 10:36:00 -0400
Subject: [Bioperl-guts-l] [Bug 2789] Script submission: reverse translate
Profam motifs
In-Reply-To:
Message-ID: <200903121436.n2CEa0bm031155@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2789
bosborne at alum.mit.edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Comment #2 from bosborne at alum.mit.edu 2009-03-12 10:35 EST -------
Thank you.
--
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 Mar 13 11:50:13 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Fri, 13 Mar 2009 11:50:13 -0400
Subject: [Bioperl-guts-l] [Bug 2785] genbank to chadoxml
In-Reply-To:
Message-ID: <200903131550.n2DFoDFe016112@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2785
------- Comment #1 from valmik at bioanalysis.org 2009-03-13 11:50 EST -------
Created an attachment (id=1262)
--> (http://bugzilla.open-bio.org/attachment.cgi?id=1262&action=view)
Patch for chadoxml.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 Fri Mar 13 11:57:57 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Fri, 13 Mar 2009 11:57:57 -0400
Subject: [Bioperl-guts-l] [Bug 2785] genbank to chadoxml
In-Reply-To:
Message-ID: <200903131557.n2DFvvi9017003@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2785
------- Comment #2 from valmik at bioanalysis.org 2009-03-13 11:57 EST -------
(From update of attachment 1262)
Checking the length of $seq_so_type
--
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 maj at dev.open-bio.org Mon Mar 16 23:50:12 2009
From: maj at dev.open-bio.org (Mark Allen Jensen)
Date: Mon, 16 Mar 2009 23:50:12 -0400
Subject: [Bioperl-guts-l] [15590]
bioperl-live/trunk/Bio/DB/HIV/lanl-schema.xml: fixed misplaced sfield
closing tags
Message-ID: <200903170350.n2H3oCfd011266@dev.open-bio.org>
Revision: 15590
Author: maj
Date: 2009-03-16 23:50:10 -0400 (Mon, 16 Mar 2009)
Log Message:
-----------
fixed misplaced sfield closing tags
Modified Paths:
--------------
bioperl-live/trunk/Bio/DB/HIV/lanl-schema.xml
Modified: bioperl-live/trunk/Bio/DB/HIV/lanl-schema.xml
===================================================================
--- bioperl-live/trunk/Bio/DB/HIV/lanl-schema.xml 2009-03-12 14:13:50 UTC (rev 15589)
+++ bioperl-live/trunk/Bio/DB/HIV/lanl-schema.xml 2009-03-17 03:50:10 UTC (rev 15590)
@@ -229,8 +229,9 @@
hla_type
hla_type
- patient.pat_id
-pat_id
+ patient.pat_id
+ pat_id
+
patient.pat_infection_citypat_infection_city
infection_city
infection_city
@@ -1461,8 +1462,9 @@
gb_update_date
gb_update
- sequenceentry.se_id
-se_id
+ sequenceentry.se_id
+ se_id
+
sequenceentry.se_sequencese_sequence
sequence
sequence
From maj at dev.open-bio.org Mon Mar 16 23:51:34 2009
From: maj at dev.open-bio.org (Mark Allen Jensen)
Date: Mon, 16 Mar 2009 23:51:34 -0400
Subject: [Bioperl-guts-l] [15591]
bioperl-live/trunk/Bio/DB/HIV/HIVQueryHelper.pm: put_value now puts an
undef if VALUE is undef (before, created
Message-ID: <200903170351.n2H3pYEv011297@dev.open-bio.org>
Revision: 15591
Author: maj
Date: 2009-03-16 23:51:33 -0400 (Mon, 16 Mar 2009)
Log Message:
-----------
put_value now puts an undef if VALUE is undef (before, created
a new AnnotationCollection object. Duh.)
Modified Paths:
--------------
bioperl-live/trunk/Bio/DB/HIV/HIVQueryHelper.pm
Modified: bioperl-live/trunk/Bio/DB/HIV/HIVQueryHelper.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/HIV/HIVQueryHelper.pm 2009-03-17 03:50:10 UTC (rev 15590)
+++ bioperl-live/trunk/Bio/DB/HIV/HIVQueryHelper.pm 2009-03-17 03:51:33 UTC (rev 15591)
@@ -2085,7 +2085,7 @@
my @args = @_;
my ($keys, $value) = $self->_rearrange([qw( KEYS VALUE )], @args);
my (@keys, $lastkey);
- $value ||= new Bio::Annotation::Collection;
+# $value ||= new Bio::Annotation::Collection;
@keys = (ref($keys) eq 'ARRAY') ? @$keys : ($keys);
$lastkey = pop @keys;
foreach (@keys) {
From maj at dev.open-bio.org Mon Mar 16 23:52:52 2009
From: maj at dev.open-bio.org (Mark Allen Jensen)
Date: Mon, 16 Mar 2009 23:52:52 -0400
Subject: [Bioperl-guts-l] [15592]
bioperl-live/trunk/Bio/DB/Query/HIVQuery.pm: added some external pod (for
get_keys() method)
Message-ID: <200903170352.n2H3qqU0011328@dev.open-bio.org>
Revision: 15592
Author: maj
Date: 2009-03-16 23:52:51 -0400 (Mon, 16 Mar 2009)
Log Message:
-----------
added some external pod (for get_keys() method)
Modified Paths:
--------------
bioperl-live/trunk/Bio/DB/Query/HIVQuery.pm
Modified: bioperl-live/trunk/Bio/DB/Query/HIVQuery.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/Query/HIVQuery.pm 2009-03-17 03:51:33 UTC (rev 15591)
+++ bioperl-live/trunk/Bio/DB/Query/HIVQuery.pm 2009-03-17 03:52:51 UTC (rev 15592)
@@ -614,6 +614,18 @@
=cut
+=head2 get_keys
+
+ Title : get_keys
+ Usage : $ac->get_keys($tagname_level_1, $tagname_level_2,...)
+ Function: Get an array of tagnames underneath the named tag nodes
+ Example : # prints the values of the members of Category 1...
+ print map { $ac->get_value($_) } $ac->get_keys('Category 1') ;
+ Returns : array of tagnames or empty list if the arguments represent a leaf
+ Args : [array of] tagname[s]
+
+=cut
+
=head1 GenBank accession manipulation methods
=head2 get_accessions
From maj at dev.open-bio.org Tue Mar 17 11:42:36 2009
From: maj at dev.open-bio.org (Mark Allen Jensen)
Date: Tue, 17 Mar 2009 11:42:36 -0400
Subject: [Bioperl-guts-l] [15593]
bioperl-live/trunk/Bio/DB/HIV/HIVQueryHelper.pm: mod to loadHIVSchema: now
returns the desc attributes associated
Message-ID: <200903171542.n2HFganX013513@dev.open-bio.org>
Revision: 15593
Author: maj
Date: 2009-03-17 11:42:34 -0400 (Tue, 17 Mar 2009)
Log Message:
-----------
mod to loadHIVSchema: now returns the desc attributes associated
with the fields; these can be accessed with the _sfieldh()
method
Modified Paths:
--------------
bioperl-live/trunk/Bio/DB/HIV/HIVQueryHelper.pm
Modified: bioperl-live/trunk/Bio/DB/HIV/HIVQueryHelper.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/HIV/HIVQueryHelper.pm 2009-03-17 03:52:51 UTC (rev 15592)
+++ bioperl-live/trunk/Bio/DB/HIV/HIVQueryHelper.pm 2009-03-17 15:42:34 UTC (rev 15593)
@@ -646,7 +646,13 @@
# exists a tag without content, but to convert to hashes
# with content as key, if all tags possess content
if (ref($ptr) eq 'HASH') {
- $ptr = [keys %{$ptr}];
+ my @k = keys %{$ptr};
+ if (grep /desc/, keys %{$ptr->{$k[0]}}) {
+ # slurp the desc's
+ $$h{desc} = [ map { $$ptr{$_}->{desc} } @k ];
+ }
+ # now overwrite with keys (descs in same order...)
+ $ptr = [@k];
}
elsif (ref($ptr) eq 'ARRAY') {
$ptr = [map { ref eq 'HASH' ? $_->{name} : $_ } @{$ptr}]
From maj at dev.open-bio.org Tue Mar 17 15:55:19 2009
From: maj at dev.open-bio.org (Mark Allen Jensen)
Date: Tue, 17 Mar 2009 15:55:19 -0400
Subject: [Bioperl-guts-l] [15594]
bioperl-live/trunk/Bio/DB/Query/HIVQuery.pm: get_accessions now properly
delivers GenBank accession number
Message-ID: <200903171955.n2HJtJvo013998@dev.open-bio.org>
Revision: 15594
Author: maj
Date: 2009-03-17 15:55:18 -0400 (Tue, 17 Mar 2009)
Log Message:
-----------
get_accessions now properly delivers GenBank accession number
Modified Paths:
--------------
bioperl-live/trunk/Bio/DB/Query/HIVQuery.pm
Modified: bioperl-live/trunk/Bio/DB/Query/HIVQuery.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/Query/HIVQuery.pm 2009-03-17 15:42:34 UTC (rev 15593)
+++ bioperl-live/trunk/Bio/DB/Query/HIVQuery.pm 2009-03-17 19:55:18 UTC (rev 15594)
@@ -650,7 +650,7 @@
}
my @ac = $self->get_annotations_by_ids($self->ids);
foreach (@ac) {
- push @ret, $_->get_value('accession');
+ push @ret, $_->get_value('Special','accession');
};
return @ret;
}
@@ -678,7 +678,7 @@
}
my @ac = $self->get_annotations_by_ids(@ids);
foreach (@ac) {
- push @ret, $_->get_value('accession');
+ push @ret, $_->get_value('Special', 'accession');
};
return wantarray ? @ret : $ret[0];
}
From dave_messina at dev.open-bio.org Wed Mar 18 19:00:29 2009
From: dave_messina at dev.open-bio.org (Dave Messina)
Date: Wed, 18 Mar 2009 19:00:29 -0400
Subject: [Bioperl-guts-l] [15595] bioperl-live/trunk/Bio/SearchIO.pm:
updating SearchIO POD to reflect WU-BLAST tabular format support that' s
present in blasttable.pm
Message-ID: <200903182300.n2IN0Tqa019859@dev.open-bio.org>
Revision: 15595
Author: dave_messina
Date: 2009-03-18 19:00:28 -0400 (Wed, 18 Mar 2009)
Log Message:
-----------
updating SearchIO POD to reflect WU-BLAST tabular format support that's present in blasttable.pm
Modified Paths:
--------------
bioperl-live/trunk/Bio/SearchIO.pm
Modified: bioperl-live/trunk/Bio/SearchIO.pm
===================================================================
--- bioperl-live/trunk/Bio/SearchIO.pm 2009-03-17 19:55:18 UTC (rev 15594)
+++ bioperl-live/trunk/Bio/SearchIO.pm 2009-03-18 23:00:28 UTC (rev 15595)
@@ -49,7 +49,7 @@
blast BLAST (WUBLAST, NCBIBLAST,bl2seq)
fasta FASTA -m9 and -m0
- blasttable BLAST -m9 or -m8 output (NCBI not WUBLAST tabular)
+ blasttable BLAST -m9 or -m8 output (both NCBI and WUBLAST tabular)
megablast MEGABLAST
psl UCSC PSL format
waba WABA output
From bugzilla-daemon at portal.open-bio.org Wed Mar 18 21:41:21 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 18 Mar 2009 21:41:21 -0400
Subject: [Bioperl-guts-l] [Bug 2792] New: Bio::Root::Build may cause an
infinite loop during some installations
Message-ID:
http://bugzilla.open-bio.org/show_bug.cgi?id=2792
Summary: Bio::Root::Build may cause an infinite loop during some
installations
Product: BioPerl
Version: main-trunk
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Core Components
AssignedTo: bioperl-guts-l at bioperl.org
ReportedBy: cjfields at bioperl.org
The automated module installation may cause an infinite loop under some
circumstances. We'll likely need to shut if off or make it optional so there
is a way out.
See these links to the mail list for details:
http://bioperl.org/pipermail/bioperl-l/2009-March/029521.html
http://bioperl.org/pipermail/bioperl-l/2009-March/029564.html
--
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 Mar 18 22:25:42 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Wed, 18 Mar 2009 22:25:42 -0400
Subject: [Bioperl-guts-l] [15596] bioperl-live/trunk/Bio/SeqIO/genbank.pm:
[bug 2784]
Message-ID: <200903190225.n2J2Pgs6020226@dev.open-bio.org>
Revision: 15596
Author: cjfields
Date: 2009-03-18 22:25:41 -0400 (Wed, 18 Mar 2009)
Log Message:
-----------
[bug 2784]
* fix DBSOURCE issue (thanks to Phillip Garland)
Modified Paths:
--------------
bioperl-live/trunk/Bio/SeqIO/genbank.pm
Modified: bioperl-live/trunk/Bio/SeqIO/genbank.pm
===================================================================
--- bioperl-live/trunk/Bio/SeqIO/genbank.pm 2009-03-18 23:00:28 UTC (rev 15595)
+++ bioperl-live/trunk/Bio/SeqIO/genbank.pm 2009-03-19 02:25:41 UTC (rev 15596)
@@ -214,7 +214,8 @@
TMHOBP COMPLUYEAST-2DPAGE OGP DictyBase HAMAP
PhotoList Gramene WormBase WormPep Genew ZFIN
PeroxiBase MaizeDB TAIR DrugBank REBASE HPA
- swissprot GenBank GenPept REFSEQ embl PDB);
+ swissprot GenBank GenPept REFSEQ embl PDB UniProtKB
+ DIP PeptideAtlas PRIDE CYGD HOGENOME Gene3D);
our %VALID_ALPHABET = (
'bp' => 'dna',
@@ -472,8 +473,8 @@
last if (/^\S/);
$dbsource .= $_;
}
- # deal with swissprot dbsources
- if( $dbsource =~ s/swissprot:\s+locus\s+(\S+)\,.+\n// ) {
+ # deal with UniProKB dbsources
+ if( $dbsource =~ s/UniProtKB:\s+locus\s+(\S+)\,.+\n// ) {
$annotation->add_Annotation
('dblink',
Bio::Annotation::DBLink->new
@@ -487,12 +488,12 @@
(-tagname => 'date_created',
-value => $1));
}
- while( $dbsource =~ s/\s+(sequence|annotation)\s+updated:\s+([^\.]+)\.\n//g ) {
+ while( $dbsource =~ s/\s+(sequence|annotation)\s+updated:\s+([^\.]+)\.\n// ) {
$annotation->add_Annotation
('swissprot_dates',
Bio::Annotation::SimpleValue->new
(-tagname => 'date_updated',
- -value => $1));
+ -value => $2));
}
$dbsource =~ s/\n/ /g;
if( $dbsource =~ s/\s+xrefs:\s+((?:\S+,\s+)+\S+)\s+xrefs/xrefs/ ) {
From bugzilla-daemon at portal.open-bio.org Wed Mar 18 22:26:09 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 18 Mar 2009 22:26:09 -0400
Subject: [Bioperl-guts-l] [Bug 2784] DBSOURCE DB.t test failure
In-Reply-To:
Message-ID: <200903190226.n2J2Q9ew032060@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2784
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Comment #2 from cjfields at bioperl.org 2009-03-18 22:26 EST -------
Patch committed to svn. 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 cjfields at dev.open-bio.org Wed Mar 18 22:32:37 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Wed, 18 Mar 2009 22:32:37 -0400
Subject: [Bioperl-guts-l] [15597] bioperl-live/trunk/Bio/SeqIO/scf.pm: use
statement missing
Message-ID: <200903190232.n2J2WbJ6020257@dev.open-bio.org>
Revision: 15597
Author: cjfields
Date: 2009-03-18 22:32:37 -0400 (Wed, 18 Mar 2009)
Log Message:
-----------
use statement missing
Modified Paths:
--------------
bioperl-live/trunk/Bio/SeqIO/scf.pm
Modified: bioperl-live/trunk/Bio/SeqIO/scf.pm
===================================================================
--- bioperl-live/trunk/Bio/SeqIO/scf.pm 2009-03-19 02:25:41 UTC (rev 15596)
+++ bioperl-live/trunk/Bio/SeqIO/scf.pm 2009-03-19 02:32:37 UTC (rev 15597)
@@ -81,6 +81,7 @@
use strict;
use Bio::Seq::SeqFactory;
use Bio::Seq::SequenceTrace;
+use Bio::Annotation::Comment;
use Dumpvalue;
my $dumper = new Dumpvalue();
From cjfields at dev.open-bio.org Wed Mar 18 23:08:57 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Wed, 18 Mar 2009 23:08:57 -0400
Subject: [Bioperl-guts-l] [15598] bioperl-live/trunk: * tweak last commit
(wasn't passing other tests ) - now allows either UniProt or SwissProt
Message-ID: <200903190308.n2J38vho020372@dev.open-bio.org>
Revision: 15598
Author: cjfields
Date: 2009-03-18 23:08:57 -0400 (Wed, 18 Mar 2009)
Log Message:
-----------
* tweak last commit (wasn't passing other tests) - now allows either UniProt or SwissProt
* modify tests to reflect swissprot
* Taxonomy remote data changed (verified)
Modified Paths:
--------------
bioperl-live/trunk/Bio/SeqIO/genbank.pm
bioperl-live/trunk/t/RemoteDB/DB.t
bioperl-live/trunk/t/RemoteDB/Taxonomy.t
Modified: bioperl-live/trunk/Bio/SeqIO/genbank.pm
===================================================================
--- bioperl-live/trunk/Bio/SeqIO/genbank.pm 2009-03-19 02:32:37 UTC (rev 15597)
+++ bioperl-live/trunk/Bio/SeqIO/genbank.pm 2009-03-19 03:08:57 UTC (rev 15598)
@@ -474,12 +474,12 @@
$dbsource .= $_;
}
# deal with UniProKB dbsources
- if( $dbsource =~ s/UniProtKB:\s+locus\s+(\S+)\,.+\n// ) {
+ if( $dbsource =~ s/(UniProtKB|swissprot):\s+locus\s+(\S+)\,.+\n// ) {
$annotation->add_Annotation
('dblink',
Bio::Annotation::DBLink->new
- (-primary_id => $1,
- -database => 'swissprot',
+ (-primary_id => $2,
+ -database => $1,
-tagname => 'dblink'));
if( $dbsource =~ s/\s+created:\s+([^\.]+)\.\n// ) {
$annotation->add_Annotation
@@ -488,7 +488,7 @@
(-tagname => 'date_created',
-value => $1));
}
- while( $dbsource =~ s/\s+(sequence|annotation)\s+updated:\s+([^\.]+)\.\n// ) {
+ while( $dbsource =~ s/\s+(sequence|annotation)\s+updated:\s+([^\.]+)\.\n//g ) {
$annotation->add_Annotation
('swissprot_dates',
Bio::Annotation::SimpleValue->new
Modified: bioperl-live/trunk/t/RemoteDB/DB.t
===================================================================
--- bioperl-live/trunk/t/RemoteDB/DB.t 2009-03-19 02:32:37 UTC (rev 15597)
+++ bioperl-live/trunk/t/RemoteDB/DB.t 2009-03-19 03:08:57 UTC (rev 15598)
@@ -295,7 +295,7 @@
# small chance this might change but hopefully not
my @annot = $seq->annotation->get_Annotations('dblink');
cmp_ok(scalar(@annot), '>', 31);
- is $annot[0]->database, 'swissprot';
+ is $annot[0]->database, 'UniProtKB';
is $annot[0]->primary_id, '2AAA_YEAST';
is (($seq->annotation->get_Annotations('swissprot_dates'))[0]->value, 'Jul 1, 1993');
}
Modified: bioperl-live/trunk/t/RemoteDB/Taxonomy.t
===================================================================
--- bioperl-live/trunk/t/RemoteDB/Taxonomy.t 2009-03-19 02:32:37 UTC (rev 15597)
+++ bioperl-live/trunk/t/RemoteDB/Taxonomy.t 2009-03-19 03:08:57 UTC (rev 15598)
@@ -106,7 +106,7 @@
is $id, 32061;
@ids = $db->get_taxonids('Rhodotorula');
- is @ids, 8;
+ cmp_ok @ids, '>=' , 8;
@ids = $db->get_taxonids('Rhodotorula ');
is @ids, 1;
is $ids[0], 231509;
From cjfields at dev.open-bio.org Wed Mar 18 23:10:12 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Wed, 18 Mar 2009 23:10:12 -0400
Subject: [Bioperl-guts-l] [15599]
bioperl-live/trunk/Bio/SeqIO/Handler/GenericRichSeqHandler.pm: update
handler to sync with genbank
Message-ID: <200903190310.n2J3ACfW020403@dev.open-bio.org>
Revision: 15599
Author: cjfields
Date: 2009-03-18 23:10:12 -0400 (Wed, 18 Mar 2009)
Log Message:
-----------
update handler to sync with genbank
Modified Paths:
--------------
bioperl-live/trunk/Bio/SeqIO/Handler/GenericRichSeqHandler.pm
Modified: bioperl-live/trunk/Bio/SeqIO/Handler/GenericRichSeqHandler.pm
===================================================================
--- bioperl-live/trunk/Bio/SeqIO/Handler/GenericRichSeqHandler.pm 2009-03-19 03:08:57 UTC (rev 15598)
+++ bioperl-live/trunk/Bio/SeqIO/Handler/GenericRichSeqHandler.pm 2009-03-19 03:10:12 UTC (rev 15599)
@@ -226,7 +226,7 @@
TMHOBP COMPLUYEAST-2DPAGE OGP DictyBase HAMAP
PhotoList Gramene WormBase WormPep Genew ZFIN
PeroxiBase MaizeDB TAIR DrugBank REBASE HPA
- swissprot GenBank GenPept REFSEQ embl PDB);
+ swissprot GenBank GenPept REFSEQ embl PDB UniProtKB);
my %NOPROCESS = map {$_ => 1} qw(DBSOURCE ORGANISM FEATURES);
@@ -874,12 +874,12 @@
my $annotation = $self->annotation_collection;
# deal with swissprot dbsources
# we could possibly parcel these out to subhandlers...
- if( $dbsource =~ s/swissprot:\s+locus\s+(\S+)\,.+\n// ) {
+ if( $dbsource =~ s/(UniProtKB|swissprot):\s+locus\s+(\S+)\,.+\n// ) {
$annotation->add_Annotation
- ('d blink',
+ ('dblink',
Bio::Annotation::DBLink->new
- (-primary_id => $1,
- -database => 'swissprot',
+ (-primary_id => $2,
+ -database => $1,
-tagname => 'dblink'));
if( $dbsource =~ s/\s*created:\s+([^\.]+)\.\n// ) {
$annotation->add_Annotation
From bugzilla-daemon at portal.open-bio.org Wed Mar 18 23:31:54 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 18 Mar 2009 23:31:54 -0400
Subject: [Bioperl-guts-l] [Bug 2785] genbank to chadoxml
In-Reply-To:
Message-ID: <200903190331.n2J3Vs60004087@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2785
------- Comment #3 from cjfields at bioperl.org 2009-03-18 23:31 EST -------
I'm a bit confused. Are you feeding the chadoxml parser genbank data? If so
then, yes, it would fail b/c it's not the correct format. Or am I mistaken?
You'll need to provide an example script and chadoxml file causing the problem
before I commit the patch.
--
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 Mar 18 23:33:22 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 18 Mar 2009 23:33:22 -0400
Subject: [Bioperl-guts-l] [Bug 2786] StandAlone Blast problem
In-Reply-To:
Message-ID: <200903190333.n2J3XM3X004168@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2786
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
------- Comment #1 from cjfields at bioperl.org 2009-03-18 23:33 EST -------
Please resubmit the bug along with an explanation of exactly what the error is.
--
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 Mar 18 23:48:17 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Wed, 18 Mar 2009 23:48:17 -0400
Subject: [Bioperl-guts-l] [15600] bioperl-live/trunk/Bio/SeqIO/chadoxml.pm:
[bug 2785]
Message-ID: <200903190348.n2J3mHg2020457@dev.open-bio.org>
Revision: 15600
Author: cjfields
Date: 2009-03-18 23:48:17 -0400 (Wed, 18 Mar 2009)
Log Message:
-----------
[bug 2785]
* patch sort of fixes chadoxml.pm, but I suggest not using bp_seqconvert for this format!
Modified Paths:
--------------
bioperl-live/trunk/Bio/SeqIO/chadoxml.pm
Modified: bioperl-live/trunk/Bio/SeqIO/chadoxml.pm
===================================================================
--- bioperl-live/trunk/Bio/SeqIO/chadoxml.pm 2009-03-19 03:10:12 UTC (rev 15599)
+++ bioperl-live/trunk/Bio/SeqIO/chadoxml.pm 2009-03-19 03:48:17 UTC (rev 15600)
@@ -519,14 +519,19 @@
$gb_type = 'DNA' if $ftype eq 'dna';
$gb_type = 'RNA' if $ftype eq 'rna';
- if (defined $seq_so_type) {
- $ftype = $seq_so_type;
+ if(length $seq_so_type > 0) {
+ if (defined $seq_so_type) {
+ $ftype = $seq_so_type;
+ }
+ elsif ($seq->type) {
+ $ftype = ($seq->type =~ /(.*):/)
+ ? $1
+ : $seq->type;
+ }
+ else {
+ $ftype = $gb_type;
+ }
}
- elsif ($seq->type) {
- $ftype = ($seq->type =~ /(.*):/)
- ? $1
- : $seq->type;
- }
else {
$ftype = $gb_type;
}
From bugzilla-daemon at portal.open-bio.org Wed Mar 18 23:49:00 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 18 Mar 2009 23:49:00 -0400
Subject: [Bioperl-guts-l] [Bug 2785] genbank to chadoxml
In-Reply-To:
Message-ID: <200903190349.n2J3n026004964@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2785
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Comment #4 from cjfields at bioperl.org 2009-03-18 23:49 EST -------
Okay, I'm able to reproduce this to some extent with an example genbank file
and have applied the patch. However I'm getting all sorts of typing issues.
I'll close this out but I suggest not using bp_seqconvert for this particular
sequence format. If you look at the chadoxml POD it relies on much more than
simple no-arg write_seq; lots of other arguments can be passed to the
constructor and to write_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 bugzilla-daemon at portal.open-bio.org Wed Mar 18 23:49:59 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 18 Mar 2009 23:49:59 -0400
Subject: [Bioperl-guts-l] [Bug 2746] [TODO] Update TCoffee wrapper for later
versions
In-Reply-To:
Message-ID: <200903190349.n2J3nxKA005035@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2746
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Comment #2 from cjfields at bioperl.org 2009-03-18 23:49 EST -------
This appears to be working fine, closing out.
--
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 Mar 18 23:51:21 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 18 Mar 2009 23:51:21 -0400
Subject: [Bioperl-guts-l] [Bug 2747] [TODO] Build.PL requirement for
Bio::Root::Build needs to be eval'd
In-Reply-To:
Message-ID: <200903190351.n2J3pLCA005130@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2747
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Comment #2 from cjfields at bioperl.org 2009-03-18 23:51 EST -------
Appears to be working. We could probably have a bootstrap mini-class to handle
lack of BioPerl core in the future.
--
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 Mar 18 23:56:31 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Wed, 18 Mar 2009 23:56:31 -0400
Subject: [Bioperl-guts-l] [15601]
bioperl-db/trunk/Bio/DB/BioSQL/Oracle/BiosequenceAdaptorDriver.pm: [bug
2757]
Message-ID: <200903190356.n2J3uVds020508@dev.open-bio.org>
Revision: 15601
Author: cjfields
Date: 2009-03-18 23:56:31 -0400 (Wed, 18 Mar 2009)
Log Message:
-----------
[bug 2757]
* patch for error handling, per Mark Johnson
Modified Paths:
--------------
bioperl-db/trunk/Bio/DB/BioSQL/Oracle/BiosequenceAdaptorDriver.pm
Modified: bioperl-db/trunk/Bio/DB/BioSQL/Oracle/BiosequenceAdaptorDriver.pm
===================================================================
--- bioperl-db/trunk/Bio/DB/BioSQL/Oracle/BiosequenceAdaptorDriver.pm 2009-03-19 03:48:17 UTC (rev 15600)
+++ bioperl-db/trunk/Bio/DB/BioSQL/Oracle/BiosequenceAdaptorDriver.pm 2009-03-19 03:56:31 UTC (rev 15601)
@@ -267,7 +267,13 @@
$sth->bind_param(1, $bioentryid);
}
# execute and fetch
- $sth->execute();
+ if (! $sth->execute()) {
+ $self->throw("error while executing query $cache_key with values ("
+ .(defined($start) ? "$start;" : "")
+ .(defined($end) ? ($end-$start+1).";" : "")
+ .$bioentryid."):\n"
+ .$sth->errstr." (".$sth->state.")");
+ }
$row = $sth->fetchall_arrayref();
return (@$row ? $row->[0]->[0] : undef);
}
From bugzilla-daemon at portal.open-bio.org Wed Mar 18 23:56:46 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Wed, 18 Mar 2009 23:56:46 -0400
Subject: [Bioperl-guts-l] [Bug 2757] DBI $sth->execute() with no error check
in Bio::DB::BioSQL::Oracle::BiosequenceAdaptorDriver
In-Reply-To:
Message-ID: <200903190356.n2J3ukDI005437@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2757
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Comment #2 from cjfields at bioperl.org 2009-03-18 23:56 EST -------
Patch committed. Thanks Mark!
--
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 lstein at dev.open-bio.org Thu Mar 19 17:58:54 2009
From: lstein at dev.open-bio.org (Lincoln Stein)
Date: Thu, 19 Mar 2009 17:58:54 -0400
Subject: [Bioperl-guts-l] [15602] bioperl-live/trunk/Bio/DB/SeqFeature:
killed fencepost error when fetching features by seqid without start or end
defined
Message-ID: <200903192158.n2JLwsHp023748@dev.open-bio.org>
Revision: 15602
Author: lstein
Date: 2009-03-19 17:58:53 -0400 (Thu, 19 Mar 2009)
Log Message:
-----------
killed fencepost error when fetching features by seqid without start or end defined
Modified Paths:
--------------
bioperl-live/trunk/Bio/DB/SeqFeature/Store/DBI/mysql.pm
bioperl-live/trunk/Bio/DB/SeqFeature/Store/GFF3Loader.pm
bioperl-live/trunk/Bio/DB/SeqFeature/Store/LoadHelper.pm
bioperl-live/trunk/Bio/DB/SeqFeature/Store/Loader.pm
bioperl-live/trunk/Bio/DB/SeqFeature/Store/bdb.pm
bioperl-live/trunk/Bio/DB/SeqFeature/Store/berkeleydb.pm
bioperl-live/trunk/Bio/DB/SeqFeature/Store/memory.pm
bioperl-live/trunk/Bio/DB/SeqFeature/Store.pm
Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store/DBI/mysql.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store/DBI/mysql.pm 2009-03-19 03:56:31 UTC (rev 15601)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store/DBI/mysql.pm 2009-03-19 21:58:53 UTC (rev 15602)
@@ -538,11 +538,6 @@
###
-# We allow the load directory to be deleted
-#
-sub requires_stable_tempdir { 0 }
-
-###
# Add a subparts to a feature. Both feature and all subparts must already be in database.
#
sub _add_SeqFeature {
Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store/GFF3Loader.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store/GFF3Loader.pm 2009-03-19 03:56:31 UTC (rev 15601)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store/GFF3Loader.pm 2009-03-19 21:58:53 UTC (rev 15602)
@@ -303,11 +303,8 @@
$self->{load_data}{IndexSubfeatures} = $self->index_subfeatures();
$self->{load_data}{mode} = 'gff';
- my $keep_tempdir = $self->store->requires_stable_tempdir;
-
$self->{load_data}{Helper} =
- Bio::DB::SeqFeature::Store::LoadHelper->new($self->{tmpdir},
- $keep_tempdir);
+ Bio::DB::SeqFeature::Store::LoadHelper->new($self->{tmpdir});
}
sub finish_load { #overridden
@@ -472,7 +469,7 @@
my @columns = map {$_ eq '.' ? undef : $_ } split /\t/,$gff_line;
- $self->invalid_gff($gff_line) if @columns < 8;
+ $self->invalid_gff($gff_line) if @columns < 4;
$self->invalid_gff($gff_line) if @columns > 9 && $allow_whitespace;
{
Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store/LoadHelper.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store/LoadHelper.pm 2009-03-19 03:56:31 UTC (rev 15601)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store/LoadHelper.pm 2009-03-19 21:58:53 UTC (rev 15602)
@@ -37,6 +37,7 @@
use strict;
use DB_File;
+use File::Path 'rmtree';
use File::Temp 'tempdir';
use File::Spec;
use Fcntl qw(O_CREAT O_RDWR);
@@ -44,18 +45,20 @@
sub new {
my $class = shift;
my $tmpdir = shift;
- my $keep = shift;
- my @tmpargs = $tmpdir ? (DIR=>$tmpdir) : ();
+ my $template = 'SeqFeatureLoadHelper_XXXXXX';
+
+ my @tmpargs = $tmpdir ? ($template,DIR=>$tmpdir) : ($template);
my $tmppath = tempdir(@tmpargs,CLEANUP=>1);
my $self = $class->create_dbs($tmppath);
- $self->{keep} = $keep;
+ $self->{tmppath} = $tmppath;
return bless $self,$class;
}
sub DESTROY {
my $self = shift;
- File::Temp::cleanup() unless $self->{keep};
+ rmtree $self->{tmppath};
+# File::Temp::cleanup() unless $self->{keep};
}
sub create_dbs {
Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store/Loader.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store/Loader.pm 2009-03-19 03:56:31 UTC (rev 15601)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store/Loader.pm 2009-03-19 21:58:53 UTC (rev 15602)
@@ -145,14 +145,17 @@
eval "require Time::HiRes";
$tmpdir ||= File::Spec->tmpdir();
- my $dsn = tempdir(DIR=>$tmpdir,CLEANUP=>1);
my $tmp_store = Bio::DB::SeqFeature::Store->new(-adaptor => 'berkeleydb',
-temporary=> 1,
- -dsn => $dsn,
+ -dsn => tempdir(
+ 'BioDBSeqFeature_XXXXXXX',
+ DIR=>$tmpdir,
+ CLEANUP=>1
+ ),
-cache => 1,
-write => 1)
- unless $normalized;
+ unless $normalized;
$index_subfeatures = 1 unless defined $index_subfeatures;
Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store/bdb.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store/bdb.pm 2009-03-19 03:56:31 UTC (rev 15601)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store/bdb.pm 2009-03-19 21:58:53 UTC (rev 15602)
@@ -101,7 +101,6 @@
sub DESTROY {
my $self = shift;
my $db = $self->db;
- warn "CLEANING UP";
untie %$db;
rmtree($self->directory,0,1) if $self->temporary;
}
Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store/berkeleydb.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store/berkeleydb.pm 2009-03-19 03:56:31 UTC (rev 15601)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store/berkeleydb.pm 2009-03-19 21:58:53 UTC (rev 15602)
@@ -254,6 +254,7 @@
[qw(WRITE WRITABLE)],
'CREATE',
], at _);
+
if ($autoindex) {
-d $autoindex or $self->throw("Invalid directory $autoindex");
$directory ||= "$autoindex/indexes";
Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store/memory.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store/memory.pm 2009-03-19 03:56:31 UTC (rev 15601)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store/memory.pm 2009-03-19 21:58:53 UTC (rev 15602)
@@ -446,6 +446,7 @@
# be suspicious of this -- possibly a fencepost error at $end
$start = $bins[0] * BINSIZE unless defined $start;
$end = $bins[-1] * BINSIZE unless defined $end;
+ $end += BINSIZE if $start==$end;
}
my %seenit;
my $bin_min = int $start/BINSIZE;
Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store.pm 2009-03-19 03:56:31 UTC (rev 15601)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store.pm 2009-03-19 21:58:53 UTC (rev 15602)
@@ -1866,24 +1866,6 @@
# relationships using _add_SeqFeature and return them using _fetch_SeqFeatures
sub can_store_parentage { return; }
-=head2 requires_stable_tempdir
-
- Title : requires_stable_tempdir
- Usage : $flag = $db->requires_stable_tempdir
- Function: return true if this adaptor needs its load directory to hang around
- Returns : boolean
- Args : none
- Status : OPTIONAL; MAY BE IMPLEMENTED BY ADAPTORS
-
-Override this method and return true if this adaptor will not tolerate
-having its load directory deleted while it is still running. This is
-currently the case for the in-memory and berkeleydb adaptors and is true
-by default.
-
-=cut
-
-sub requires_stable_tempdir { 1 }
-
=head2 _add_SeqFeature
Title : _add_SeqFeature
From lstein at dev.open-bio.org Thu Mar 19 18:07:00 2009
From: lstein at dev.open-bio.org (Lincoln Stein)
Date: Thu, 19 Mar 2009 18:07:00 -0400
Subject: [Bioperl-guts-l] [15603]
bioperl-live/trunk/Bio/DB/SeqFeature/Store/memory.pm: better fix
Message-ID: <200903192207.n2JM70So023811@dev.open-bio.org>
Revision: 15603
Author: lstein
Date: 2009-03-19 18:06:59 -0400 (Thu, 19 Mar 2009)
Log Message:
-----------
better fix
Modified Paths:
--------------
bioperl-live/trunk/Bio/DB/SeqFeature/Store/memory.pm
Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store/memory.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store/memory.pm 2009-03-19 21:58:53 UTC (rev 15602)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store/memory.pm 2009-03-19 22:06:59 UTC (rev 15603)
@@ -443,10 +443,8 @@
if (!defined $start or !defined $end or $range_type eq 'contained_in') {
@bins = sort {$a<=>$b} keys %{$index};
- # be suspicious of this -- possibly a fencepost error at $end
$start = $bins[0] * BINSIZE unless defined $start;
- $end = $bins[-1] * BINSIZE unless defined $end;
- $end += BINSIZE if $start==$end;
+ $end = @bins == 1 ? BINSIZE : $bins[-1] * BINSIZE unless defined $end;
}
my %seenit;
my $bin_min = int $start/BINSIZE;
From bugzilla-daemon at portal.open-bio.org Thu Mar 19 19:47:16 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 19 Mar 2009 19:47:16 -0400
Subject: [Bioperl-guts-l] [Bug 2793] New: Bio::SimpleAlign::add_seq() :
zero-origin sequence order
Message-ID:
http://bugzilla.open-bio.org/show_bug.cgi?id=2793
Summary: Bio::SimpleAlign::add_seq() : zero-origin sequence order
Product: BioPerl
Version: 1.6 branch
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Core Components
AssignedTo: bioperl-guts-l at bioperl.org
ReportedBy: maj at fortinbras.us
Bio::SimpleAlign add_seq function:
Sequence order is counted from 0 not 1, unlike in other functions,
such as get_seq_by_pos and select.
--
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 Mar 19 19:47:36 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Thu, 19 Mar 2009 19:47:36 -0400
Subject: [Bioperl-guts-l] [Bug 2793] Bio::SimpleAlign::add_seq() :
zero-origin sequence order
In-Reply-To:
Message-ID: <200903192347.n2JNlaA8027782@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2793
maj at fortinbras.us changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
--
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 Mar 20 10:57:21 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Fri, 20 Mar 2009 10:57:21 -0400
Subject: [Bioperl-guts-l] [Bug 2794] New: Bioperl 1.6 not available on PPM
Message-ID:
http://bugzilla.open-bio.org/show_bug.cgi?id=2794
Summary: Bioperl 1.6 not available on PPM
Product: BioPerl
Version: 1.6 branch
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: Core Components
AssignedTo: bioperl-guts-l at bioperl.org
ReportedBy: fossandon at vtr.net
Final Bioperl 1.6 was released a while ago, but it's still unavailable for
installation using the Perl Package Manager for Windows since is not listed in
the "http://bioperl.org/DIST/package.xml" downloaded by the PPM.
Shouldn't that XML be cleaned and updated to the current version? I don't know
the proportion of Bioperl Windows users, but it would help a lot.
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 bugzilla-daemon at portal.open-bio.org Fri Mar 20 16:50:28 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Fri, 20 Mar 2009 16:50:28 -0400
Subject: [Bioperl-guts-l] [Bug 2793] Bio::SimpleAlign::add_seq() :
zero-origin sequence order
In-Reply-To:
Message-ID: <200903202050.n2KKoSGx032472@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2793
------- Comment #1 from jay at jays.net 2009-03-20 16:50 EST -------
Created an attachment (id=1264)
--> (http://bugzilla.open-bio.org/attachment.cgi?id=1264&action=view)
Patch that fixes this bug (complete w/ tests)
--
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 Mar 20 17:28:39 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Fri, 20 Mar 2009 17:28:39 -0400
Subject: [Bioperl-guts-l] [Bug 2793] Bio::SimpleAlign::add_seq() :
zero-origin sequence order
In-Reply-To:
Message-ID: <200903202128.n2KLSd1P002851@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2793
------- Comment #2 from maj at fortinbras.us 2009-03-20 17:28 EST -------
(In reply to comment #1)
> Created an attachment (id=1264)
--> (http://bugzilla.open-bio.org/attachment.cgi?id=1264&action=view) [details]
> Patch that fixes this bug (complete w/ tests)
>
clever-- probably want a boundary check on $order now.
--
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 Sat Mar 21 13:39:44 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sat, 21 Mar 2009 13:39:44 -0400
Subject: [Bioperl-guts-l] [Bug 2796] New: AlignIO::stockholm sequence parsing
Message-ID:
http://bugzilla.open-bio.org/show_bug.cgi?id=2796
Summary: AlignIO::stockholm sequence parsing
Product: BioPerl
Version: 1.5 branch
Platform: PC
OS/Version: Mac OS
Status: NEW
Severity: normal
Priority: P2
Component: Core Components
AssignedTo: bioperl-guts-l at bioperl.org
ReportedBy: bernd at bio.vu.nl
Hi
With Bioperl 1.5.2 I found that reading sequences in next_aln stops as soon as
a non-allowed chars in encountered in the sequence. The same code is present on
http://doc.bioperl.org/bioperl-live/
(with respect to bug #2567: is http://doc.bioperl.org/bioperl-live/ reflecting
the 1.6 code ?; it seems that identical stockholm ids are results in
concateneted seqs with the code on http://doc.bioperl.org/bioperl-live/
next_aln might be an older version on this site)
The line is in next_aln:
} elsif( $line =~ m{^([^\#]\S+)\s+([A-Za-z.\-\*]+)\s*}xms ) {
($name,$seq) = ($1,$2);
if( ! exists $align{$name} ) {
Gaps are hardcoded here as . or -, this means that ~ (allowed in PrimarySeq) is
not allowed here, but worse: the sequence is truncated now. In addition: why
check for allowed chars here anyway, this is done in the Seq object right
(Bio::Seq::Meta here)? Why not read the entire line; the sequence part of
stockholm contains only sequences. I'd propose to change [A-Za-z\.\-] to . (not
sure if the xms modifiers are needed here) or \S
Another issue related to custom annotation. If WRITEORDER is not changed then
custom tag is named "custom". In write_aln:
} elsif ($tag eq 'XX') { # custom
my $newtag = $ann->tagname; #should be deleted ?
I thing the line my $newtag should not be here. Now the custom tag name is
changed from "XX" back to custom, with does not with in the 10 positions
allowed.
Example code and input are attached.
Regards,
Bernd
--
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 Sat Mar 21 13:43:18 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sat, 21 Mar 2009 13:43:18 -0400
Subject: [Bioperl-guts-l] [Bug 2796] AlignIO::stockholm sequence parsing
In-Reply-To:
Message-ID: <200903211743.n2LHhIaL013686@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2796
------- Comment #1 from bernd at bio.vu.nl 2009-03-21 13:43 EST -------
Created an attachment (id=1265)
--> (http://bugzilla.open-bio.org/attachment.cgi?id=1265&action=view)
bioperl example 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 Sat Mar 21 13:44:13 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sat, 21 Mar 2009 13:44:13 -0400
Subject: [Bioperl-guts-l] [Bug 2796] AlignIO::stockholm sequence parsing
In-Reply-To:
Message-ID: <200903211744.n2LHiDfd013742@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2796
------- Comment #2 from bernd at bio.vu.nl 2009-03-21 13:44 EST -------
Created an attachment (id=1266)
--> (http://bugzilla.open-bio.org/attachment.cgi?id=1266&action=view)
exampe stockholm input
note that the sequences are truncated after ~
--
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 Sun Mar 22 00:59:21 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Sun, 22 Mar 2009 00:59:21 -0400
Subject: [Bioperl-guts-l] [15604]
bioperl-live/trunk/Bio/AlignIO/stockholm.pm: [bug 2796]
Message-ID: <200903220459.n2M4xLvo008921@dev.open-bio.org>
Revision: 15604
Author: cjfields
Date: 2009-03-22 00:59:20 -0400 (Sun, 22 Mar 2009)
Log Message:
-----------
[bug 2796]
* partial fix for 2796
* getting an error with the example file not related to bug, likely due to ID not being parsed.
Modified Paths:
--------------
bioperl-live/trunk/Bio/AlignIO/stockholm.pm
Modified: bioperl-live/trunk/Bio/AlignIO/stockholm.pm
===================================================================
--- bioperl-live/trunk/Bio/AlignIO/stockholm.pm 2009-03-19 22:06:59 UTC (rev 15603)
+++ bioperl-live/trunk/Bio/AlignIO/stockholm.pm 2009-03-22 04:59:20 UTC (rev 15604)
@@ -156,7 +156,7 @@
use base qw(Bio::AlignIO);
-our $STKVERSION = 'STOCKHOLM 1.0';
+my $STKVERSION = 'STOCKHOLM 1.0';
# This maps the two-letter annotation key to a Annotation/parameter/tagname
# combination. Some data is stored using get/set methods ('Methods') The rest
@@ -226,7 +226,7 @@
# Some data is stored using get/set methods ('Methods'), others
# are mapped b/c of more complex annotation types.
-our %WRITEMAP = (
+my %WRITEMAP = (
'accession' => 'AC/Method',
'id' => 'ID/Method',
'description' => 'DE/Method',
@@ -260,6 +260,8 @@
'custom' => 'XX/SimpleValue'
);
+my $LOCAL_SYMBOLS;
+
# This maps the tagname back to a tagname-annotation value combination.
# Some data is stored using get/set methods ('Methods'), others
# are mapped b/c of more complex annotation types.
@@ -289,6 +291,10 @@
$self->spaces($spaces);
# hash for functions for decoding keys.
$handler ? $self->alignhandler($handler) :
+
+ # did I mention how much I hate globals?
+ $LOCAL_SYMBOLS = $Bio::LocatableSeq::MATCHPATTERN;
+
$self->alignhandler(Bio::AlignIO::Handler::GenericAlignHandler->new(
-format => 'stockholm',
-verbose => $self->verbose,
@@ -349,7 +355,7 @@
}
$align = ($primary_tag eq 'GF' || $primary_tag eq 'GR') ? 1 : 0;
}
- elsif ($line =~ m{^([^\#]\S+)\s+([A-Za-z.\-\*]+)\s*}) {
+ elsif ($line =~ m{^([^\#]\S+)\s+([$LOCAL_SYMBOLS]+)\s*}) {
$self->{block_line}++;
($feat, $nse, $data) = ('SEQUENCE', $1, $2);
}
@@ -412,7 +418,7 @@
$last_feat = $feat;
}
- my $aln = $handler->build_alignment;
+ my $aln = $handler->build_alignment;
$handler->reset_parameters;
return $aln;
}
@@ -646,20 +652,6 @@
return $self->{'_alignhandler'};
}
-=head2 alignwriter
-
- Title : alignwriter
- Usage : $stream->alignwriter($writer)
- Function: Get/Set the writer object
- Returns :
- Args :
-
-=cut
-
-sub alignwriter {
- shift->throw_not_implemented;
-}
-
############# PRIVATE INIT/HANDLER METHODS #############
sub _print_seqs {
From bugzilla-daemon at portal.open-bio.org Sun Mar 22 01:12:22 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sun, 22 Mar 2009 01:12:22 -0400
Subject: [Bioperl-guts-l] [Bug 2796] AlignIO::stockholm sequence parsing
In-Reply-To:
Message-ID: <200903220512.n2M5CMFk019570@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2796
------- Comment #3 from cjfields at bioperl.org 2009-03-22 01:12 EST -------
(In reply to comment #0)
> Hi
>
...
> Gaps are hardcoded here as . or -, this means that ~ (allowed in PrimarySeq) is
> not allowed here, but worse: the sequence is truncated now. In addition: why
> check for allowed chars here anyway, this is done in the Seq object right
> (Bio::Seq::Meta here)? Why not read the entire line; the sequence part of
> stockholm contains only sequences. I'd propose to change [A-Za-z\.\-] to . (not
> sure if the xms modifiers are needed here) or \S
The code was substantially modified from what you see in the above link (the
doc files appear old). However the problem is still present. This is now
fixed in svn to just read everything in the line (I think this was carried over
from the older stockholm parser, though I'm not sure).
I am now running into an issue with ID parsing which I am attempting to track
down; then I'll work on the below.
> Another issue related to custom annotation. If WRITEORDER is not changed then
> custom tag is named "custom". In write_aln:
> } elsif ($tag eq 'XX') { # custom
> my $newtag = $ann->tagname; #should be deleted ?
> I thing the line my $newtag should not be here. Now the custom tag name is
> changed from "XX" back to custom, with does not with in the 10 positions
> allowed.
--
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 Sun Mar 22 01:13:19 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Sun, 22 Mar 2009 01:13:19 -0400
Subject: [Bioperl-guts-l] [15605]
bioperl-live/trunk/Bio/AlignIO/stockholm.pm: [bug 2796]
Message-ID: <200903220513.n2M5DJnX008995@dev.open-bio.org>
Revision: 15605
Author: cjfields
Date: 2009-03-22 01:13:19 -0400 (Sun, 22 Mar 2009)
Log Message:
-----------
[bug 2796]
* just grab everything, let seq validation take care of rest (and we lose a global in the process!)
Modified Paths:
--------------
bioperl-live/trunk/Bio/AlignIO/stockholm.pm
Modified: bioperl-live/trunk/Bio/AlignIO/stockholm.pm
===================================================================
--- bioperl-live/trunk/Bio/AlignIO/stockholm.pm 2009-03-22 04:59:20 UTC (rev 15604)
+++ bioperl-live/trunk/Bio/AlignIO/stockholm.pm 2009-03-22 05:13:19 UTC (rev 15605)
@@ -260,8 +260,6 @@
'custom' => 'XX/SimpleValue'
);
-my $LOCAL_SYMBOLS;
-
# This maps the tagname back to a tagname-annotation value combination.
# Some data is stored using get/set methods ('Methods'), others
# are mapped b/c of more complex annotation types.
@@ -291,10 +289,6 @@
$self->spaces($spaces);
# hash for functions for decoding keys.
$handler ? $self->alignhandler($handler) :
-
- # did I mention how much I hate globals?
- $LOCAL_SYMBOLS = $Bio::LocatableSeq::MATCHPATTERN;
-
$self->alignhandler(Bio::AlignIO::Handler::GenericAlignHandler->new(
-format => 'stockholm',
-verbose => $self->verbose,
@@ -355,7 +349,7 @@
}
$align = ($primary_tag eq 'GF' || $primary_tag eq 'GR') ? 1 : 0;
}
- elsif ($line =~ m{^([^\#]\S+)\s+([$LOCAL_SYMBOLS]+)\s*}) {
+ elsif ($line =~ m{^([^\#]\S+)\s+([^\s]+)\s*}) {
$self->{block_line}++;
($feat, $nse, $data) = ('SEQUENCE', $1, $2);
}
From bugzilla-daemon at portal.open-bio.org Sun Mar 22 09:41:49 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sun, 22 Mar 2009 09:41:49 -0400
Subject: [Bioperl-guts-l] [Bug 2793] Bio::SimpleAlign::add_seq() :
zero-origin sequence order
In-Reply-To:
Message-ID: <200903221341.n2MDfnqb008590@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2793
jay at jays.net changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jay at jays.net
------- Comment #3 from jay at jays.net 2009-03-22 09:41 EST -------
(In reply to comment #2) From Mark A. Jensen 2009-03-20 17:28:39 EST
> clever-- probably want a boundary check on $order now.
I suppose. There were no tests for add_seq() while providing $order at all. Our
patch fixes the simplest possible usage of that feature, which was already in
add_seq() but is broken.
I imagine hundreds of additional tests could be added, and/or the functionality
of add_seq() could be constrained in all sorts of well-intentioned ways to stop
people from shooting themselves in the foot.
But I think our patch stands on it's own merits and fixes a bug, so should be
applied.
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 bugzilla-daemon at portal.open-bio.org Sun Mar 22 10:11:50 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sun, 22 Mar 2009 10:11:50 -0400
Subject: [Bioperl-guts-l] [Bug 2794] Bioperl 1.6 not available on PPM
In-Reply-To:
Message-ID: <200903221411.n2MEBohD010682@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2794
------- Comment #1 from cjfields at bioperl.org 2009-03-22 10:11 EST -------
I'll try getting that running this week. I remember running specifically into
two problems:
1) perl 5.10 doesn't have all required/recommended packages available as PPM
for Windows (this may have changed since late Jan):
2) PPM4 had problems reading the PPM XML for some reason.
--
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 Sun Mar 22 18:10:46 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sun, 22 Mar 2009 18:10:46 -0400
Subject: [Bioperl-guts-l] [Bug 2782] Bio::Tools::Run::Phylo::Phylip::SeqBoot
WON'T RUN
In-Reply-To:
Message-ID: <200903222210.n2MMAk76012103@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2782
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WORKSFORME
------- Comment #2 from cjfields at bioperl.org 2009-03-22 18:10 EST -------
No response. Closing ticket, works for me.
--
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 Sun Mar 22 18:13:15 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sun, 22 Mar 2009 18:13:15 -0400
Subject: [Bioperl-guts-l] [Bug 2758] assemblyIO - can't read phredPhrap ace
file with tagged repeats
In-Reply-To:
Message-ID: <200903222213.n2MMDF4l012369@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2758
------- Comment #3 from cjfields at bioperl.org 2009-03-22 18:13 EST -------
Janet,
Assembly issues are being pushed to the 1.7 milestone. Someone might tackle
this sooner however.
--
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 Sun Mar 22 18:34:26 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sun, 22 Mar 2009 18:34:26 -0400
Subject: [Bioperl-guts-l] [Bug 2758] assemblyIO - can't read phredPhrap ace
file with tagged repeats
In-Reply-To:
Message-ID: <200903222234.n2MMYQ0q014477@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2758
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|1.6.1 point release |1.7.0 release
--
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 Sun Mar 22 20:56:54 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Sun, 22 Mar 2009 20:56:54 -0400
Subject: [Bioperl-guts-l] [15606]
bioperl-live/trunk/Bio/AlignIO/Handler/GenericAlignHandler.pm: [ bug 2796]
Message-ID: <200903230056.n2N0usOO017618@dev.open-bio.org>
Revision: 15606
Author: cjfields
Date: 2009-03-22 20:56:53 -0400 (Sun, 22 Mar 2009)
Log Message:
-----------
[bug 2796]
* Now parses example
Modified Paths:
--------------
bioperl-live/trunk/Bio/AlignIO/Handler/GenericAlignHandler.pm
Modified: bioperl-live/trunk/Bio/AlignIO/Handler/GenericAlignHandler.pm
===================================================================
--- bioperl-live/trunk/Bio/AlignIO/Handler/GenericAlignHandler.pm 2009-03-22 05:13:19 UTC (rev 15605)
+++ bioperl-live/trunk/Bio/AlignIO/Handler/GenericAlignHandler.pm 2009-03-23 00:56:53 UTC (rev 15606)
@@ -498,7 +498,7 @@
my $new_acc;
if (exists $self->{'_params'}->{'-seq_accession'}) {
$new_acc = $self->{'_params'}->{'-seq_accession'}->{$data->{NSE}};
- }
+ }
if ($nse =~ m{(\S+?)(?:\.(\d+))?/(\d+)-(\d+)}xmso) {
my $strand = $data->{ALPHABET} eq 'dna' || $data->{ALPHABET} eq 'rna' ? 1 : undef;
my ($start, $end) = ($3, $4);
@@ -513,7 +513,7 @@
$data->{STRAND} = $strand;
} else {
# we can parse for version here if needed
- $data->{ACCESSION_NUMBER} = $data->{NSE};
+ $data->{DISPLAY_ID} = $data->{NSE};
}
}
From bugzilla-daemon at portal.open-bio.org Sun Mar 22 22:14:55 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sun, 22 Mar 2009 22:14:55 -0400
Subject: [Bioperl-guts-l] [Bug 2793] Bio::SimpleAlign::add_seq() :
zero-origin sequence order
In-Reply-To:
Message-ID: <200903230214.n2N2Etpu030069@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2793
------- Comment #4 from maj at fortinbras.us 2009-03-22 22:14 EST -------
(In reply to comment #3)
> (In reply to comment #2) From Mark A. Jensen 2009-03-20 17:28:39 EST
> > clever-- probably want a boundary check on $order now.
>
> I suppose. There were no tests for add_seq() while providing $order at all. Our
> patch fixes the simplest possible usage of that feature, which was already in
> add_seq() but is broken.
>
> I imagine hundreds of additional tests could be added, and/or the functionality
> of add_seq() could be constrained in all sorts of well-intentioned ways to stop
> people from shooting themselves in the foot.
>
> But I think our patch stands on it's own merits and fixes a bug, so should be
> applied.
>
> Thanks
>
Whoa, please chill, I just meant if $order is actually going to be specified by
the user, the code should make sure it's not negative.
--
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 Sun Mar 22 23:27:42 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Sun, 22 Mar 2009 23:27:42 -0400
Subject: [Bioperl-guts-l] [Bug 2796] AlignIO::stockholm sequence parsing
In-Reply-To:
Message-ID: <200903230327.n2N3RgqU003247@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2796
------- Comment #4 from cjfields at bioperl.org 2009-03-22 23:27 EST -------
Okay, found the problem with ID parsing and fixed it, so the example now
parses (was setting accession_number instead of display_id().
Just to note, the custom tag stuff is mainly just a fallback for anything not
caught during stockholm parsing (so, at the very least, it's caught and you can
somewhat reproduce the input alignment). It's probably not the best mechanism
for adding additional annotation beyond what's indicated in the POD, and is one
of the reasons why I'm working on a handler/writer version so one could
customize the steps a bit more. It still needs some tweaking though. I can
try to make it a bit friendlier to additional output in the meantime.
--
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 maj at dev.open-bio.org Mon Mar 23 01:40:13 2009
From: maj at dev.open-bio.org (Mark Allen Jensen)
Date: Mon, 23 Mar 2009 01:40:13 -0400
Subject: [Bioperl-guts-l] [15607] bioperl-live/trunk/Bio/SimpleAlign.pm:
patch for bug#2793, based on a solution of Jay Hannah/thanks
Message-ID: <200903230540.n2N5eDJw019224@dev.open-bio.org>
Revision: 15607
Author: maj
Date: 2009-03-23 01:40:13 -0400 (Mon, 23 Mar 2009)
Log Message:
-----------
patch for bug#2793, based on a solution of Jay Hannah/thanks
Modified Paths:
--------------
bioperl-live/trunk/Bio/SimpleAlign.pm
Modified: bioperl-live/trunk/Bio/SimpleAlign.pm
===================================================================
--- bioperl-live/trunk/Bio/SimpleAlign.pm 2009-03-23 00:56:53 UTC (rev 15606)
+++ bioperl-live/trunk/Bio/SimpleAlign.pm 2009-03-23 05:40:13 UTC (rev 15607)
@@ -132,6 +132,8 @@
Brian Osborne, bosborne at alum.mit.edu
Weigang Qiu, Weigang at GENECTR-HUNTER-CUNY-EDU
Hongyu Zhang, forward at hongyu.org
+Jay Hannah, jay at jays.net
+Alexandr Bezginov, albezg at gmail.com
=head1 SEE ALSO
@@ -272,11 +274,15 @@
Title : add_seq
Usage : $myalign->add_seq($newseq);
+ $myalign->add_seq(-SEQ=>$newseq, -ORDER=>5);
Function : Adds another sequence to the alignment. *Does not* align
it - just adds it to the hashes.
+ If -ORDER is specified, the sequence is inserted at the
+ the position spec'd by -ORDER, and existing sequences
+ are pushed down the storage array.
Returns : nothing
- Args : a Bio::LocatableSeq object
- order (optional)
+ Args : A Bio::LocatableSeq object
+ Positive integer for the sequence position (optional)
See L for more information
@@ -290,13 +296,22 @@
sub add_seq {
my $self = shift;
- my $seq = shift;
- my $order = shift;
+ my @args = @_;
+ my ($seq, $order) = $self->_rearrange([qw(SEQ ORDER)], @args);
my ($name,$id,$start,$end);
+ unless ($seq) {
+ $self->throw("LocatableSeq argument required");
+ }
if( ! ref $seq || ! $seq->isa('Bio::LocatableSeq') ) {
$self->throw("Unable to process non locatable sequences [". ref($seq). "]");
}
+ !defined($order) and $order = 1 + keys %{$self->{'_seq'}}; # default
+ $order--; # jay's patch (user-specified order is 1-origin)
+
+ if ($order < 0) {
+ $self->throw("User-specified value for ORDER must be >= 1");
+ }
$id = $seq->id() ||$seq->display_id || $seq->primary_id;
@@ -306,9 +321,6 @@
# symbol_chars
# map { $self->{'_symbols'}->{$_} = 1; } split(//,$seq->seq) if $seq->seq;
- if( !defined $order ) {
- $order = keys %{$self->{'_seq'}};
- }
$name = $seq->get_nse;
if( $self->{'_seq'}->{$name} ) {
From maj at dev.open-bio.org Mon Mar 23 01:43:09 2009
From: maj at dev.open-bio.org (Mark Allen Jensen)
Date: Mon, 23 Mar 2009 01:43:09 -0400
Subject: [Bioperl-guts-l] [15608] bioperl-live/trunk/t/Align/SimpleAlign.t:
Tests for bug#2793 patch from Jay Hannah/thanks
Message-ID: <200903230543.n2N5h9LX019275@dev.open-bio.org>
Revision: 15608
Author: maj
Date: 2009-03-23 01:43:09 -0400 (Mon, 23 Mar 2009)
Log Message:
-----------
Tests for bug#2793 patch from Jay Hannah/thanks
Modified Paths:
--------------
bioperl-live/trunk/t/Align/SimpleAlign.t
Modified: bioperl-live/trunk/t/Align/SimpleAlign.t
===================================================================
--- bioperl-live/trunk/t/Align/SimpleAlign.t 2009-03-23 05:40:13 UTC (rev 15607)
+++ bioperl-live/trunk/t/Align/SimpleAlign.t 2009-03-23 05:43:09 UTC (rev 15608)
@@ -7,7 +7,7 @@
use lib '.';
use Bio::Root::Test;
- test_begin(-tests => 152);
+ test_begin(-tests => 157);
use_ok('Bio::SimpleAlign');
use_ok('Bio::AlignIO');
@@ -304,6 +304,16 @@
my $seq_negative = $aln_negative->get_seq_by_pos(1);
is($seq_negative->start,2,"bug 2099");
is($seq_negative->end,5,"bug 2099");
+
+ # bug 2793
+ my $s11 = Bio::LocatableSeq->new(-id => 'testseq1', -seq => 'AAA');
+ my $s21 = Bio::LocatableSeq->new(-id => 'testseq2', -seq => 'CCC');
+ $a = Bio::SimpleAlign->new();
+ ok($a->add_seq($s11, 1), "bug 2793");
+ is($a->get_seq_by_pos(1)->seq, 'AAA', "bug 2793");
+ ok($a->add_seq($s21, 2), "bug 2793");
+ is($a->get_seq_by_pos(2)->seq, 'CCC', "bug 2793");
+ throws_ok {$a->add_seq($s21, 0)} qr/must be >= 1/;
}
# test for Bio::SimpleAlign annotation method and
From bugzilla-daemon at portal.open-bio.org Mon Mar 23 01:46:27 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 23 Mar 2009 01:46:27 -0400
Subject: [Bioperl-guts-l] [Bug 2793] Bio::SimpleAlign::add_seq() :
zero-origin sequence order
In-Reply-To:
Message-ID: <200903230546.n2N5kRAA013711@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2793
maj at fortinbras.us changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
------- Comment #5 from maj at fortinbras.us 2009-03-23 01:46 EST -------
Ok- I committed a patch based on Jay's fix, with a little range check on the
$order parameter. Also created named parms for $seq and $order to indicate that
these really do something useful now. Spiffed the pod. Added Jay's tests
verbatim to SimpleAlign.t.
Thanks muchly!!
--
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 Mon Mar 23 07:25:20 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 23 Mar 2009 07:25:20 -0400
Subject: [Bioperl-guts-l] [Bug 2793] Bio::SimpleAlign::add_seq() :
zero-origin sequence order
In-Reply-To:
Message-ID: <200903231125.n2NBPK85014766@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2793
------- Comment #6 from jay at jays.net 2009-03-23 07:25 EST -------
(In reply to comment #5)
> Ok- I committed a patch based on Jay's fix, with a little range check
woot! 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 cjfields at dev.open-bio.org Mon Mar 23 12:50:42 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Mon, 23 Mar 2009 12:50:42 -0400
Subject: [Bioperl-guts-l] [15609]
bioperl-live/trunk/Bio/AlignIO/stockholm.pm: [Bug 2796]
Message-ID: <200903231650.n2NGogNu024126@dev.open-bio.org>
Revision: 15609
Author: cjfields
Date: 2009-03-23 12:50:40 -0400 (Mon, 23 Mar 2009)
Log Message:
-----------
[Bug 2796]
* some fixes to output (more flexible)
Modified Paths:
--------------
bioperl-live/trunk/Bio/AlignIO/stockholm.pm
Modified: bioperl-live/trunk/Bio/AlignIO/stockholm.pm
===================================================================
--- bioperl-live/trunk/Bio/AlignIO/stockholm.pm 2009-03-23 05:43:09 UTC (rev 15608)
+++ bioperl-live/trunk/Bio/AlignIO/stockholm.pm 2009-03-23 16:50:40 UTC (rev 15609)
@@ -195,8 +195,6 @@
'SEQUENCE' => 'SEQUENCE'
);
-my %CONCATENATE = map {$_ => 1} qw(DE AU DC RC RT RA RL CC);
-
# this is the order that annotations are written
our @WRITEORDER = qw(accession
id
@@ -226,39 +224,40 @@
# Some data is stored using get/set methods ('Methods'), others
# are mapped b/c of more complex annotation types.
-my %WRITEMAP = (
- 'accession' => 'AC/Method',
- 'id' => 'ID/Method',
- 'description' => 'DE/Method',
- 'record_authors' => 'AU/SimpleValue',
- 'seed_source' => 'SE/SimpleValue',
- 'build_command' => 'BM/SimpleValue',
- 'gathering_threshold' => 'GA/SimpleValue',
- 'noise_cutoff' => 'NC/SimpleValue',
- 'trusted_cutoff' => 'TC/SimpleValue',
- 'entry_type' => 'TP/SimpleValue',
- 'num_sequences' => 'SQ/SimpleValue',
- 'previous_ids' => 'PI/SimpleValue',
- 'database_comment' => 'DC/SimpleValue',
- 'dblink' => 'DR/DBLink',
- 'reference' => 'RX/Reference',
- 'ref_number' => 'RN/number',
- 'ref_comment' => 'RC/comment',
- 'ref_pubmed' => 'RM/pubmed',
- 'ref_title' => 'RT/title',
- 'ref_authors' => 'RA/authors',
- 'ref_location' => 'RL/location',
- 'alignment_comment' => 'CC/Comment',
- 'seq_annotation' => 'DR/Collection',
- #Pfam-specific
- 'build_method' => 'AM/SimpleValue',
- 'pfam_family_accession' => 'NE/SimpleValue',
- 'seq_start_stop' => 'NL/SimpleValue',
- # Rfam-specific GF lines
- 'sec_structure_source' => 'SS/SimpleValue',
- # custom
- 'custom' => 'XX/SimpleValue'
- );
+our %WRITEMAP = (
+ 'accession' => 'AC/Method',
+ 'id' => 'ID/Method',
+ 'description' => 'DE/Method',
+ 'record_authors' => 'AU/SimpleValue',
+ 'seed_source' => 'SE/SimpleValue',
+ 'build_command' => 'BM/SimpleValue',
+ 'gathering_threshold' => 'GA/SimpleValue',
+ 'noise_cutoff' => 'NC/SimpleValue',
+ 'trusted_cutoff' => 'TC/SimpleValue',
+ 'entry_type' => 'TP/SimpleValue',
+ 'num_sequences' => 'SQ/SimpleValue',
+ 'previous_ids' => 'PI/SimpleValue',
+ 'database_comment' => 'DC/SimpleValue',
+ 'dblink' => 'DR/DBLink',
+ 'reference' => 'RX/Reference',
+ 'ref_number' => 'RN/number',
+ 'ref_comment' => 'RC/comment',
+ 'ref_pubmed' => 'RM/pubmed',
+ 'ref_title' => 'RT/title',
+ 'ref_authors' => 'RA/authors',
+ 'ref_location' => 'RL/location',
+ 'alignment_comment' => 'CC/Comment',
+ 'seq_annotation' => 'DR/Collection',
+ #Pfam-specific
+ 'build_method' => 'AM/SimpleValue',
+ 'pfam_family_accession' => 'NE/SimpleValue',
+ 'seq_start_stop' => 'NL/SimpleValue',
+ # Rfam-specific GF lines
+ 'sec_structure_source' => 'SS/SimpleValue',
+ # custom; this is used to carry over anything from the input alignment
+ # not mapped to LocatableSeqs or SimpleAlign in a meaningful way
+ 'custom' => 'XX/SimpleValue'
+);
# This maps the tagname back to a tagname-annotation value combination.
# Some data is stored using get/set methods ('Methods'), others
@@ -495,22 +494,26 @@
}
elsif ($tag eq 'XX') { # custom
my $newtag = $ann->tagname;
- $alntag = sprintf('%-10s',$aln_ann.$newtag);
+ my $tmp = $aln_ann.$newtag;
+ $alntag = sprintf('%-*s',length($tmp) + 1, $tmp);
$data = $ann->display_text;
}
elsif ($tag eq 'SQ') {
# use the actual number, not the stored Annotation data
- $alntag = sprintf('%-10s',$aln_ann.$tag);
+ my $tmp = $aln_ann.$tag;
+ $alntag = sprintf('%-*s',length($tmp) + 1, $tmp);
$data = $aln->no_sequences;
}
elsif ($tag eq 'DR') {
- $alntag = sprintf('%-10s',$aln_ann.$tag);
+ my $tmp = $aln_ann.$tag;
+ $alntag = sprintf('%-*s',length($tmp) + 1, $tmp);
my $db = uc $ann->database;
my $cb = exists $LINK_CB{$db} ? $LINK_CB{$db} : $LINK_CB{_DEFAULT_};
$data = $ann->display_text($cb);
}
else {
- $alntag = sprintf('%-10s',$aln_ann.$tag);
+ my $tmp = $aln_ann.$tag;
+ $alntag = sprintf('%-*s',length($tmp) + 1, $tmp);
$data = ref $ann ? $ann->display_text : $ann;
}
next unless $data;
From cjfields at dev.open-bio.org Mon Mar 23 13:06:49 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Mon, 23 Mar 2009 13:06:49 -0400
Subject: [Bioperl-guts-l] [15610]
bioperl-live/trunk/Bio/AlignIO/stockholm.pm: add some docs for how to add
custom annotation ( as well as warnings about possible future changes)
Message-ID: <200903231706.n2NH6nwi024220@dev.open-bio.org>
Revision: 15610
Author: cjfields
Date: 2009-03-23 13:06:48 -0400 (Mon, 23 Mar 2009)
Log Message:
-----------
add some docs for how to add custom annotation (as well as warnings about possible future changes)
Modified Paths:
--------------
bioperl-live/trunk/Bio/AlignIO/stockholm.pm
Modified: bioperl-live/trunk/Bio/AlignIO/stockholm.pm
===================================================================
--- bioperl-live/trunk/Bio/AlignIO/stockholm.pm 2009-03-23 16:50:40 UTC (rev 15609)
+++ bioperl-live/trunk/Bio/AlignIO/stockholm.pm 2009-03-23 17:06:48 UTC (rev 15610)
@@ -107,6 +107,79 @@
----------------------------------------------------------------------
* RN is generated based on the number of Bio::Annotation::Reference objects
+=head2 Custom annotation
+
+Some users may want to add custom annotation beyond those mapped above.
+Currently there are two methods to do so; however, the methods used for adding
+such annotation may change in the future, particularly if alignment Writer
+classes are introduced. In particular, do not rely on changing the global
+variables @WRITEORDER or %WRITEMAP as these may be made private at some point.
+
+1) Use (and abuse) the 'custom' tag. The tagname for the object can differ
+from the tagname used to store the object in the AnnotationCollection.
+
+ # AnnotationCollection from the SimpleAlign object
+ my $coll = $aln->annotation;
+ my $factory = Bio::Annotation::AnnotationFactory->new(-type =>
+ Bio::Annotation::SimpleValue');
+ my $rfann = $factory->create_object(-value => $str,
+ -tagname => 'mytag');
+ $coll->add_Annotation('custom', $rfann);
+ $rfann = $factory->create_object(-value => 'foo',
+ -tagname => 'bar');
+ $coll->add_Annotation('custom', $rfann);
+
+OUTPUT:
+
+# STOCKHOLM 1.0
+
+#=GF ID myID12345
+#=GF mytag katnayygqelggvnhdyddlakfyfgaglealdffnnkeaaakiinwvaEDTTRGKIQDLV??
+#=GF mytag TPtd~????LDPETQALLV???????????????????????NAIYFKGRWE?????????~??
+#=GF mytag ??HEF?A?EMDTKPY??DFQH?TNen?????GRI??????V???KVAM??MF?????????N??
+#=GF mytag ???DD?VFGYAEL????DE???????L??D??????A??TALELAY??????????????????
+#=GF mytag ?????????????KG??????Sa???TSMLILLP???????????????D??????????????
+#=GF mytag ???????????EGTr?????AGLGKLLQ??QL????????SREef??DLNK??L???AH????R
+#=GF mytag ????????????L????????????????????????????????????????R?????????R
+#=GF mytag ??QQ???????V???????AVRLPKFSFefefdlkeplknlgmhqafdpnsdvfklmdqavlvi
+#=GF mytag gdlqhayafkvd????????????????????????????????????????????????????
+#=GF mytag ????????????????????????????????????????????????????????????????
+#=GF mytag ????????????????????????????????????????????????????????????????
+#=GF mytag ????????????????????????????????????????????????????????????????
+#=GF mytag ?????????????INVDEAG?TEAAAATAAKFVPLSLppkt??????????????????PIEFV
+#=GF mytag ADRPFAFAIR??????E?PAT?G????SILFIGHVEDPTP?msv?
+#=GF bar foo
+...
+
+2) Modify the global @WRITEORDER and %WRITEMAP.
+
+ # AnnotationCollection from the SimpleAlign object
+ my $coll = $aln->annotation;
+
+ # add to WRITEORDER
+ my @order = @Bio::AlignIO::stockholm::WRITEORDER;
+ push @order, 'my_stuff';
+ @Bio::AlignIO::stockholm::WRITEORDER = @order;
+
+ # make sure new tag maps to something
+ $Bio::AlignIO::stockholm::WRITEMAP{my_stuff} = 'Hobbit/SimpleValue';
+
+ my $rfann = $factory->create_object(-value => 'Frodo',
+ -tagname => 'Hobbit');
+ $coll->add_Annotation('my_stuff', $rfann);
+ $rfann = $factory->create_object(-value => 'Bilbo',
+ -tagname => 'Hobbit');
+ $coll->add_Annotation('my_stuff', $rfann);
+
+OUTPUT:
+
+# STOCKHOLM 1.0
+
+#=GF ID myID12345
+#=GF Hobbit Frodo
+#=GF Hobbit Bilbo
+....
+
=head1 FEEDBACK
=head2 Support
From bugzilla-daemon at portal.open-bio.org Mon Mar 23 13:09:17 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 23 Mar 2009 13:09:17 -0400
Subject: [Bioperl-guts-l] [Bug 2796] AlignIO::stockholm sequence parsing
In-Reply-To:
Message-ID: <200903231709.n2NH9H7I013536@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2796
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Comment #5 from cjfields at bioperl.org 2009-03-23 13:09 EST -------
Actually I built this a bit more flexible than I first realized. Adding custom
annotation is possible, so I'll close this out. Some examples have been added
to the Bio::AlignIO::stockholm module but I'll outline them below.
There are two ways to do this, but I am reserving the right to change the
second method to something not involving globals (which are evil evil evil).
This is using the latest bioperl-live code and should show up in 1.6.1.
1) The tag name you assign the SimpleValue doesn't have to be the same as the
tag the value is stored as. So you can do this:
my $factory = Bio::Annotation::AnnotationFactory->new(-type =>
'Bio::Annotation::SimpleValue');
my $rfann = $factory->create_object(-value => $str, -tagname => 'mytag');
$coll->add_Annotation('custom', $rfann);
$rfann = $factory->create_object(-value => 'foo', -tagname => 'bar');
$coll->add_Annotation('custom', $rfann);
And get this:
# STOCKHOLM 1.0
#=GF ID 1imvA01
#=GF mytag katnayygqelggvnhdyddlakfyfgaglealdffnnkeaaakiinwvaEDTTRGKIQDLV??
#=GF mytag TPtd~????LDPETQALLV???????????????????????NAIYFKGRWE?????????~??
#=GF mytag ??HEF?A?EMDTKPY??DFQH?TNen?????GRI??????V???KVAM??MF?????????N??
#=GF mytag ???DD?VFGYAEL????DE???????L??D??????A??TALELAY??????????????????
#=GF mytag ?????????????KG??????Sa???TSMLILLP???????????????D??????????????
#=GF mytag ???????????EGTr?????AGLGKLLQ??QL????????SREef??DLNK??L???AH????R
#=GF mytag ????????????L????????????????????????????????????????R?????????R
#=GF mytag ??QQ???????V???????AVRLPKFSFefefdlkeplknlgmhqafdpnsdvfklmdqavlvi
#=GF mytag gdlqhayafkvd????????????????????????????????????????????????????
#=GF mytag ????????????????????????????????????????????????????????????????
#=GF mytag ????????????????????????????????????????????????????????????????
#=GF mytag ????????????????????????????????????????????????????????????????
#=GF mytag ?????????????INVDEAG?TEAAAATAAKFVPLSLppkt??????????????????PIEFV
#=GF mytag ADRPFAFAIR??????E?PAT?G????SILFIGHVEDPTP?msv?
#=GF bar foo
....
Note that the tag assigned to the SimpleValue object is used, not 'XX' or
'custom'. This should work for all AnnotationI (anything that has tagname()
and display_text() defined).
2) The second is a bit more cumbersome and will very likely change as it
involves modifying globals, something which I don't like. If you add a new tag
to the package globals @WRITEORDER and %WRITEMAP, you can add in your own data.
The writer will use the value of display_text()
# really custom stuff
# add to WRITEORDER
my @order = @Bio::AlignIO::stockholm::WRITEORDER;
push @order, 'my_stuff';
@Bio::AlignIO::stockholm::WRITEORDER = @order;
# make sure new tag maps to something (you'll get a warning here which is
harmless)
$Bio::AlignIO::stockholm::WRITEMAP{my_stuff} = 'Hobbit/SimpleValue';
my $rfann = $factory->create_object(-value => 'Frodo', -tagname =>
'Hobbit');
$coll->add_Annotation('my_stuff', $rfann);
$rfann = $factory->create_object(-value => 'Bilbo', -tagname => 'Hobbit');
$coll->add_Annotation('my_stuff', $rfann);
Gets:
# STOCKHOLM 1.0
#=GF ID 1imvA01
#=GF Hobbit Frodo
#=GF Hobbit Bilbo
...
--
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 Mar 23 13:14:31 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Mon, 23 Mar 2009 13:14:31 -0400
Subject: [Bioperl-guts-l] [15611]
bioperl-live/trunk/Bio/AlignIO/stockholm.pm: make prettier for perldoc
Message-ID: <200903231714.n2NHEVs0024298@dev.open-bio.org>
Revision: 15611
Author: cjfields
Date: 2009-03-23 13:14:31 -0400 (Mon, 23 Mar 2009)
Log Message:
-----------
make prettier for perldoc
Modified Paths:
--------------
bioperl-live/trunk/Bio/AlignIO/stockholm.pm
Modified: bioperl-live/trunk/Bio/AlignIO/stockholm.pm
===================================================================
--- bioperl-live/trunk/Bio/AlignIO/stockholm.pm 2009-03-23 17:06:48 UTC (rev 15610)
+++ bioperl-live/trunk/Bio/AlignIO/stockholm.pm 2009-03-23 17:14:31 UTC (rev 15611)
@@ -131,26 +131,26 @@
OUTPUT:
-# STOCKHOLM 1.0
+ # STOCKHOLM 1.0
+
+ #=GF ID myID12345
+ #=GF mytag katnayygqelggvnhdyddlakfyfgaglealdffnnkeaaakiinwvaEDTTRGKIQDLV??
+ #=GF mytag TPtd~????LDPETQALLV???????????????????????NAIYFKGRWE?????????~??
+ #=GF mytag ??HEF?A?EMDTKPY??DFQH?TNen?????GRI??????V???KVAM??MF?????????N??
+ #=GF mytag ???DD?VFGYAEL????DE???????L??D??????A??TALELAY??????????????????
+ #=GF mytag ?????????????KG??????Sa???TSMLILLP???????????????D??????????????
+ #=GF mytag ???????????EGTr?????AGLGKLLQ??QL????????SREef??DLNK??L???AH????R
+ #=GF mytag ????????????L????????????????????????????????????????R?????????R
+ #=GF mytag ??QQ???????V???????AVRLPKFSFefefdlkeplknlgmhqafdpnsdvfklmdqavlvi
+ #=GF mytag gdlqhayafkvd????????????????????????????????????????????????????
+ #=GF mytag ????????????????????????????????????????????????????????????????
+ #=GF mytag ????????????????????????????????????????????????????????????????
+ #=GF mytag ????????????????????????????????????????????????????????????????
+ #=GF mytag ?????????????INVDEAG?TEAAAATAAKFVPLSLppkt??????????????????PIEFV
+ #=GF mytag ADRPFAFAIR??????E?PAT?G????SILFIGHVEDPTP?msv?
+ #=GF bar foo
+ ...
-#=GF ID myID12345
-#=GF mytag katnayygqelggvnhdyddlakfyfgaglealdffnnkeaaakiinwvaEDTTRGKIQDLV??
-#=GF mytag TPtd~????LDPETQALLV???????????????????????NAIYFKGRWE?????????~??
-#=GF mytag ??HEF?A?EMDTKPY??DFQH?TNen?????GRI??????V???KVAM??MF?????????N??
-#=GF mytag ???DD?VFGYAEL????DE???????L??D??????A??TALELAY??????????????????
-#=GF mytag ?????????????KG??????Sa???TSMLILLP???????????????D??????????????
-#=GF mytag ???????????EGTr?????AGLGKLLQ??QL????????SREef??DLNK??L???AH????R
-#=GF mytag ????????????L????????????????????????????????????????R?????????R
-#=GF mytag ??QQ???????V???????AVRLPKFSFefefdlkeplknlgmhqafdpnsdvfklmdqavlvi
-#=GF mytag gdlqhayafkvd????????????????????????????????????????????????????
-#=GF mytag ????????????????????????????????????????????????????????????????
-#=GF mytag ????????????????????????????????????????????????????????????????
-#=GF mytag ????????????????????????????????????????????????????????????????
-#=GF mytag ?????????????INVDEAG?TEAAAATAAKFVPLSLppkt??????????????????PIEFV
-#=GF mytag ADRPFAFAIR??????E?PAT?G????SILFIGHVEDPTP?msv?
-#=GF bar foo
-...
-
2) Modify the global @WRITEORDER and %WRITEMAP.
# AnnotationCollection from the SimpleAlign object
@@ -173,13 +173,13 @@
OUTPUT:
-# STOCKHOLM 1.0
+ # STOCKHOLM 1.0
+
+ #=GF ID myID12345
+ #=GF Hobbit Frodo
+ #=GF Hobbit Bilbo
+ ....
-#=GF ID myID12345
-#=GF Hobbit Frodo
-#=GF Hobbit Bilbo
-....
-
=head1 FEEDBACK
=head2 Support
From bugzilla-daemon at portal.open-bio.org Mon Mar 23 13:17:59 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 23 Mar 2009 13:17:59 -0400
Subject: [Bioperl-guts-l] [Bug 2633] Incorrect identity calculation in
Bio::SearchIO::fasta
In-Reply-To:
Message-ID: <200903231717.n2NHHxC8014338@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2633
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
------- Comment #8 from cjfields at bioperl.org 2009-03-23 13:17 EST -------
Closing this out, the bug has been dealt with.
--
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 Mon Mar 23 13:24:22 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 23 Mar 2009 13:24:22 -0400
Subject: [Bioperl-guts-l] [Bug 2798] New:
Bio::Tools::Run::Alignment::Clustalw.pm can't open .dnd file
when calling the `run' method
Message-ID:
http://bugzilla.open-bio.org/show_bug.cgi?id=2798
Summary: Bio::Tools::Run::Alignment::Clustalw.pm can't open .dnd
file when calling the `run' method
Product: BioPerl
Version: main-trunk
Platform: PC
OS/Version: Linux
Status: NEW
Keywords: Bioperl
Severity: normal
Priority: P2
Component: bioperl-run
AssignedTo: bioperl-guts-l at bioperl.org
ReportedBy: CMB.zhouw at gmail.com
CC: CMB.zhouw at gmail.com
Hi there,
Recently I'm going to run clustalw in my Perl script. I checked out the
bioperl-run (revision 15608).
When I called the `run' method of the $factory, I passed the inputfilename
(here I use t/data/cysprot.fa for testing),then I got the following exception:
------------- EXCEPTION -------------
MSG: Could not open cysprot.fa.dnd: No such file or directory
STACK Bio::Root::IO::_initialize_io
/home/zhouw/jail/lib/perl5/Bio/Root/IO.pm:323
STACK Bio::TreeIO::_initialize /home/zhouw/jail/lib/perl5/Bio/TreeIO.pm:220
STACK Bio::TreeIO::newick::_initialize
/home/zhouw/jail/lib/perl5/Bio/TreeIO/newick.pm:102
STACK Bio::TreeIO::new /home/zhouw/jail/lib/perl5/Bio/TreeIO.pm:125
STACK Bio::TreeIO::new /home/zhouw/jail/lib/perl5/Bio/TreeIO.pm:138
STACK Bio::Tools::Run::Alignment::Clustalw::_get_tree
/home/zhouw/jail/lib/perl5/Bio/Tools/Run/Alignment/Clustalw.pm:813
STACK Bio::Tools::Run::Alignment::Clustalw::_run
/home/zhouw/jail/lib/perl5/Bio/Tools/Run/Alignment/Clustalw.pm:781
STACK Bio::Tools::Run::Alignment::Clustalw::run
/home/zhouw/jail/lib/perl5/Bio/Tools/Run/Alignment/Clustalw.pm:477
STACK toplevel clustalw.pl:12
-------------------------------------
It seems that the `_get_tree' method add a suffix (.dnd or .ph or .phb) to the
inputfilename to generate a treefilename, but actually, the tree file created
by clustalw is `cysprot.dnd', which leads to the exception above.
In addition, after I renamed `cysprot.fa' to `cysprot' (cut off the .fa suffix)
and called the `run' method with new filename, I got the correct result.
However, the inputfile `cysprot' has gone.
I check the `_get_tree' again, find out that it remove treefile's newly added
suffix ($f =~ s/\.[^\.]*$// ;), and then unlink it (which is actually the
original inputfile)
I'll attach a proposed patch and test case, hope they will be helpful
Best regards,
Wei Zhou
--
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 Mon Mar 23 13:26:07 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 23 Mar 2009 13:26:07 -0400
Subject: [Bioperl-guts-l] [Bug 2798] Bio::Tools::Run::Alignment::Clustalw.pm
can't open .dnd file when calling the `run' method
In-Reply-To:
Message-ID: <200903231726.n2NHQ7jO015276@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2798
------- Comment #1 from CMB.zhouw at gmail.com 2009-03-23 13:26 EST -------
Created an attachment (id=1267)
--> (http://bugzilla.open-bio.org/attachment.cgi?id=1267&action=view)
patch for Clustalw.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 Mon Mar 23 13:26:48 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 23 Mar 2009 13:26:48 -0400
Subject: [Bioperl-guts-l] [Bug 2798] Bio::Tools::Run::Alignment::Clustalw.pm
can't open .dnd file when calling the `run' method
In-Reply-To:
Message-ID: <200903231726.n2NHQmlL015341@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2798
------- Comment #2 from CMB.zhouw at gmail.com 2009-03-23 13:26 EST -------
Created an attachment (id=1268)
--> (http://bugzilla.open-bio.org/attachment.cgi?id=1268&action=view)
new test case for run method
--
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 Mon Mar 23 13:29:04 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 23 Mar 2009 13:29:04 -0400
Subject: [Bioperl-guts-l] [Bug 2798] Bio::Tools::Run::Alignment::Clustalw.pm
can't open .dnd file when calling the `run' method
In-Reply-To:
Message-ID: <200903231729.n2NHT4YC015583@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2798
CMB.zhouw at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #1268|application/octet-stream |text/plain
mime type| |
--
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 Mon Mar 23 13:29:20 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 23 Mar 2009 13:29:20 -0400
Subject: [Bioperl-guts-l] [Bug 2798] Bio::Tools::Run::Alignment::Clustalw.pm
can't open .dnd file when calling the `run' method
In-Reply-To:
Message-ID: <200903231729.n2NHTKva015610@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2798
CMB.zhouw at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #1268 is|0 |1
patch| |
--
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 Mar 23 14:34:40 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Mon, 23 Mar 2009 14:34:40 -0400
Subject: [Bioperl-guts-l] [15612] bioperl-run/trunk: [bug 2798]
Message-ID: <200903231834.n2NIYeo9024561@dev.open-bio.org>
Revision: 15612
Author: cjfields
Date: 2009-03-23 14:34:40 -0400 (Mon, 23 Mar 2009)
Log Message:
-----------
[bug 2798]
* patches courtesy Wei Zhou
Modified Paths:
--------------
bioperl-run/trunk/Bio/Tools/Run/Alignment/Clustalw.pm
bioperl-run/trunk/t/Clustalw.t
Modified: bioperl-run/trunk/Bio/Tools/Run/Alignment/Clustalw.pm
===================================================================
--- bioperl-run/trunk/Bio/Tools/Run/Alignment/Clustalw.pm 2009-03-23 17:14:31 UTC (rev 15611)
+++ bioperl-run/trunk/Bio/Tools/Run/Alignment/Clustalw.pm 2009-03-23 18:34:40 UTC (rev 15612)
@@ -800,6 +800,8 @@
sub _get_tree {
my ($self, $treefile, $param_string) = @_;
+ $treefile =~ s/\.[^\.]*$// ;
+
if ($param_string =~ /-bootstrap/) {
$treefile .= '.phb';
}
@@ -816,7 +818,6 @@
my $tree = $in->next_tree;
unless ( $self->save_tempfiles ) {
foreach my $f ( $treefile ) {
- $f =~ s/\.[^\.]*$// ;
unlink $f if( $f ne '' );
}
}
Modified: bioperl-run/trunk/t/Clustalw.t
===================================================================
--- bioperl-run/trunk/t/Clustalw.t 2009-03-23 17:14:31 UTC (rev 15611)
+++ bioperl-run/trunk/t/Clustalw.t 2009-03-23 18:34:40 UTC (rev 15612)
@@ -6,7 +6,7 @@
BEGIN {
use Bio::Root::Test;
- test_begin(-tests => 43);
+ test_begin(-tests => 45);
use_ok('Bio::Tools::Run::Alignment::Clustalw');
use_ok('Bio::SimpleAlign');
@@ -44,7 +44,7 @@
SKIP: {
test_skip(-requires_executable => $factory,
- -tests => 17);
+ -tests => 19);
# test all factory methods dependent on finding the executable
# TODO: isnt( $factory->program_dir, undef, 'Found program in an ENV variable' );
@@ -56,10 +56,11 @@
# clustalw2 isn't supported yet.
if ($ver < 1.8) {
diag("ClustalW version $ver not supported");
- skip("ClustalW version $ver not supported", 17);
- } if ($ver >= 2.0) {
+ skip("ClustalW version $ver not supported", 19);
+ }
+ if ($ver >= 2.0) {
diag("Warning: ClustalW version $ver not supported yet.");
- skip("ClustalW version $ver not supported yet", 17);
+ skip("ClustalW version $ver not supported yet", 19);
}
ok( $ver, "Supported program version $ver" );
@@ -111,6 +112,10 @@
isa_ok($aln, 'Bio::SimpleAlign');
isa_ok($tree, 'Bio::Tree::Tree');
+ ($aln, $tree) = $factory->run($inputfilename);
+ isa_ok($aln, 'Bio::SimpleAlign');
+ isa_ok($tree, 'Bio::Tree::Tree');
+
# test the footprint method
my @seqs = (Bio::Seq->new(-seq => 'AACCTGGCCAATTGGCCAATTGGGCGTACGTACGT', -id => 'rabbit'),
Bio::Seq->new(-seq => 'ACCCTGGCCAATTGGCCAATTGTAAGTACGTACGT', -id => 'marmot'),
From bugzilla-daemon at portal.open-bio.org Mon Mar 23 14:35:06 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 23 Mar 2009 14:35:06 -0400
Subject: [Bioperl-guts-l] [Bug 2798] Bio::Tools::Run::Alignment::Clustalw.pm
can't open .dnd file when calling the `run' method
In-Reply-To:
Message-ID: <200903231835.n2NIZ6TE021157@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2798
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Comment #3 from cjfields at bioperl.org 2009-03-23 14:35 EST -------
Committed to svn. Thanks for the patches!
--
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 Mon Mar 23 14:39:44 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 23 Mar 2009 14:39:44 -0400
Subject: [Bioperl-guts-l] [Bug 2691] Bio::Microarray::Tools::ReseqChip
depends on CPAN module Statistics::Frequency
In-Reply-To:
Message-ID: <200903231839.n2NIdiCY021542@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2691
------- Comment #7 from cjfields at bioperl.org 2009-03-23 14:39 EST -------
I haven't heard anything from miriam about status of this module (including bug
fixes and reduction of dependencies). If nothing pops up in the next month
I'll move the code out of bioperl-live into bioperl-dev.
--
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 Mon Mar 23 14:43:14 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 23 Mar 2009 14:43:14 -0400
Subject: [Bioperl-guts-l] [Bug 2702] [TODO] scripts recopied upon each call
to './Build test'
In-Reply-To:
Message-ID: <200903231843.n2NIhEAu021866@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2702
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|trivial |enhancement
------- Comment #1 from cjfields at bioperl.org 2009-03-23 14:43 EST -------
Not harmful, moving to enhancement request per moi
--
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 Mon Mar 23 19:00:17 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 23 Mar 2009 19:00:17 -0400
Subject: [Bioperl-guts-l] [Bug 2796] AlignIO::stockholm sequence parsing
In-Reply-To:
Message-ID: <200903232300.n2NN0H3C008323@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2796
------- Comment #6 from bernd at bio.vu.nl 2009-03-23 19:00 EST -------
Thanks for adding these examples to the doc.
I just checked the code via webCVS and noted as ' is missing in ex.1 on the pm:
my $factory = Bio::Annotation::AnnotationFactory->new(-type =>
Bio::Annotation::SimpleValue');
The WRITEORDER I changed as follows:
push(@Bio::AlignIO::stockholm_bernd::WRITEORDER, 'my_stuff');
--
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 Fri Mar 27 15:38:17 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Fri, 27 Mar 2009 15:38:17 -0400
Subject: [Bioperl-guts-l] [15613] bioperl-live/trunk/Bio/SeqFeatureI.pm:
remove comments ( left over from rollback, not pertinent anymore)
Message-ID: <200903271938.n2RJcHCX007090@dev.open-bio.org>
Revision: 15613
Author: cjfields
Date: 2009-03-27 15:38:16 -0400 (Fri, 27 Mar 2009)
Log Message:
-----------
remove comments (left over from rollback, not pertinent anymore)
Modified Paths:
--------------
bioperl-live/trunk/Bio/SeqFeatureI.pm
Modified: bioperl-live/trunk/Bio/SeqFeatureI.pm
===================================================================
--- bioperl-live/trunk/Bio/SeqFeatureI.pm 2009-03-23 18:34:40 UTC (rev 15612)
+++ bioperl-live/trunk/Bio/SeqFeatureI.pm 2009-03-27 19:38:16 UTC (rev 15613)
@@ -189,7 +189,6 @@
Returns : TRUE if the specified tag exists, and FALSE otherwise
Args :
-
=cut
sub has_tag{
@@ -725,34 +724,6 @@
See L
-=head1 Bio::AnnotatableI methods
-
=cut
-=head2 has_tag()
-
- B. See L
-
-=head2 remove_tag()
-
- B. See L
-
-=head2 add_tag_value()
-
- B. See L
-
-=head2 get_tag_values()
-
- B. See L
-
-=head2 get_tagset_values()
-
- B. See L
-
-=head2 get_all_tags()
-
- B. See L
-
-=cut
-
1;
From cjfields at dev.open-bio.org Fri Mar 27 16:30:07 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Fri, 27 Mar 2009 16:30:07 -0400
Subject: [Bioperl-guts-l] [15614]
bioperl-live/trunk/Bio/AlignIO/stockholm.pm: remove debugging line
Message-ID: <200903272030.n2RKU79O007244@dev.open-bio.org>
Revision: 15614
Author: cjfields
Date: 2009-03-27 16:30:06 -0400 (Fri, 27 Mar 2009)
Log Message:
-----------
remove debugging line
Modified Paths:
--------------
bioperl-live/trunk/Bio/AlignIO/stockholm.pm
Modified: bioperl-live/trunk/Bio/AlignIO/stockholm.pm
===================================================================
--- bioperl-live/trunk/Bio/AlignIO/stockholm.pm 2009-03-27 19:38:16 UTC (rev 15613)
+++ bioperl-live/trunk/Bio/AlignIO/stockholm.pm 2009-03-27 20:30:06 UTC (rev 15614)
@@ -224,7 +224,6 @@
use Bio::Seq::Meta;
use Bio::AlignIO::Handler::GenericAlignHandler;
-use Data::Dumper;
use Text::Wrap qw(wrap);
use base qw(Bio::AlignIO);
From bugzilla-daemon at portal.open-bio.org Fri Mar 27 16:39:51 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Fri, 27 Mar 2009 16:39:51 -0400
Subject: [Bioperl-guts-l] [Bug 2775] is_circular not maintained through
->revcom
In-Reply-To:
Message-ID: <200903272039.n2RKdppO007735@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2775
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn| |2673
--
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 Mar 27 16:39:52 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Fri, 27 Mar 2009 16:39:52 -0400
Subject: [Bioperl-guts-l] [Bug 2673] original fields not inherited by seq
objects in alignment slices
In-Reply-To:
Message-ID: <200903272039.n2RKdqKS007754@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2673
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
OtherBugsDependingO| |2775
nThis| |
--
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 Fri Mar 27 17:08:59 2009
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Fri, 27 Mar 2009 17:08:59 -0400
Subject: [Bioperl-guts-l] [15615] bioperl-live/trunk: [bug 2456]
Message-ID: <200903272108.n2RL8xQx007486@dev.open-bio.org>
Revision: 15615
Author: cjfields
Date: 2009-03-27 17:08:59 -0400 (Fri, 27 Mar 2009)
Log Message:
-----------
[bug 2456]
* Mark's patches
* See archived examples of trees with the bug report for confirmation of test data changes
Modified Paths:
--------------
bioperl-live/trunk/Bio/Tree/Node.pm
bioperl-live/trunk/Bio/Tree/TreeFunctionsI.pm
bioperl-live/trunk/t/Tree/Tree.t
bioperl-live/trunk/t/Tree/TreeIO/lintree.t
bioperl-live/trunk/t/Tree/TreeIO/tabtree.t
bioperl-live/trunk/t/Tree/TreeIO.t
Modified: bioperl-live/trunk/Bio/Tree/Node.pm
===================================================================
--- bioperl-live/trunk/Bio/Tree/Node.pm 2009-03-27 20:30:06 UTC (rev 15614)
+++ bioperl-live/trunk/Bio/Tree/Node.pm 2009-03-27 21:08:59 UTC (rev 15615)
@@ -148,6 +148,65 @@
return $self;
}
+=head2 create_node_on_branch
+
+ Title : create_node_on_branch
+ Usage : $node->create_node_on_branch($at_length)
+ Function: Create a node on the ancestral branch of the calling
+ object.
+ Example :
+ Returns : the created node
+ Args : -POSITION=>$absolute_branch_length_from_caller (default)
+ -FRACTION=>$fraction_of_branch_length_from_caller
+ -ANNOT=>{ -id => "the id", -desc => "the description" }
+ -FORCE, set to allow nodes with zero branch lengths
+
+=cut
+
+sub create_node_on_branch{
+ my ($self, at args) = @_;
+ my ($pos, $frac, $annot, $force) = $self->_rearrange([qw(POSITION FRACTION ANNOT FORCE)], @args);
+ my ($newpos);
+ my $blen = $self->branch_length;
+ # arg checks
+ $force||=0;
+ $annot||={};
+
+ unless ($self->ancestor) {
+ $self->throw("Refusing to create nodes above the root--exiting");
+ }
+ unless ($blen) {
+ $self->throw("Calling node's branch length is zero") unless $force;
+ }
+ unless ((defined $pos && !defined $frac)||(defined $frac && !defined $pos)) {
+ $self->throw("Either position or fraction must be specified, but not both");
+ }
+ if (defined $frac) {
+ $self->throw("FRACTION arg must be in the range [0,1]") unless ( (0 <= $frac) && ($frac <= 1) );
+ $newpos = $frac*$blen;
+ }
+ elsif (defined $pos) {
+ $self->throw("POSITION arg must be in the range [0,$blen]") unless ( (0 <= $pos) && ($pos <= $blen) );
+ $newpos = $pos;
+ }
+ else {
+ $self->throw("How did I get here?");
+ }
+ $self->throw("Calling node's branch length will be zero (set -FORCE to force)--exiting") unless ($newpos > 0) || $force;
+ $self->throw("Created nodes branch length would be zero (set -FORCE to force)--exiting") unless ($newpos < $blen) || $force;
+
+ #guts
+ $annot->{'-branch_length'} = $blen-$newpos;
+ my $node = Bio::Tree::Node->new(%$annot);
+ my $anc = $self->ancestor;
+ # null anc check is above
+ $node->add_Descendent($self);
+ $anc->add_Descendent($node);
+ $anc->remove_Descendent($self);
+ $self->branch_length($newpos);
+ return $node;
+}
+
=head2 add_Descendent
Title : add_Descendent
@@ -281,7 +340,6 @@
}
}
}
-
$c;
}
Modified: bioperl-live/trunk/Bio/Tree/TreeFunctionsI.pm
===================================================================
--- bioperl-live/trunk/Bio/Tree/TreeFunctionsI.pm 2009-03-27 20:30:06 UTC (rev 15614)
+++ bioperl-live/trunk/Bio/Tree/TreeFunctionsI.pm 2009-03-27 21:08:59 UTC (rev 15615)
@@ -939,33 +939,21 @@
return 0;
}
- {
+ my $old_root = $self->get_root_node;
+ if( $new_root == $old_root ) {
+ $self->warn("Node requested for reroot is already the root node!");
+ return 0;
+ }
my $anc = $new_root->ancestor;
unless( $anc ) {
- return 0;
+ # this is already the root
+ $self->warn("Node requested for reroot is already the root node!"); return 0;
}
- my $blen;
- if( $new_root->is_Leaf() ) {
- $blen = $new_root->branch_length;
- } else {
- $blen = ($new_root->branch_length() || 0) / 2;
- }
- my $node = $anc->new(-branch_length => $blen);
- $new_root->branch_length($blen);
- $anc->add_Descendent($node);
- $anc->remove_Descendent($new_root);
- $node->add_Descendent($new_root);
- $new_root = $node;
- }
+ my $tmp_node = $new_root->create_node_on_branch(-position=>0,-force=>1);
- my $old_root = $self->get_root_node;
- if( $new_root == $old_root ) {
- $self->warn("Node requested for reroot is already the root node!");
- return 0;
- }
-
# reverse the ancestor & children pointers
- my @path_from_oldroot = ($self->get_lineage_nodes($new_root), $new_root);
+ my $former_anc = $tmp_node->ancestor;
+ my @path_from_oldroot = ($self->get_lineage_nodes($tmp_node), $tmp_node);
for (my $i = 0; $i < @path_from_oldroot - 1; $i++) {
my $current = $path_from_oldroot[$i];
my $next = $path_from_oldroot[$i + 1];
@@ -973,16 +961,12 @@
$current->branch_length($next->branch_length);
$next->add_Descendent($current);
}
- # root node can be an artifical node which needs to be removed here
- # when we are re-rooting. We can only get its ancestor
- # after we've reversed the path
- my $anc = $old_root->ancestor;
- my @d = $old_root->each_Descendent;
- if( @d == 1 ) {
- $anc->add_Descendent(shift @d);
- $anc->remove_Descendent($old_root);
- }
+
+ $new_root->add_Descendent($former_anc);
+ $tmp_node->remove_Descendent($former_anc);
+ $tmp_node = undef;
$new_root->branch_length(undef);
+
$old_root = undef;
$self->set_root_node($new_root);
@@ -1082,7 +1066,6 @@
return $traits;
}
-
sub add_trait {
my $self = shift;
my $file = shift;
Modified: bioperl-live/trunk/t/Tree/Tree.t
===================================================================
--- bioperl-live/trunk/t/Tree/Tree.t 2009-03-27 20:30:06 UTC (rev 15614)
+++ bioperl-live/trunk/t/Tree/Tree.t 2009-03-27 21:08:59 UTC (rev 15615)
@@ -7,8 +7,8 @@
use lib '.';
use Bio::Root::Test;
- test_begin(-tests => 60);
-
+#/maj test_begin(-tests => 60);
+ test_begin(-tests => 62);
use_ok('Bio::TreeIO');
}
@@ -152,26 +152,45 @@
warn("new total len ", $tree->total_branch_length,"\n") if $verbose;
# according to retree in phylip these branch lengths actually get larger
# go figure...
-#ok(($total_length_orig >= $tree->total_branch_length - $eps)
-# and ($total_length_orig <= $tree->total_branch_length + $eps));
+# this should be fixed now/maj
+ok(($total_length_orig >= $tree->total_branch_length - $eps) &&
+ ($total_length_orig <= $tree->total_branch_length + $eps),'same length');
+
+# prob with below: rerooted tree on node A at line 146; so $a IS root
+#/maj is($tree->get_root_node, $a->ancestor, "Root node is A's ancestor");
+is($tree->get_root_node, $a, "Root node is A");
+
+# former test expected the old behavior of reroot; here is the new
+# test/maj
+my $desc = ($a->each_Descendent)[0];
+my $newroot = $desc->create_node_on_branch(-FRACTION=>0.5, -ANNOT=>{id=>'newroot'});
+$tree->reroot($newroot);
is($tree->get_root_node, $a->ancestor, "Root node is A's ancestor");
# try to reroot on an internal, will result in there being 1 less node
+# Rerooting should be an invariant operation with respect to node number!/maj
+# the test show that it now is, because the secret removal of nodes
+# no longer occurs
+
$a = $tree->find_node('C')->ancestor;
$out->write_tree($tree) if $verbose;
is($tree->reroot($a),1, "Can reroot with C's ancsestor");
$out->write_tree($tree) if $verbose;
-is($node_cnt_orig, scalar($tree->get_nodes), 'Check to see that node count is correct after an internal node was removed after this re-rooting');
+#/maj is($node_cnt_orig, scalar($tree->get_nodes), 'Check to see that node count is correct after an internal node was removed after this re-rooting');
+# but we did add a new node at line 166, so
+is($node_cnt_orig+1, scalar($tree->get_nodes), 'Node count correct');
warn("orig total len ", $total_length_orig, "\n") if $verbose;
warn("new total len ", $tree->total_branch_length,"\n") if $verbose;
cmp_ok($total_length_orig, '>=', $tree->total_branch_length - $eps,
'Total original branch length is what it is supposed to be');
+# branch length should also be invariant w/r to rerooting...
cmp_ok($total_length_orig, '<=',$tree->total_branch_length + $eps,
'Updated total branch length after the reroot');
-is($tree->get_root_node, $a->ancestor, 'Make sure root is really what we asked for');
+# again, we rerooted ON THE NODE, so $a IS the root./maj
+is($tree->get_root_node, $a, 'Make sure root is really what we asked for');
-# try to reroot on existing root: should fail
-$a = $tree->get_root_node;
+# try to reroot on new root: should fail
+#/maj $a = $tree->get_root_node;
isnt( $tree->reroot($a),1, 'Testing for failed re-rerooting');
# try a more realistic tree
@@ -180,15 +199,16 @@
$node_cnt_orig = scalar($tree->get_nodes);
$total_length_orig = $tree->total_branch_length;
$out->write_tree($tree) if $verbose;
-is($tree->reroot($a->ancestor),1, 'Test that rooting succeeded');
+is($tree->reroot($a),1, 'Test that rooting succeeded'); #mod /maj
$out->write_tree($tree) if $verbose;
-is($node_cnt_orig+1, scalar($tree->get_nodes), 'Test that re-rooted tree has proper number of nodes after re-rooting');
+# node number should be invariant after reroot/maj
+is($node_cnt_orig, scalar($tree->get_nodes), 'Test that re-rooted tree has proper number of nodes after re-rooting'); #mod /maj
$total_length_new = $tree->total_branch_length;
$eps = 0.001 * $total_length_new; # tolerance for checking length
cmp_ok($total_length_orig, '>=', $tree->total_branch_length - $eps, 'Branch length before rerooting');
cmp_ok($total_length_orig, '<=', $tree->total_branch_length + $eps,
'Branch length after rerooting');
-is($tree->get_root_node, $a->ancestor->ancestor,'Root is really the ancestor we asked for');
+is($tree->get_root_node, $a,'Root is really the ancestor we asked for'); #mod /maj
# BFS and DFS search testing
$treeio = Bio::TreeIO->new(-verbose => $verbose,
@@ -224,7 +244,10 @@
is($DFSorder, '0,1,2,A,B,C,D,3,E,F', 'DFS traversal after removing G');
$tree->splice(-remove_id => [('E', 'F')], -keep_id => 'F');
$DFSorder = join(",", map { $_->id } ( $tree->get_nodes(-order => 'd')));
-is($DFSorder, '0,1,2,A,B,C,D,F', 'DFS traversal after removing F');
+# the node '3' is not explicitly removed, so it should still be there
+# I suspect that it disappeared before was due to the previously
+# automatic removal of internal degree 2 nodes../maj
@@ Diff output truncated at 10000 characters. @@
From bugzilla-daemon at portal.open-bio.org Fri Mar 27 17:10:24 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Fri, 27 Mar 2009 17:10:24 -0400
Subject: [Bioperl-guts-l] [Bug 2456] reroot function
(Bio::Tree::TreeFunctionsI) shifts bootstrap values
In-Reply-To:
Message-ID: <200903272110.n2RLAOAg010651@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2456
cjfields at bioperl.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
------- Comment #18 from cjfields at bioperl.org 2009-03-27 17:10 EST -------
Mark, committed these to svn. I have pointed (on the commit message) to check
out the attached tree figs here in case there are complaints.
closing out.
--
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 maj at dev.open-bio.org Sat Mar 28 00:49:44 2009
From: maj at dev.open-bio.org (Mark Allen Jensen)
Date: Sat, 28 Mar 2009 00:49:44 -0400
Subject: [Bioperl-guts-l] [15616] bioperl-dev/trunk: I christen thee
"bioperl-dev".
Message-ID: <200903280449.n2S4niJi008454@dev.open-bio.org>
Revision: 15616
Author: maj
Date: 2009-03-28 00:49:43 -0400 (Sat, 28 Mar 2009)
Log Message:
-----------
I christen thee "bioperl-dev". Bless her and all who sail in her.
Added Paths:
-----------
bioperl-dev/trunk/AUTHORS
bioperl-dev/trunk/Bio/
bioperl-dev/trunk/Bio/Root/
bioperl-dev/trunk/Bio/Root/Build.pm
bioperl-dev/trunk/Bio/Root/Exception.pm
bioperl-dev/trunk/Bio/Root/HTTPget.pm
bioperl-dev/trunk/Bio/Root/IO.pm
bioperl-dev/trunk/Bio/Root/Root.pm
bioperl-dev/trunk/Bio/Root/RootI.pm
bioperl-dev/trunk/Bio/Root/Storable.pm
bioperl-dev/trunk/Bio/Root/Test/
bioperl-dev/trunk/Bio/Root/Test/Warn.pm
bioperl-dev/trunk/Bio/Root/Test.pm
bioperl-dev/trunk/Bio/Root/Utilities.pm
bioperl-dev/trunk/Bio/Root/Version.pm
bioperl-dev/trunk/Build.PL
bioperl-dev/trunk/Changes
bioperl-dev/trunk/INSTALL
bioperl-dev/trunk/INSTALL.SKIP
bioperl-dev/trunk/LICENSE
bioperl-dev/trunk/README
bioperl-dev/trunk/doc/
bioperl-dev/trunk/examples/
bioperl-dev/trunk/scripts/
bioperl-dev/trunk/t/
bioperl-dev/trunk/t/data/
bioperl-dev/trunk/t/lib/
bioperl-dev/trunk/t/lib/Array/
bioperl-dev/trunk/t/lib/Array/Compare.pm
bioperl-dev/trunk/t/lib/Error.pm
bioperl-dev/trunk/t/lib/Sub/
bioperl-dev/trunk/t/lib/Sub/Uplevel.pm
bioperl-dev/trunk/t/lib/Test/
bioperl-dev/trunk/t/lib/Test/Builder/
bioperl-dev/trunk/t/lib/Test/Builder/Module.pm
bioperl-dev/trunk/t/lib/Test/Builder/Tester/
bioperl-dev/trunk/t/lib/Test/Builder/Tester/Color.pm
bioperl-dev/trunk/t/lib/Test/Builder/Tester.pm
bioperl-dev/trunk/t/lib/Test/Builder.pm
bioperl-dev/trunk/t/lib/Test/Exception.pm
bioperl-dev/trunk/t/lib/Test/Harness/
bioperl-dev/trunk/t/lib/Test/Harness/Assert.pm
bioperl-dev/trunk/t/lib/Test/Harness/Iterator.pm
bioperl-dev/trunk/t/lib/Test/Harness/Point.pm
bioperl-dev/trunk/t/lib/Test/Harness/Results.pm
bioperl-dev/trunk/t/lib/Test/Harness/Straps.pm
bioperl-dev/trunk/t/lib/Test/Harness/TAP.pod
bioperl-dev/trunk/t/lib/Test/Harness/Util.pm
bioperl-dev/trunk/t/lib/Test/Harness.pm
bioperl-dev/trunk/t/lib/Test/More.pm
bioperl-dev/trunk/t/lib/Test/Simple.pm
bioperl-dev/trunk/t/lib/Test/Tutorial.pod
bioperl-dev/trunk/t/lib/Test/Warn/
bioperl-dev/trunk/t/lib/Test/Warn.pm
Added: bioperl-dev/trunk/AUTHORS
===================================================================
--- bioperl-dev/trunk/AUTHORS (rev 0)
+++ bioperl-dev/trunk/AUTHORS 2009-03-28 04:49:43 UTC (rev 15616)
@@ -0,0 +1,7 @@
+=head1 CONTRIBUTORS TO BIOPERL-DEV
+
+=over
+
+=item * Mark A. Jensen
+
+=back
Property changes on: bioperl-dev/trunk/AUTHORS
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Author Date Rev
Added: bioperl-dev/trunk/Bio/Root/Build.pm
===================================================================
--- bioperl-dev/trunk/Bio/Root/Build.pm (rev 0)
+++ bioperl-dev/trunk/Bio/Root/Build.pm 2009-03-28 04:49:43 UTC (rev 15616)
@@ -0,0 +1,1205 @@
+#!/usr/bin/perl -w
+
+# $Id: Build.pm 15549 2009-02-21 00:48:48Z maj $
+#
+# BioPerl module for Bio::Root::Build
+#
+# Please direct questions and support issues to
+#
+# 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::Root::Build - A common Module::Build subclass base for BioPerl distributions
+
+=head1 SYNOPSIS
+
+ ...TO BE ADDED
+
+=head1 DESCRIPTION
+
+This is a subclass of Module::Build so we can override certain methods and do
+fancy stuff
+
+It was first written against Module::Build::Base v0.2805. Many of the methods
+here are copy/pasted from there in their entirety just to change one or two
+minor things, since for the most part Module::Build::Base code is hard to
+cleanly override.
+
+=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 Support
+
+Please direct usage questions or support issues to the mailing list:
+
+L
+
+rather than to the module maintainer directly. Many experienced and
+reponsive experts will be able look at the problem and quickly
+address it. Please include a thorough description of the problem
+with code and data examples if at all possible.
+
+=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::Root::Build;
+
+BEGIN {
+ # we really need Module::Build to be installed
+ unless (eval "use Module::Build 0.2805; 1") {
+ print "This package requires Module::Build v0.2805 or greater to install itself.\n";
+
+ require ExtUtils::MakeMaker;
+ my $yn = ExtUtils::MakeMaker::prompt(' Install Module::Build now from CPAN?', 'y');
+
+ unless ($yn =~ /^y/i) {
+ die " *** Cannot install without Module::Build. Exiting ...\n";
+ }
+
+ require Cwd;
+ require File::Spec;
+ require File::Copy;
+ require CPAN;
+
+ # Save this because CPAN will chdir all over the place.
+ my $cwd = Cwd::cwd();
+
+ my $build_pl = File::Spec->catfile($cwd, "Build.PL");
+
+ File::Copy::move($build_pl, $build_pl."hidden"); # avoid bizarre bug with Module::Build tests using the wrong Build.PL if it happens to be in PERL5LIB
+ CPAN::Shell->install('Module::Build');
+ File::Copy::move($build_pl."hidden", $build_pl);
+ CPAN::Shell->expand("Module", "Module::Build")->uptodate or die "Couldn't install Module::Build, giving up.\n";
+
+ chdir $cwd or die "Cannot chdir() back to $cwd: $!\n\n***\nInstallation will probably work fine if you now quit CPAN and try again.\n***\n\n";
+ }
+
+ eval "use base Module::Build; 1" or die $@;
+
+ # ensure we'll be able to reload this module later by adding its path to inc
+ use Cwd;
+ use lib Cwd::cwd();
+}
+
+use strict;
+use warnings;
+
+our $VERSION = '1.006900'; # pre-1.7
+our @extra_types = qw(options excludes_os feature_requires test); # test must always be last in the list!
+our $checking_types = "requires|conflicts|".join("|", @extra_types);
+
+
+# our modules are in Bio, not lib
+sub find_pm_files {
+ my $self = shift;
+ foreach my $pm (@{$self->rscan_dir('Bio', qr/\.pm$/)}) {
+ $self->{properties}{pm_files}->{$pm} = File::Spec->catfile('lib', $pm);
+ }
+
+ $self->_find_file_by_type('pm', 'lib');
+}
+
+# ask what scripts to install (this method is unique to bioperl)
+sub choose_scripts {
+ my $self = shift;
+ my $accept = shift;
+
+ # we can offer interactive installation by groups only if we have subdirs
+ # in scripts and no .PLS files there
+ opendir(my $scripts_dir, 'scripts') or die "Can't open directory 'scripts': $!\n";
+ my $int_ok = 0;
+ my @group_dirs;
+ while (my $thing = readdir($scripts_dir)) {
+ next if $thing =~ /^\./;
+ next if $thing eq 'CVS';
+ if ($thing =~ /PLS$|pl$/) {
+ $int_ok = 0;
+ last;
+ }
+ $thing = File::Spec->catfile('scripts', $thing);
+ if (-d $thing) {
+ $int_ok = 1;
+ push(@group_dirs, $thing);
+ }
+ }
+ closedir($scripts_dir);
+ my $question = $int_ok ? "Install [a]ll BioPerl scripts, [n]one, or choose groups [i]nteractively?" : "Install [a]ll BioPerl scripts or [n]one?";
+
+ my $prompt = $accept ? 'a' : $self->prompt($question, 'a');
+
+ if ($prompt =~ /^[aA]/) {
+ $self->log_info(" - will install all scripts\n");
+ $self->notes(chosen_scripts => 'all');
+ }
+ elsif ($prompt =~ /^[iI]/) {
+ $self->log_info(" - will install interactively:\n");
+
+ my @chosen_scripts;
+ foreach my $group_dir (@group_dirs) {
+ my $group = File::Basename::basename($group_dir);
+ print " * group '$group' has:\n";
+
+ my @script_files = @{$self->rscan_dir($group_dir, qr/\.PLS$|\.pl$/)};
+ foreach my $script_file (@script_files) {
+ my $script = File::Basename::basename($script_file);
+ print " $script\n";
+ }
+
+ my $result = $self->prompt(" Install scripts for group '$group'? [y]es [n]o [q]uit", 'n');
+ die if $result =~ /^[qQ]/;
+ if ($result =~ /^[yY]/) {
+ $self->log_info(" + will install group '$group'\n");
+ push(@chosen_scripts, @script_files);
+ }
+ else {
+ $self->log_info(" - will not install group '$group'\n");
+ }
+ }
+
+ my $chosen_scripts = @chosen_scripts ? join("|", @chosen_scripts) : 'none';
+
+ $self->notes(chosen_scripts => $chosen_scripts);
+ }
+ else {
+ $self->log_info(" - won't install any scripts\n");
+ $self->notes(chosen_scripts => 'none');
+ }
+
+ print "\n";
+}
+
+# our version of script_files doesn't take args but just installs those scripts
+# requested by the user after choose_scripts() is called. If it wasn't called,
+# installs all scripts in scripts directory
+sub script_files {
+ my $self = shift;
+
+ unless (-d 'scripts') {
+ return {};
+ }
+
+ my $chosen_scripts = $self->notes('chosen_scripts');
+ if ($chosen_scripts) {
+ return if $chosen_scripts eq 'none';
+ return { map {$_, 1} split(/\|/, $chosen_scripts) } unless $chosen_scripts eq 'all';
+ }
+
+ return $_ = { map {$_,1} @{$self->rscan_dir('scripts', qr/\.PLS$|\.pl$/)} };
+}
+
+# process scripts normally, except that we change name from *.PLS to bp_*.pl
+sub process_script_files {
+ my $self = shift;
+ my $files = $self->find_script_files;
+ return unless keys %$files;
+
+ my $script_dir = File::Spec->catdir($self->blib, 'script');
+ File::Path::mkpath( $script_dir );
+
+ foreach my $file (keys %$files) {
+ my $result = $self->copy_if_modified($file, $script_dir, 'flatten') or next;
+ $self->fix_shebang_line($result) unless $self->os_type eq 'VMS';
+ $self->make_executable($result);
+
+ my $final = File::Basename::basename($result);
+ $final =~ s/\.PLS$/\.pl/; # change from .PLS to .pl
+ $final =~ s/^/bp_/ unless $final =~ /^bp/; # add the "bp" prefix
+ $final = File::Spec->catfile($script_dir, $final);
+ $self->log_info("$result -> $final\n");
+ File::Copy::move($result, $final) or die "Can't rename '$result' to '$final': $!";
+ }
+}
+
+# extended to handle extra checking types
+sub features {
+ my $self = shift;
+ my $ph = $self->{phash};
+
+ if (@_) {
+ my $key = shift;
+ if ($ph->{features}->exists($key)) {
+ return $ph->{features}->access($key, @_);
+ }
+
+ if (my $info = $ph->{auto_features}->access($key)) {
+ my $failures = $self->prereq_failures($info);
+ my $disabled = grep( /^(?:\w+_)?(?:$checking_types)$/, keys %$failures ) ? 1 : 0;
+ return !$disabled;
+ }
+
+ return $ph->{features}->access($key, @_);
+ }
+
+ # No args - get the auto_features & overlay the regular features
+ my %features;
+ my %auto_features = $ph->{auto_features}->access();
+ while (my ($name, $info) = each %auto_features) {
+ my $failures = $self->prereq_failures($info);
+ my $disabled = grep( /^(?:\w+_)?(?:$checking_types)$/, keys %$failures ) ? 1 : 0;
+ $features{$name} = $disabled ? 0 : 1;
+ }
+ %features = (%features, $ph->{features}->access());
+
+ return wantarray ? %features : \%features;
+}
+*feature = \&features;
@@ Diff output truncated at 10000 characters. @@
From maj at dev.open-bio.org Sat Mar 28 01:14:23 2009
From: maj at dev.open-bio.org (Mark Allen Jensen)
Date: Sat, 28 Mar 2009 01:14:23 -0400
Subject: [Bioperl-guts-l] [15617] bioperl-dev/trunk/README: dagnab it--
Message-ID: <200903280514.n2S5ENbk008668@dev.open-bio.org>
Revision: 15617
Author: maj
Date: 2009-03-28 01:14:23 -0400 (Sat, 28 Mar 2009)
Log Message:
-----------
dagnab it--
Modified Paths:
--------------
bioperl-dev/trunk/README
Modified: bioperl-dev/trunk/README
===================================================================
--- bioperl-dev/trunk/README 2009-03-28 04:49:43 UTC (rev 15616)
+++ bioperl-dev/trunk/README 2009-03-28 05:14:23 UTC (rev 15617)
@@ -18,7 +18,7 @@
o documentation is likely to be spotty at best;
o the code should be considered unsupported, though a polite email
- to the dev it likely to elicit a positive response;
+ to the dev is likely to elicit a positive response;
o the code should not be considered "production quality"; when this
level is reached, bioperl-dev modules will graduate to the
From maj at dev.open-bio.org Sat Mar 28 11:33:41 2009
From: maj at dev.open-bio.org (Mark Allen Jensen)
Date: Sat, 28 Mar 2009 11:33:41 -0400
Subject: [Bioperl-guts-l] [15618] bioperl-dev/trunk/Bio: exptl routines for
Bio::DB::HIV, supporting schema-valid
Message-ID: <200903281533.n2SFXf2M010092@dev.open-bio.org>
Revision: 15618
Author: maj
Date: 2009-03-28 11:33:40 -0400 (Sat, 28 Mar 2009)
Log Message:
-----------
exptl routines for Bio::DB::HIV, supporting schema-valid
XML output for annotations and sequence data
Added Paths:
-----------
bioperl-dev/trunk/Bio/DB/
bioperl-dev/trunk/Bio/DB/HIV/
bioperl-dev/trunk/Bio/DB/HIV/HIVXmlSchema.pm
bioperl-dev/trunk/Bio/DB/HIV/HIVXmlSchemaHelper.pm
bioperl-dev/trunk/Bio/DB/HIV/hivqAnnotSeqType.xsd
bioperl-dev/trunk/Bio/DB/HIV/hivqComplexTypes.xsd
bioperl-dev/trunk/Bio/DB/HIV/hivqSchema.xsd
bioperl-dev/trunk/Bio/DB/HIV/hivqSimpleTypes.xsd
Added: bioperl-dev/trunk/Bio/DB/HIV/HIVXmlSchema.pm
===================================================================
--- bioperl-dev/trunk/Bio/DB/HIV/HIVXmlSchema.pm (rev 0)
+++ bioperl-dev/trunk/Bio/DB/HIV/HIVXmlSchema.pm 2009-03-28 15:33:40 UTC (rev 15618)
@@ -0,0 +1,426 @@
+#$Id$#
+
+=head1 NAME
+
+Bio::DB::HIV::HIVXmlSchema - routines to convert LANL HIV sequence DB data into XML
+(This package eventually bound for bioperl-dev)
+
+=head1 SYNOPSIS
+
+ use HIVXmlSchema qw(HIVNS);
+ print HIVNS; # returns "http://fortinbras.us/HIVDBSchema/1.0"
+
+ my $q = Bio::DB::Query::HIVQuery->new(
+ -query => "(F)[subtype] (Env)[gene] (BR ZA)[country]"
+ ."{ pat_id risk_factor project }"
+ );
+ my $xml_seq_doc = $db->make_nexml_from_query( $q );
+ my $xml_annot_doc = $q->make_xml_from_query( $q->ids );
+
+=head1 DESCRIPTION
+
+This package contains the definition of the
+C class, and also internal methods
+assigned to existing module namespaces in BioPerl modules
+C and C. They are used to help create
+schema-valid XML messages from sequences and their metadata as
+returned by the Los Alamos National Laboratories' CGI interface to
+their HIV Sequence Database. Annotations can be returned as an XML
+document in the custom namespace
+L. The schema definition files
+can be obtained at that URL. Sequences can be returned as an XML
+document in the NeXML format (namespace L).
+Voluminous details on the NeXML standard can be obtained at
+L.
+
+The namespace constants C and C are exportable from
+C.
+
+=head1 IMPORTANT CAVEAT
+
+These routines are dependent upon revision 15594 of
+C and revision 15593 of
+C. The most recent versions of these
+modules are available by SVN checkout from the trunk at
+L
+
+=head1 IMPLEMENTATION NOTES
+
+These routines depend on the NeXML parser/writers in the C package
+by Rutger Vos. It can be obtained at L.
+
+XML manipulations here currently employ the C package of Petr Pajas and C and C of Mark Overbeek. These require the presence of C libraries, which can be obtained for many platforms
+at L
+
+=head1 AUTHOR - Mark A. Jensen
+
+Email maj at fortinbras.us
+
+=head1 ACKNOWLEDGEMENTS
+
+Many thanks to the knowledgeable and patient participants of the
+National Center for Evolutionary Synthesis' Database Interoperability
+Hackthon, Durham, NC, USA, March 2009. See their work at
+L.
+
+=head1 APPENDIX
+
+The rest of the documentation details each of the contained packages.
+Internal methods are usually preceded with a _
+
+=cut
+
+package Bio::DB::Query::HIVQuery;
+use strict;
+use HIVXmlSchemaHelper; # fully qualify the ns when necessary
+use XML::LibXML;
+use Log::Report;
+
+=head2 Bio::DB::HIV::HIVQuery::make_xml_from_query
+
+ Title : make_XML_from_query
+ Usage : $q->make_XML_from_query()
+ Function: Create an XML document of sequence annotations, according to
+ the XML Schema namespace http://fortinbras.us/HIVDBSchema/1.0
+ Example :
+ Returns : HIVDBSchema-compliant XML document as string
+ Args : none
+
+=cut
+
+sub make_xml_from_query {
+ my $self = shift;
+ return $self->make_xml_with_ids( $self->ids );
+}
+
+=head2 Bio::DB::HIV::HIVQuery::make_XML_with_ids
+
+ Title : make_xml_with_ids
+ Usage : $q->make_xml_with_ids( @ids )
+ Function: Create an XML document of sequence annotations, according to
+ the XML Schema namespace http://fortinbras.us/HIVDBSchema/1.0
+ Example :
+ Returns : HIVDBSchema-compliant XML document as string
+ Args : a[n array of] LANL id[s] (scalar[s])
+
+=cut
+
+sub make_xml_with_ids {
+ my $self = shift;
+ my @ids = @_;
+ my @hashes;
+ unless ($self->_run_option == 2) {
+ $self->warn("Method requires that query be run at level 2");
+ return undef;
+ }
+ foreach (@ids) {
+ my $h = $self->_xml_hashref_from_id($_);
+ next unless $h; # skip on dne
+ push @hashes, $h;
+ }
+ if (@hashes) {
+ my $sch = Bio::DB::HIV::HIVXmlSchema->new();
+ my $doc = XML::LibXML::Document->new();
+ my ($wri, $guts);
+
+ # use the Log::Report try block around $wri->() and check
+ # $@; throw BP error if set.
+ try {
+ $wri = $sch->make_writer;
+ $guts = $wri->($doc, { 'annotHivqSeq' => [@hashes] })
+ };
+ if ($@) {
+ $@->reportAll;
+ exit(0);
+ # handle XML::Compile::Schema error
+ }
+ else {
+ $doc->addChild($guts);
+ return $doc->toString(1);
+ }
+ }
+ else {
+ # dude, no data!
+ $self->warn("No XML was generated for this query");
+ }
+}
+
+1;
+
+package Bio::DB::HIV;
+use strict;
+use HIVXmlSchemaHelper; # fully qualify the ns when necessary
+use XML::LibXML::Reader;
+use XML::LibXML;
+use Bio::Phylo::Factory;
+use constant NEXML => 'http://www.nexml.org/1.0';
+
+=head2 make_nexml_from_query
+
+ Title : make_nexml_from_query
+ Usage : $db->make_nexml_from_query( $hiv_query_object )
+ Function: Create a NeXML-compliant XML document containing
+ sequences (not annotations; see
+ Bio::DB::Query::HIV::make_XML_with_ids()
+ for that) associated with a Bio::DB::Query::HIVQuery
+ object
+ Example :
+ Returns : NeXML-compliant XML document as string
+ Args : Bio::DB::Query::HIVQuery object; [optional] array of
+ LANL sequence ids.
+ Note : Requires Rutger Vos' external package Bio::Phylo
+
+=cut
+
+sub make_nexml_from_query{
+ my ($self, at args) = @_;
+ my ($q) = @args;
+
+ my $bpf = Bio::Phylo::Factory->new;
+ my $seqio = $self->get_Stream_by_query( $q );
+ my $dat_obj = $bpf->create_datum();
+ my $taxon_obj = $bpf->create_taxon();
+ my $taxa = $bpf->create_taxa();
+ my ($xrdr, $dom);
+
+ my $doc = XML::LibXML::Document->new();
+ my ($mx, $alphabet);
+
+ while ( my $seq = $seqio->next_seq ) {
+
+ # check first seq and make matrix (note this won't
+ # work if we have mixed data)
+ if ($mx) {
+ $self->throw( "Mixed data NeXML not currently implemented" ) if
+ $seq->alphabet ne $alphabet;
+ }
+ else {
+ $alphabet = $seq->alphabet;
+ }
+
+ $mx ||= $bpf->create_matrix( -type=>$seq->alphabet );
+
+ my ($taxon, $datum);
+ #create elements...
+ $taxon = $taxon_obj->new( -name => $seq->id,
+ -desc => $seq->annotation->get_value('Special','accession'));
+
+ $datum = $dat_obj->new_from_bioperl($seq);
+ $taxon->set_data($datum);
+ #organize into containers...
+ $taxa->insert( $taxon );
+ $mx->insert( $datum);
+ 1;
+ }
+
+ # so if @dna != 0 and @aa != 0, we require a mixed matrix.
+ # link the matrix to the taxa 'block'
+ $mx->set_taxa( $taxa);
+ $xrdr = XML::LibXML::Reader->new( string => join('', '',
+ $taxa->to_xml,
+ $mx->to_xml(-compact => 1),
+ ''));
+ $xrdr->read;
+ my ( $otus_node, $characters_node ) = $xrdr->copyCurrentNode(1)->childNodes;
+
+ # build the DOM
+ foreach my $otu_node ( $otus_node->childNodes ) {
+ next unless $otu_node->nodeName eq 'otu';
+ my ($lanlid, $tmp, $lanlid_node, $gbaccn_node);
+
+ $lanlid_node = XML::LibXML::Element->new('dict');
+ $lanlid_node->setAttribute('id', "dict$$lanlid_node"); # uniquify
+
+ $lanlid = $otu_node->getAttribute('label');
+ $tmp = XML::LibXML::Element->new('string');
+ $tmp->setAttribute('id', "LANLSeqId_$$lanlid_node");
+ $tmp->addChild( XML::LibXML::Text->new($lanlid ) );
+ $lanlid_node->addChild($tmp);
+
+ $gbaccn_node = XML::LibXML::Element->new('dict');
+ $gbaccn_node->setAttribute('id', "dict$$gbaccn_node");
+
+ $tmp = XML::LibXML::Element->new('string');
+ $tmp->setAttribute('id', "GenBankAccn_$$gbaccn_node");
+ $tmp->addChild( XML::LibXML::Text->new($q->get_accessions_by_id($lanlid)));
+ $gbaccn_node->addChild($tmp);
+
+ $otu_node->addChild($lanlid_node);
+ $otu_node->addChild($gbaccn_node);
+
+ }
+
+ # create the NexML doc
+ $dom = XML::LibXML::Element->new('nexml');
+ $dom->setNamespace(NEXML, 'nex');
+ $dom->setAttribute('version', '0.8');
+ $dom->setAttribute('generator', 'Bio::DB::HIVXmlSchema');
+ $dom->setAttribute('xmlns', NEXML);
+ $dom->addChild($otus_node);
+ $dom->addChild($characters_node);
+
+ $doc->setDocumentElement($dom);
+
+ return $doc->toString(1);
+
+}
+
+1;
+
+package Bio::DB::HIV::HIVXmlSchema;
+use strict;
+use constant HIVNS => 'http://fortinbras.us/HIVDBSchema/1.0';
+use constant NEXML => 'http://www.nexml.org/1.0';
+
+use XML::LibXML;
+use XML::Compile;
+use XML::Compile::Util qw( SCHEMA2001 SCHEMA2001i pack_type );
+use Exporter;
+use base qw(XML::Compile::Schema Bio::Root::Root);
+
+BEGIN {
+ our (@ISA, @EXPORT_OK);
+ push @ISA, qw( Exporter );
+ @EXPORT_OK = qw( HIVNS NEXML );
+}
+
+our @schemata = qw(
+ hivqSchema.xsd
+ hivqAnnotSeqType.xsd
+ hivqComplexTypes.xsd
+ hivqSimpleTypes.xsd
+ );
+
+=head2 Constructor
+
+ Title : new
+ Usage : $sch = HIVXmlSchema->new();
+ Function: create a new HIVXmlSchema object
+ Example :
+ Returns : a new HIVXmlSchema object (is-a XML::Compile::Schema, and
+ is-a Bio::Root::Root)
+ Args : -SCHEMADIR => $dir_containing_xsd_files or [@dirs]
+ -XSCARGS => \@array_of_XML_Compile_Schema_constructor_args
+
+=cut
+
+# binding prefixes needs:
+# compile(..., prefixes => { SCHEMA2001 => 'xs', SCHEMA2001i => 'xsi', HIVNS => 'hivq' }
+
+sub new{
+ my ($class, at args) = @_;
+ my ($schema_dir,$XSC_args) = $class->SUPER::_rearrange([qw(SCHEMADIR,XSCARGS)], @args);
+ my @XSDDIRs = ($schema_dir and ref($schema_dir) eq 'ARRAY') ? @$schema_dir : ($schema_dir);
+ my @XSDDIRS = (@INC, $schema_dir);
@@ Diff output truncated at 10000 characters. @@
From jason at dev.open-bio.org Sat Mar 28 12:51:21 2009
From: jason at dev.open-bio.org (Jason Stajich)
Date: Sat, 28 Mar 2009 12:51:21 -0400
Subject: [Bioperl-guts-l] [15619] bioperl-dev/trunk: added slim seqfeatures
array-based instead of hash-based,
get about 30-40% speedup if I remember correctly
Message-ID: <200903281651.n2SGpLcj010728@dev.open-bio.org>
Revision: 15619
Author: jason
Date: 2009-03-28 12:51:20 -0400 (Sat, 28 Mar 2009)
Log Message:
-----------
added slim seqfeatures array-based instead of hash-based, get about 30-40% speedup if I remember correctly
Added Paths:
-----------
bioperl-dev/trunk/Bio/SeqFeature/
bioperl-dev/trunk/Bio/SeqFeature/Slim.pm
bioperl-dev/trunk/t/SeqFeature_Slim.t
Added: bioperl-dev/trunk/Bio/SeqFeature/Slim.pm
===================================================================
--- bioperl-dev/trunk/Bio/SeqFeature/Slim.pm (rev 0)
+++ bioperl-dev/trunk/Bio/SeqFeature/Slim.pm 2009-03-28 16:51:20 UTC (rev 15619)
@@ -0,0 +1,912 @@
+# $Id: Slim.pm 11754 2007-11-07 19:44:54Z jason $
+#
+# BioPerl module for Bio::SeqFeature::Slim
+#
+# Cared for by Jason Stajich
+#
+# Copyright Jason Stajich
+#
+# You may distribute this module under the same terms as perl itself
+
+# POD documentation - main docs before the code
+
+=head1 NAME
+
+Bio::SeqFeature::Slim - A very lightweight Bio::SeqFeatureI implementation
+
+=head1 SYNOPSIS
+
+use Bio::SeqFeature::Slim;
+
+=head1 DESCRIPTION
+
+Lightweight Bio::SeqFeatureI implemention.
+
+=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/MailList.shtml - 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.bioperl.org/
+
+=head1 AUTHOR - Jason Stajich
+
+Email jason_AT_bioperl.org
+
+Describe contact details here
+
+=head1 CONTRIBUTORS
+
+Additional contributors names and emails here
+
+=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::SeqFeature::Slim;
+use strict;
+use base 'Bio::SeqFeatureI';
+
+use constant {
+ SEQ_ID => 0,
+ SOURCE => 1,
+ PRIMARY => 2,
+ START => 3,
+ STOP => 4,
+ SCORE => 5,
+ STRAND => 6,
+ FRAME => 7,
+ TAGS => 8,
+ NAME => 9,
+ PARENT => 10,
+ GFF_TYPE => 11,
+ SUBFEATURES => 12,
+ SEQ_OBJ => 13,
+ VERBOSE => 14,
+};
+
+
+=head2 new
+
+ Title : new
+ Usage : my $obj = new Bio::SeqFeature::Slim();
+ Function: Builds a new Bio::SeqFeature::Slim object
+ Returns : an instance of Bio::SeqFeature::Slim
+ Args :
+
+
+=cut
+
+sub new {
+ my($class) = shift;
+ my ($start, $end, $strand, $primary_tag, $source_tag, $primary,
+ $source, $frame,$phase, $score, $tag, $gff_string, $gff1_string,
+ $seqname, $seqid, $annot, $location,$display_name,$pid,$id,
+ $parent_id,$parent) =
+ Bio::Root::RootI->_rearrange([qw
+ (START
+ END
+ STRAND
+ PRIMARY_TAG
+ SOURCE_TAG
+ PRIMARY
+ SOURCE
+ FRAME
+ PHASE
+ SCORE
+ TAG
+ GFF_STRING
+ GFF1_STRING
+ SEQNAME
+ SEQ_ID
+ ANNOTATION
+ LOCATION
+ DISPLAY_NAME
+ PRIMARY_ID
+ ID
+ PARENT_ID
+ PARENT
+ )], @_);
+ if( defined $primary_tag && defined $primary ) {
+ Bio::Root::RootI->warn("Both primary and primary_tag are defined, only use one");
+ }
+ if( defined $source_tag && defined $source ) {
+ Bio::Root::RootI->warn("Both source and source_tag are defined, only use one");
+ }
+
+ $primary_tag = $primary if defined $primary && ! defined $primary_tag;
+ $source_tag = $source if defined $source && ! defined $source_tag;
+ $frame = $phase if ! defined $frame && defined $phase;
+ my $self = bless [$seqid, #0
+ $source_tag, #1
+ $primary_tag, #2
+ $start, #3
+ $end, #4
+ $score, #5
+ $strand, #6
+ $frame, #7
+ {}, #8 tags
+ $display_name, #9 display name
+ undef, #10 parent
+ undef, #11 gff_type
+ [], #12 seqfeatures
+ undef, #13 seqobj
+ ], $class;
+
+ $tag && do {
+ foreach my $t ( keys %$tag ) {
+ $self->add_tag_value($t, UNIVERSAL::isa($tag->{$t}, "ARRAY") ?
+ @{$tag->{$t}} : $tag->{$t});
+ }
+ };
+ if( defined $pid && defined $id ) {
+ Bio::Root::RootI->warn("Both primary_id and id are defined, only use one");
+ }
+ # save primary ID if it exists
+ $pid = $id if ! defined $pid;
+ defined $pid && $self->primary_id($pid);
+
+ if( defined $parent && defined $parent_id ) {
+ Bio::Root::RootI->warn("Both parent_id and parent are defined, only use one");
+ }
+
+ # save parent ID if it exists
+ $parent_id = $parent if ! defined $parent_id;
+ $parent_id && $self->parent_id($parent_id);
+
+ return $self;
+}
+
+sub verbose {
+ my ($self,$value) = @_;
+
+ if (defined $value || ! defined $self->[VERBOSE]) {
+ $self->[VERBOSE] = $value || 0;
+ }
+ return $self->[VERBOSE];
+}
+
+=head1 Bio::SeqFeatureI specific methods
+
+New method interfaces.
+
+=cut
+
+=head2 display_name
+
+ Title : display_name
+ Usage : $name = $feat->display_name()
+ Function: Returns the human-readable name of the feature for displays.
+ Returns : a string
+ Args : none
+
+=cut
+
+sub display_name {
+ my ($self) = shift;
+ if( @_) {
+ ($self->[NAME]) = shift @_;
+ }
+ return $self->[NAME];
+}
+
+=head2 primary_tag
+
+ Title : primary_tag
+ Usage : $tag = $feat->primary_tag()
+ Function: Returns the primary tag for a feature,
+ eg 'exon'
+ Returns : a string
+ Args : none
+
+
+=cut
+
+sub primary_tag{
+ my ($self) = shift;
+ if( @_) {
+ ($self->[PRIMARY]) = shift @_;
+ }
+ return $self->[PRIMARY];
+}
+
+=head2 source_tag
+
+ Title : source_tag
+ Usage : $tag = $feat->source_tag()
+ Function: Returns the source tag for a feature,
+ eg, 'genscan'
+ Returns : a string
+ Args : none
+
+
+=cut
+
+sub source_tag{
+ my ($self) = shift;
+ if( @_) {
+ ($self->[SOURCE]) = shift @_;
+ }
+ return $self->[SOURCE];
+}
+
+
+=head2 frame
+
+ Title : frame
+ Usage : $frame = $feat->frame()
+ Function: Returns the frame for a feature,
+ eg, '1'
+ Returns : '.', 0,1,2
+ Args : none
+
+
+=cut
+
+sub frame {
+ my ($self) = shift;
+ if( @_) {
+ ($self->[FRAME]) = shift @_;
+ }
+ return $self->[FRAME];
+}
+
+*phase = \&frame;
+
+=head2 has_tag
+
+ Title : has_tag
+ Usage : $tag_exists = $self->has_tag('some_tag')
+ Function:
+ Returns : TRUE if the specified tag exists, and FALSE otherwise
+ Args :
+
+
+=cut
+
+sub has_tag{
+ my ($self,$tag) = @_;
+ return unless defined $tag;
+ return exists($self->[TAGS]->{$tag});
+}
+
+=head2 score
+
+ Title : score
+ Usage : $score = $feat->score()
+ Function: Returns the score
+ Returns : a string/number
+ Args : none
+
+=cut
+
+sub score {
+ my ($self) = shift;
+ if( @_) {
+ ($self->[SCORE]) = shift @_;
+ }
+ return $self->[SCORE];
+}
+
+=head2 get_tag_values
+
+ Title : get_tag_values
+ Usage : @values = $self->get_tag_values('some_tag')
+ Function:
+ Returns : An array comprising the values of the specified tag.
+ Args : a string
+
+throws an exception if there is no such tag
+
+=cut
+
+sub get_tag_values {
+ my ($self,$tag) = @_;
+ return() unless defined $tag;
+ return @{$self->[TAGS]->{$tag} || []};
+}
+
+=head2 get_tagset_values
+
+ Title : get_tagset_values
+ Usage : @values = $self->get_tagset_values(qw(label transcript_id product))
+ Function:
+ Returns : An array comprising the values of the specified tags, in order of tags
+ Args : An array of strings
+
+does NOT throw an exception if none of the tags are not present
+
+this method is useful for getting a human-readable label for a
+SeqFeatureI; not all tags can be assumed to be present, so a list of
+possible tags in preferential order is provided
+
+=cut
+
+# interface + abstract method
+sub get_tagset_values {
+ my ($self, @args) = @_;
+ my @vals = ();
+ foreach my $arg (@args) {
+ if ($self->has_tag($arg)) {
+ push(@vals, $self->get_tag_values($arg));
+ }
+ }
+ return @vals;
+}
+
+=head2 get_all_tags
+
+ Title : get_all_tags
+ Usage : @tags = $feat->get_all_tags()
+ Function: gives all tags for this feature
+ Returns : an array of strings
+ Args : none
+
+
+=cut
+
+sub get_all_tags{
+ my ($self) = shift;
+ return keys %{$self->[TAGS] || {}};
+}
+
+=head2 attach_seq
+
+ Title : attach_seq
+ Usage : $sf->attach_seq($seq)
+ Function: Attaches a Bio::Seq object to this feature. This
+ Bio::Seq object is for the *entire* sequence: ie
+ from 1 to 10000
+
+ Note that it is not guaranteed that if you obtain a feature from
+ an object in bioperl, it will have a sequence attached. Also,
+ implementors of this interface can choose to provide an empty
+ implementation of this method. I.e., there is also no guarantee
+ that if you do attach a sequence, seq() or entire_seq() will not
+ return undef.
+
+ The reason that this method is here on the interface is to enable
+ you to call it on every SeqFeatureI compliant object, and
+ that it will be implemented in a useful way and set to a useful
+ value for the great majority of use cases. Implementors who choose
+ to ignore the call are encouraged to specifically state this in
+ their documentation.
+
+ Example :
+ Returns : TRUE on success
+ Args : a Bio::PrimarySeqI compliant object
+
+
+=cut
+
+sub attach_seq {
+ my ($self) = shift;
+ if(@_) {
+ $self->[SEQ_OBJ] = shift @_;
+ return 1 if defined $self->[SEQ_OBJ];
+ }
+ return 0;
+}
+
+=head2 seq
+
+ Title : seq
+ Usage : $tseq = $sf->seq()
+ Function: returns the truncated sequence (if there is a sequence attached)
+ for this feature
+ Example :
+ Returns : sub seq (a Bio::PrimarySeqI compliant object) on attached sequence
+ bounded by start & end, or undef if there is no sequence attached
+ Args : none
+
+
+=cut
+
+sub seq {
+ my ($self) = shift;
+ if(defined $self->[SEQ_OBJ] ) {
+ if( ! ref($self->[SEQ_OBJ]) ||
+ ! $self->[SEQ_OBJ]->isa('Bio::PrimarySeqI') ) {
+ $self->throw("Have a seq_obj which is not Bio::PrimarySeqI compliant");
+ } else {
+ return $self->[SEQ_OBJ]->trunc($self->start, $self->end);
+ }
+ }
+ return undef;
+}
+
@@ Diff output truncated at 10000 characters. @@
From bugzilla-daemon at portal.open-bio.org Mon Mar 30 02:54:06 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 30 Mar 2009 02:54:06 -0400
Subject: [Bioperl-guts-l] [Bug 2800] New: Bio::Matrix::IO::phylip warn "The
number of entries N is not the same 0" when parsing multiple
data sets
Message-ID:
http://bugzilla.open-bio.org/show_bug.cgi?id=2800
Summary: Bio::Matrix::IO::phylip warn "The number of entries N is
not the same 0" when parsing multiple data sets
Product: BioPerl
Version: main-trunk
Platform: All
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Core Components
AssignedTo: bioperl-guts-l at bioperl.org
ReportedBy: CMB.zhouw at gmail.com
Hi folks,
When I used Bio::Matrix::IO to parse output from PHYLIP's dnadist, I found a
lot of warnings like this,
--------------------- WARNING ---------------------
MSG: The number of entries 10 is not the same 0
---------------------------------------------------
My 'infile' of dnadist is generated by clustalw(num_sequences = 10) and
seqboot(replicates = 100).
However, when I skipped the step of 'seqboot', i.e. there was only one matrix
in dnadist's outfile, everything's ok.
I have looked at the source code of Bio::Matrix::IO::phylip, and I think there
is a typo in 'sub next_matrix', in line 125:
$self->_pushback($_);
here, '$_' should be '$entry',
because the code of line 123 is:
while ($entry=$self->_readline) {
Therefore, the 'size' line is not pushed back to buffer, and the value of
'$size'
will always be 0, except the first matrix.
I hope you'll find this helpful to fix it.
Thanks!
Wei Zhou
--
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 Mon Mar 30 03:03:14 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 30 Mar 2009 03:03:14 -0400
Subject: [Bioperl-guts-l] [Bug 2800] Bio::Matrix::IO::phylip warn "The
number of entries N is not the same 0" when parsing multiple
data sets
In-Reply-To:
Message-ID: <200903300703.n2U73EC4004653@portal.open-bio.org>
http://bugzilla.open-bio.org/show_bug.cgi?id=2800
------- Comment #1 from CMB.zhouw at gmail.com 2009-03-30 03:03 EST -------
Created an attachment (id=1269)
--> (http://bugzilla.open-bio.org/attachment.cgi?id=1269&action=view)
the corresponding patch.
--
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 Mon Mar 30 13:11:00 2009
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 30 Mar 2009 13:11:00 -0400
Subject: [Bioperl-guts-l] [Bug 2801] New: SimpleAlig remove_columns
Message-ID:
http://bugzilla.open-bio.org/show_bug.cgi?id=2801
Summary: SimpleAlig remove_columns
Product: BioPerl
Version: 1.6 branch
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Core Components
AssignedTo: bioperl-guts-l at bioperl.org
ReportedBy: bernd at bio.vu.nl
Hi,
$aln->remove_columns() does not always return a new alignment object.
my @ar;
$aln_new = $aln->remove_columns(@ar);
returns the self object. However in case something is removed it returns a new
alignment object. Not sure if this should be regarded a bug, but it might
result in different behaviour (e.g. if one fills @ar in the script and does not
check if @ar is actually not empty before calling remove_columns.
Now $aln_new will be the same object as $aln. This might affect calls
downstream (e.g. after a $aln->purge() on $aln could results in errors on
$aln->remove_seq($seq) as $seq might have been removed by purge)
Regards,
Bernd
--
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 lstein at dev.open-bio.org Mon Mar 30 13:49:51 2009
From: lstein at dev.open-bio.org (Lincoln Stein)
Date: Mon, 30 Mar 2009 13:49:51 -0400
Subject: [Bioperl-guts-l] [15620] bioperl-live/trunk/Bio: relaxed constraint
on gff3 start/ end coordinates
Message-ID: <200903301749.n2UHnpiM025981@dev.open-bio.org>
Revision: 15620
Author: lstein
Date: 2009-03-30 13:49:50 -0400 (Mon, 30 Mar 2009)
Log Message:
-----------
relaxed constraint on gff3 start/end coordinates
Modified Paths:
--------------
bioperl-live/trunk/Bio/DB/SeqFeature/Store/GFF3Loader.pm
bioperl-live/trunk/Bio/DB/SeqFeature/Store/berkeleydb.pm
bioperl-live/trunk/Bio/SeqFeature/Lite.pm
Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store/GFF3Loader.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store/GFF3Loader.pm 2009-03-28 16:51:20 UTC (rev 15619)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store/GFF3Loader.pm 2009-03-30 17:49:50 UTC (rev 15620)
@@ -482,8 +482,8 @@
my ($refname,$source,$method,$start,$end,$score,$strand,$phase,$attributes) = @columns;
$self->invalid_gff($gff_line) unless defined $refname;
- $self->invalid_gff($gff_line) unless $start =~ /^[\d.-]+$/;
- $self->invalid_gff($gff_line) unless $end =~ /^[\d.-]+$/;
+ $self->invalid_gff($gff_line) unless $start eq '.' || $start =~ /^[\d.-]+$/;
+ $self->invalid_gff($gff_line) unless $end eq '.' || $end =~ /^[\d.-]+$/;
$self->invalid_gff($gff_line) unless defined $method;
$strand = $Strandedness{$strand||0};
@@ -837,6 +837,13 @@
sub parse_attributes {
my $self = shift;
my $att = shift;
+
+ unless ($att =~ /=/) { # ouch! must be a GFF line
+ require Bio::DB::SeqFeature::Store::GFF2Loader
+ unless Bio::DB::SeqFeature::Store::GFF2Loader->can('parse_attributes');
+ return $self->Bio::DB::SeqFeature::Store::GFF2Loader::parse_attributes($att);
+ }
+
my @pairs = map { my ($name,$value) = split '=';
[$self->unescape($name) => $value];
} split ';',$att;
@@ -849,7 +856,7 @@
next;
}
- my @values = split /,/,$_->[1];
+ my @values = split ',',$_->[1];
map {$_ = $self->unescape($_);} @values;
if ($Special_attributes{$tag}) { # reserved attribute
push @{$reserved{$tag}}, at values;
Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store/berkeleydb.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store/berkeleydb.pm 2009-03-28 16:51:20 UTC (rev 15619)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store/berkeleydb.pm 2009-03-30 17:49:50 UTC (rev 15620)
@@ -248,11 +248,13 @@
$is_temporary,
$write,
$create,
+ $verbose,
) = rearrange([['DSN','DB'],
[qw(DIR AUTOINDEX)],
['TMP','TEMP','TEMPORARY'],
[qw(WRITE WRITABLE)],
'CREATE',
+ 'VERBOSE'
], at _);
if ($autoindex) {
@@ -281,9 +283,10 @@
$self->default_settings;
$self->directory($directory);
$self->temporary($is_temporary);
+ $self->verbose($verbose);
$self->_delete_databases() if $create;
if ($autoindex && -d $autoindex) {
- $self->reindex($autoindex);
+ $self->auto_reindex($autoindex);
}
$self->lock('shared');
$self->_open_databases($write,$create,$autoindex);
@@ -293,7 +296,7 @@
sub can_store_parentage { 1 }
-sub reindex {
+sub auto_reindex {
my $self = shift;
my $autodir = shift;
my $result = $self->needs_auto_reindexing($autodir);
@@ -301,7 +304,8 @@
if (%$result) {
$self->lock('exclusive');
$self->reindex_wigfiles($result->{wig},$autodir) if $result->{wig};
- $self->reindex_gff3files($result->{gff},$autodir) if $result->{gff};
+ $self->reindex_ffffiles($result->{fff},$autodir) if $result->{fff};
+ $self->reindex_gfffiles($result->{gff},$autodir) if $result->{gff};
$self->dna_db(Bio::DB::Fasta::Subdir->new($autodir));
$self->unlock;
}
@@ -311,31 +315,50 @@
}
}
-sub reindex_gff3files {
+sub reindex_gfffiles {
my $self = shift;
my $files = shift;
my $autodir = shift;
- warn "Reindexing GFF3 files...\n";
+ warn "Reindexing GFF files...\n" if $self->verbose;
$self->_permissions(1,1);
$self->_close_databases();
$self->_open_databases(1,1);
require Bio::DB::SeqFeature::Store::GFF3Loader
unless Bio::DB::SeqFeature::Store::GFF3Loader->can('new');
my $loader = Bio::DB::SeqFeature::Store::GFF3Loader->new(-store => $self,
- -sf_class => $self->seqfeature_class)
+ -sf_class => $self->seqfeature_class)
or $self->throw("Couldn't create GFF3Loader");
my %seen;
$loader->load(grep {!$seen{$_}++} @$files);
$self->_touch_timestamp;
}
+sub reindex_ffffiles {
+ my $self = shift;
+ my $files = shift;
+ my $autodir = shift;
+
+ warn "Reindexing FFF files...\n" if $self->verbose;
+ $self->_permissions(1,1);
+ $self->_close_databases();
+ $self->_open_databases(1,1);
+ require Bio::DB::SeqFeature::Store::FeatureFileLoader
+ unless Bio::DB::SeqFeature::Store::FeatureFileLoader->can('new');
+ my $loader = Bio::DB::SeqFeature::Store::FeatureFileLoader->new(-store => $self,
+ -sf_class => $self->seqfeature_class)
+ or $self->throw("Couldn't create FeatureFileLoader");
+ my %seen;
+ $loader->load(grep {!$seen{$_}++} @$files);
+ $self->_touch_timestamp;
+}
+
sub reindex_wigfiles {
my $self = shift;
my $files = shift;
my $autodir = shift;
- warn "reindexing wig files";
+ warn "Reindexing wig files...\n" if $self->verbose;
unless (Bio::Graphics::Wiggle::Loader->can('new')) {
eval "require Bio::Graphics::Wiggle::Loader; 1"
@@ -343,6 +366,7 @@
}
for my $wig (@$files) {
+ warn "Reindexing $wig...\n" if $self->verbose;
my ($wib_name) = fileparse($wig,qr/\.[^.]*/);
my $gff3_name = "$wib_name.gff3";
@@ -360,6 +384,10 @@
or die "Can't open $gff3_path for writing: $!";
$fh->print($gff3_data);
$fh->close;
+ my $conf_path = File::Spec->catfile($autodir,"$wib_name.conf");
+ $fh = IO::File->new($conf_path,'>');
+ $fh->print($loader->conf_stanzas('microarray_oligo',$wib_name));
+ $fh->close;
}
}
@@ -375,7 +403,7 @@
# first interrogate the GFF3 files, using the timestamp file
# as modification comparison
- my (@gff3, at wig,$fasta,$fasta_index_time);
+ my (@gff3, at fff, at wig,$fasta,$fasta_index_time);
opendir (my $D,$autodir)
or $self->throw("Couldn't open directory $autodir for reading: $!");
@@ -385,12 +413,19 @@
my $path = File::Spec->catfile($autodir,$node);
next unless -f $path;
- if ($path =~ /\.gff3?$/i) {
+ if ($path =~ /\.gff\d?$/i) {
my $mtime = _mtime(\*_); # not a typo
$maxtime = $mtime if $mtime > $maxtime;
push @gff3,$path;
}
+
+ elsif ($path =~ /\.fff?$/i) {
+ my $mtime = _mtime(\*_); # not a typo
+ $maxtime = $mtime if $mtime > $maxtime;
+ push @fff,$path;
+ }
+
elsif ($path =~ /\.wig$/i) {
my $wig = $path;
(my $gff_file = $wig) =~ s/\.wig$/\.gff3/i;
@@ -412,19 +447,34 @@
$result->{gff} = \@gff3 if $maxtime > $timestamp_time;
$result->{wig} = \@wig if @wig;
+ $result->{fff} = \@fff if @fff;
$result->{fasta}++ if $fasta;
return $result;
}
+sub verbose {
+ my $self = shift;
+ my $d = $self->{verbose};
+ $self->{verbose} = shift if @_;
+ return $d;
+}
+sub lockfile {
+ my $self = shift;
+ return File::Spec->catfile($self->directory,'lock');
+}
+
sub lock {
my $self = shift;
my $mode = shift;
my $flag = $mode eq 'exclusive' ? LOCK_EX : LOCK_SH;
- my $lockfile = File::Spec->catfile($self->directory,'lock');
- my $open = -e $lockfile ? '<' : '>';
- my $fh = IO::File->new($lockfile,$open) or die "Cannot open $lockfile: $!";
+ my $lockfile = $self->lockfile;
+ my $fh = $self->_flock_fh;
+ unless ($fh) {
+ my $open = -e $lockfile ? '<' : '>';
+ $fh = IO::File->new($lockfile,$open) or die "Cannot open $lockfile: $!";
+ }
flock($fh,$flag);
$self->_flock_fh($fh);
}
@@ -433,7 +483,8 @@
my $self = shift;
my $fh = $self->_flock_fh or return;
flock($fh,LOCK_UN);
- $self->_flock_fh(undef);
+ undef $self->{flock_fh};
+ unlink $self->lockfile;
}
sub _flock_fh {
@@ -566,7 +617,6 @@
sub _delete_indexes {
my $self = shift;
my ($obj,$id) = @_;
- warn $obj->display_name;
# the additional "1" causes the index to be deleted
$self->_update_name_index($obj,$id,1);
Modified: bioperl-live/trunk/Bio/SeqFeature/Lite.pm
===================================================================
--- bioperl-live/trunk/Bio/SeqFeature/Lite.pm 2009-03-28 16:51:20 UTC (rev 15619)
+++ bioperl-live/trunk/Bio/SeqFeature/Lite.pm 2009-03-30 17:49:50 UTC (rev 15620)
@@ -784,8 +784,9 @@
my $self = shift;
my $tag = shift;
my $value = $self->{attributes}{$tag} or return;
- return CORE::ref $value ? @{$self->{attributes}{$tag}}
- : $self->{attributes}{$tag};
+ my $ref = CORE::ref $value;
+ return $ref && $ref eq 'ARRAY' ? @{$self->{attributes}{$tag}}
+ : $self->{attributes}{$tag};
}
sub get_Annotations {