+
+
+ | Revision 15112 (by sendu, 2008/12/08 18:12:38) |
+ BioperlTest -> Bio::Root::Test |
+
+
+
+
# -*-Perl-*- Test Harness script for Bioperl
# $Id$
use strict;
@@ -7,21 +33,27 @@
use lib '.';
use Bio::Root::Test;
- test_begin(-tests => 8);
+ test_begin(-tests => 6);
use_ok('Bio::SeqIO::metafasta');
}
my $verbose = test_debug();
-my $io = Bio::SeqIO->new(-format => 'metafasta',
- -verbose => $verbose,
- -file => test_input_file('test.metafasta'));
+my $io = Bio::SeqIO->new(-format => 'metafasta',
+ -verbose => $verbose,
+ -file => test_input_file('test.metafasta'));
isa_ok($io, 'Bio::SeqIO');
-ok(my $seq = $io->next_seq);
+ok(my $seq = $io->next_seq);
isa_ok($seq, 'Bio::Seq::Meta');
-is($seq->seq, 'ABCDEFHIJKLMNOPQRSTUVWXYZ');
-is($seq->display_id,'test');
-ok(my $charge = $seq->named_meta('charge'));
-is($charge, 'NBNAANCNJCNNNONNCNNUNNXNZ');
+is($seq->seq, "ABCDEFHIJKLMNOPQRSTUVWXYZ");
+is($seq->display_id,'test');
+
+
+
+
+
\ No newline at end of file
From cjfields at dev.open-bio.org Fri Feb 19 16:16:30 2010
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Fri, 19 Feb 2010 16:16:30 -0500
Subject: [Bioperl-guts-l] [16861] bioperl-live/trunk/t/SeqIO/metafasta.t:
fix bad test file
Message-ID: <201002192116.o1JLGUZj019838@dev.open-bio.org>
Revision: 16861
Author: cjfields
Date: 2010-02-19 16:16:30 -0500 (Fri, 19 Feb 2010)
Log Message:
-----------
fix bad test file
Modified Paths:
--------------
bioperl-live/trunk/t/SeqIO/metafasta.t
Modified: bioperl-live/trunk/t/SeqIO/metafasta.t
===================================================================
--- bioperl-live/trunk/t/SeqIO/metafasta.t 2010-02-19 21:05:34 UTC (rev 16860)
+++ bioperl-live/trunk/t/SeqIO/metafasta.t 2010-02-19 21:16:30 UTC (rev 16861)
@@ -1,30 +1,4 @@
-
-
-
-
-
- | Revision 15112 (by sendu, 2008/12/08 18:12:38) |
- BioperlTest -> Bio::Root::Test |
-
-
-
-
# -*-Perl-*- Test Harness script for Bioperl
+# -*-Perl-*- Test Harness script for Bioperl
# $Id$
use strict;
@@ -33,27 +7,19 @@
use lib '.';
use Bio::Root::Test;
- test_begin(-tests => 6);
+ test_begin(-tests => 6);
use_ok('Bio::SeqIO::metafasta');
}
my $verbose = test_debug();
-my $io = Bio::SeqIO->new(-format => 'metafasta',
- -verbose => $verbose,
- -file => test_input_file('test.metafasta'));
+my $io = Bio::SeqIO->new(-format => 'metafasta',
+ -verbose => $verbose,
+ -file => test_input_file('test.metafasta'));
isa_ok($io, 'Bio::SeqIO');
-ok(my $seq = $io->next_seq);
+ok(my $seq = $io->next_seq);
isa_ok($seq, 'Bio::Seq::Meta');
-is($seq->seq, "ABCDEFHIJKLMNOPQRSTUVWXYZ");
-is($seq->display_id,'test');
-
-
-
-
-
\ No newline at end of file
+is($seq->seq, "ABCDEFHIJKLMNOPQRSTUVWXYZ");
+is($seq->display_id,'test');
From cjfields at dev.open-bio.org Fri Feb 19 16:36:05 2010
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Fri, 19 Feb 2010 16:36:05 -0500
Subject: [Bioperl-guts-l] [16862] bioperl-live/trunk/Bio/SeqIO/embl.pm: deal
with empty buffer warnings
Message-ID: <201002192136.o1JLa5XJ020358@dev.open-bio.org>
Revision: 16862
Author: cjfields
Date: 2010-02-19 16:36:05 -0500 (Fri, 19 Feb 2010)
Log Message:
-----------
deal with empty buffer warnings
Modified Paths:
--------------
bioperl-live/trunk/Bio/SeqIO/embl.pm
Modified: bioperl-live/trunk/Bio/SeqIO/embl.pm
===================================================================
--- bioperl-live/trunk/Bio/SeqIO/embl.pm 2010-02-19 21:16:30 UTC (rev 16861)
+++ bioperl-live/trunk/Bio/SeqIO/embl.pm 2010-02-19 21:36:05 UTC (rev 16862)
@@ -419,18 +419,19 @@
while ( defined ($buffer) && $buffer =~ /^XX/ ) {
$buffer = $self->_readline();
}
-
+
if ( $buffer =~ /^CO/ ) {
# bug#2982
# special : create contig as annotation
- until ( !defined ($buffer) ) {
+ while ( defined ($buffer) ) {
$annotation->add_Annotation($_) for $self->_read_EMBL_Contig(\$buffer);
- if ( $buffer !~ /^CO/ ) {
+ if ( !$buffer || $buffer !~ /^CO/ ) {
last;
}
}
+ $buffer ||= '';
}
-if ($buffer !~ /^\/\//) { # if no SQ lines following CO (bug#2958)
+ if ($buffer !~ /^\/\//) { # if no SQ lines following CO (bug#2958)
if ( $buffer !~ /^SQ/ ) {
while ( defined ($_ = $self->_readline) ) {
/^SQ/ && last;
From cjfields at dev.open-bio.org Fri Feb 19 17:38:12 2010
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Fri, 19 Feb 2010 17:38:12 -0500
Subject: [Bioperl-guts-l] [16863] bioperl-live/trunk/Bio/TreeIO/phyloxml.pm:
squash warning
Message-ID: <201002192238.o1JMcCVa022935@dev.open-bio.org>
Revision: 16863
Author: cjfields
Date: 2010-02-19 17:38:12 -0500 (Fri, 19 Feb 2010)
Log Message:
-----------
squash warning
Modified Paths:
--------------
bioperl-live/trunk/Bio/TreeIO/phyloxml.pm
Modified: bioperl-live/trunk/Bio/TreeIO/phyloxml.pm
===================================================================
--- bioperl-live/trunk/Bio/TreeIO/phyloxml.pm 2010-02-19 21:36:05 UTC (rev 16862)
+++ bioperl-live/trunk/Bio/TreeIO/phyloxml.pm 2010-02-19 22:38:12 UTC (rev 16863)
@@ -345,7 +345,7 @@
}
# check if rooted
my ($b_rooted) = $tree->get_tag_values('rooted');
- print "b_rooted: $b_rooted\n";
+ print "b_rooted: $b_rooted\n" if $b_rooted;
if ($b_rooted) {
$attr_str .= " rooted=\"true\"";
}
From cjfields at dev.open-bio.org Fri Feb 19 17:51:28 2010
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Fri, 19 Feb 2010 17:51:28 -0500
Subject: [Bioperl-guts-l] [16864] bioperl-live/trunk/Bio/LocatableSeq.pm:
squash warnings
Message-ID: <201002192251.o1JMpSkD023378@dev.open-bio.org>
Revision: 16864
Author: cjfields
Date: 2010-02-19 17:51:28 -0500 (Fri, 19 Feb 2010)
Log Message:
-----------
squash warnings
Modified Paths:
--------------
bioperl-live/trunk/Bio/LocatableSeq.pm
Modified: bioperl-live/trunk/Bio/LocatableSeq.pm
===================================================================
--- bioperl-live/trunk/Bio/LocatableSeq.pm 2010-02-19 22:38:12 UTC (rev 16863)
+++ bioperl-live/trunk/Bio/LocatableSeq.pm 2010-02-19 22:51:28 UTC (rev 16864)
@@ -327,7 +327,7 @@
$self->throw("Attribute start not set") unless defined($st);
$self->throw("Attribute end not set") unless defined($end);
- if ($strand == -1) {
+ if ($strand && $strand == -1) {
($st, $end) = ($end, $st);
}
From cjfields at dev.open-bio.org Fri Feb 19 17:56:06 2010
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Fri, 19 Feb 2010 17:56:06 -0500
Subject: [Bioperl-guts-l] [16865] bioperl-live/trunk/Bio/PrimarySeqI.pm:
squash warning
Message-ID: <201002192256.o1JMu6Xg023456@dev.open-bio.org>
Revision: 16865
Author: cjfields
Date: 2010-02-19 17:56:06 -0500 (Fri, 19 Feb 2010)
Log Message:
-----------
squash warning
Modified Paths:
--------------
bioperl-live/trunk/Bio/PrimarySeqI.pm
Modified: bioperl-live/trunk/Bio/PrimarySeqI.pm
===================================================================
--- bioperl-live/trunk/Bio/PrimarySeqI.pm 2010-02-19 22:51:28 UTC (rev 16864)
+++ bioperl-live/trunk/Bio/PrimarySeqI.pm 2010-02-19 22:56:06 UTC (rev 16865)
@@ -694,12 +694,13 @@
$class = 'Bio::PrimarySeq';
$self->_attempt_to_load_Seq;
}
+ my $desc = $self->desc || '';
return $class->new(
'-seq' => $s,
'-alphabet' => 'rna',
'-display_id' => $self->display_id,
'-accession_number' => $self->accession_number,
- '-desc' => $self->desc . "[TRANSCRIBED]",
+ '-desc' => "${desc}[TRANSCRIBED]",
'-verbose' => $self->verbose
);
}
From cjfields at dev.open-bio.org Fri Feb 19 18:01:34 2010
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Fri, 19 Feb 2010 18:01:34 -0500
Subject: [Bioperl-guts-l] [16866] bioperl-live/trunk/t/LocalDB/DBFasta.t:
squish verbose output from tests
Message-ID: <201002192301.o1JN1Y58023835@dev.open-bio.org>
Revision: 16866
Author: cjfields
Date: 2010-02-19 18:01:33 -0500 (Fri, 19 Feb 2010)
Log Message:
-----------
squish verbose output from tests
Modified Paths:
--------------
bioperl-live/trunk/t/LocalDB/DBFasta.t
Modified: bioperl-live/trunk/t/LocalDB/DBFasta.t
===================================================================
--- bioperl-live/trunk/t/LocalDB/DBFasta.t 2010-02-19 22:56:06 UTC (rev 16865)
+++ bioperl-live/trunk/t/LocalDB/DBFasta.t 2010-02-19 23:01:33 UTC (rev 16866)
@@ -58,15 +58,16 @@
# test out writing the Bio::PrimarySeq::Fasta objects with SeqIO
$db = Bio::DB::Fasta->new($test_dbdir, -reindex => 1);
-my $out = Bio::SeqIO->new(-format => 'genbank');
+my $out = Bio::SeqIO->new(-format => 'genbank',
+ -file => '>'.test_output_file());
$primary_seq = Bio::Seq->new(-primary_seq => $db->get_Seq_by_acc('AW057119'));
eval {
- warn(ref($primary_seq),"\n");
+ #warn(ref($primary_seq),"\n");
$out->write_seq($primary_seq)
};
ok(!$@);
-$out = Bio::SeqIO->new(-format => 'embl');
+$out = Bio::SeqIO->new(-format => 'embl', -file => '>'.test_output_file());
eval {
$out->write_seq($primary_seq)
From cjfields at dev.open-bio.org Fri Feb 19 20:49:11 2010
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Fri, 19 Feb 2010 20:49:11 -0500
Subject: [Bioperl-guts-l] [16867] bioperl-live/trunk: Add id_mapper to
SwissProt, and tests
Message-ID: <201002200149.o1K1nBix028673@dev.open-bio.org>
Revision: 16867
Author: cjfields
Date: 2010-02-19 20:49:11 -0500 (Fri, 19 Feb 2010)
Log Message:
-----------
Add id_mapper to SwissProt, and tests
Modified Paths:
--------------
bioperl-live/trunk/Bio/DB/SwissProt.pm
bioperl-live/trunk/t/RemoteDB/SwissProt.t
Modified: bioperl-live/trunk/Bio/DB/SwissProt.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SwissProt.pm 2010-02-19 23:01:33 UTC (rev 16866)
+++ bioperl-live/trunk/Bio/DB/SwissProt.pm 2010-02-20 01:49:11 UTC (rev 16867)
@@ -154,6 +154,21 @@
}
);
+our %ID_MAPPING_DATABASES = map {$_ => 1} qw(
+ACC+ID ACC ID UPARC NF50 NF90 NF100 EMBL_ID EMBL PIR UNIGENE_ID P_ENTREZGENEID
+P_GI P_IPI P_REFSEQ_AC PDB_ID DISPROT_ID HSSP_ID DIP_ID MEROPS_ID PEROXIBASE_ID
+PPTASEDB_ID REBASE_ID TCDB_ID 2DBASE_ECOLI_ID AARHUS_GHENT_2DPAGE_ID
+ANU_2DPAGE_ID DOSAC_COBS_2DPAGE_ID ECO2DBASE_ID WORLD_2DPAGE_ID ENSEMBL_ID
+ENSEMBL_PRO_ID ENSEMBL_TRS_ID P_ENTREZGENEID GENOMEREVIEWS_ID KEGG_ID TIGR_ID
+UCSC_ID VECTORBASE_ID AGD_ID ARACHNOSERVER_ID BURULIST_ID CGD CYGD_ID
+DICTYBASE_ID ECHOBASE_ID ECOGENE_ID EUHCVDB_ID FLYBASE_ID GENECARDS_ID
+GENEDB_SPOMBE_ID GENEFARM_ID H_INVDB_ID HGNC_ID HPA_ID LEGIOLIST_ID LEPROMA_ID
+LISTILIST_ID MAIZEGDB_ID MIM_ID MGI_ID MYPULIST_ID NMPDR ORPHANET_ID PHARMGKB_ID
+PHOTOLIST_ID PSEUDOCAP_ID RGD_ID SAGALIST_ID SGD_ID SUBTILIST_ID TAIR_ID
+TUBERCULIST_ID WORMBASE_ID WORMPEP_ID XENBASE_ID ZFIN_ID EGGNOG_ID OMA_ID
+ORTHODB_ID BIOCYC_ID REACTOME_ID CLEANEX_ID GERMONLINE_ID DRUGBANK_ID
+NEXTBIO_ID);
+
# new modules should be a little more lightweight and
# should use Bio::Root::Root
sub new {
@@ -469,12 +484,62 @@
sub idtracker {
my ($self, $id) = @_;
$self->deprecated(
- -message => 'The SwissProt IDTracker service is no longer available',
+ -message => 'The SwissProt IDTracker service is no longer available, '.
+ 'use id_mapper() instead',
-warn_version => 1.006, # warn if $VERSION is >= this version
-throw_version => 1.007 # throw if $VERSION is >= this version
);
}
+=head2 id_mapper
+
+ Title : id_tracker
+ Usage : my $map = $self->id_mapper( -from => '',
+ -to => '',
+ -ids => \@ids);
+ Function: Retrieve new ID using old ID.
+ Returns : hash reference of successfully mapped IDs
+ Args : -from : database mapping from
+ -to : database mapped to
+ -ids : a single ID or array ref of IDs to map
+
+=cut
+
+sub id_mapper {
+ my $self = shift;
+ my ($from, $to, $ids) = $self->_rearrange([qw(FROM TO IDS)], @_);
+ for ($from, $to) {
+ $self->throw("$_ is not a recognized database") if !exists $ID_MAPPING_DATABASES{$_};
+ }
+ my @ids = ref $ids ? @$ids : $ids;
+ my $params = {
+ from => $from,
+ to => $to,
+ format => 'tab',
+ query => join(' ', at ids)
+ };
+ my $ua = $self->ua;
+ push @{ $ua->requests_redirectable }, 'POST';
+ my $response = $ua->post("http://www.uniprot.org/mapping/", $params);
+ while (my $wait = $response->header('Retry-After')) {
+ $self->debug("Waiting...\n");
+ $self->_sleep;
+ $response = $ua->get($response->base);
+ }
+
+ my %map;
+ if ($response->is_success) {
+ for my $line (split("\n", $response->content)) {
+ my ($id_from, $id_to) = split(/\s+/, $line, 2);
+ next if $id_from eq 'From';
+ $map{$id_from} = $id_to;
+ }
+ } else {
+ $self->throw("Error: ".$response->status_line."\n");
+ }
+ \%map;
+}
+
1;
__END__
Modified: bioperl-live/trunk/t/RemoteDB/SwissProt.t
===================================================================
--- bioperl-live/trunk/t/RemoteDB/SwissProt.t 2010-02-19 23:01:33 UTC (rev 16866)
+++ bioperl-live/trunk/t/RemoteDB/SwissProt.t 2010-02-20 01:49:11 UTC (rev 16867)
@@ -7,7 +7,7 @@
use lib '.';
use Bio::Root::Test;
- test_begin(-tests => 19,
+ test_begin(-tests => 21,
-requires_modules => [qw(IO::String
LWP::UserAgent
HTTP::Request::Common)],
@@ -67,21 +67,25 @@
-delay => 0,
-verbose => -1);
-TODO: {
- local $TODO = "idtracker() not working (may be temporary)";
+SKIP: {
+ my $map;
+ # check old ID
+ eval {$map = $gb->id_mapper(-from => 'ACC+ID',
+ -to => 'ACC',
+ -ids => [qw(MYOD1_PIG YNB3_YEAST)])
+ };
+ skip("Problem with idtracker(), skipping these tests: $@", 4) if $@;
- SKIP: {
- my $newid;
- # check old ID
- eval {$newid = $gb->idtracker('myod_pig');};
- skip("Problem with idtracker(), skipping these tests", 2) if $@;
- is($newid, 'MYOD1_PIG');
- # check ID that is current
- eval {$newid = $gb->idtracker('YNB3_YEAST');};
- skip("Problem with idtracker(), skipping these tests", 1) if $@;
- is($newid, 'YNB3_YEAST');
- }
+ is($map->{MYOD1_PIG}, 'P49811');
+ is($map->{YNB3_YEAST}, 'P53979');
+ eval {$map = $gb->id_mapper(-from => 'ACC+ID',
+ -to => 'ENSEMBL_PRO_ID',
+ -ids => [qw(MYOD1_PIG YNB3_YEAST)])
+ };
+ skip("Problem with idtracker(), skipping these tests: $@", 2) if $@;
+ is($map->{MYOD1_PIG}, 'ENSSSCP00000014214');
+ is($map->{YNB3_YEAST}, 'YNL013C');
}
1;
From cjfields at dev.open-bio.org Fri Feb 19 20:51:52 2010
From: cjfields at dev.open-bio.org (Christopher John Fields)
Date: Fri, 19 Feb 2010 20:51:52 -0500
Subject: [Bioperl-guts-l] [16868] bioperl-live/trunk/Bio/DB/SwissProt.pm:
add link for database
Message-ID: <201002200151.o1K1pqIL028747@dev.open-bio.org>
Revision: 16868
Author: cjfields
Date: 2010-02-19 20:51:52 -0500 (Fri, 19 Feb 2010)
Log Message:
-----------
add link for database
Modified Paths:
--------------
bioperl-live/trunk/Bio/DB/SwissProt.pm
Modified: bioperl-live/trunk/Bio/DB/SwissProt.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SwissProt.pm 2010-02-20 01:49:11 UTC (rev 16867)
+++ bioperl-live/trunk/Bio/DB/SwissProt.pm 2010-02-20 01:51:52 UTC (rev 16868)
@@ -502,6 +502,8 @@
Args : -from : database mapping from
-to : database mapped to
-ids : a single ID or array ref of IDs to map
+ Note : For a list of valid database IDs, see:
+ http://www.uniprot.org/faq/28#id_mapping_examples
=cut
From bugzilla-daemon at portal.open-bio.org Mon Feb 22 12:01:28 2010
From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org)
Date: Mon, 22 Feb 2010 12:01:28 -0500
Subject: [Bioperl-guts-l] [Bug 3014] New: bowtie wrapper,
support alternate OS
Message-ID: