From e4234e780b6fc07f13f68ef6221159ca1defecb8 Mon Sep 17 00:00:00 2001 From: Kevin Galinsky Date: Thu, 23 Jun 2011 11:22:54 -0400 Subject: [PATCH] remove Tiny --- .includepath | 4 +-- .project | 6 ++-- Build.PL | 10 +++--- Changes | 4 +-- MANIFEST.SKIP | 2 +- README | 12 +++---- bin/translate_fasta.pl | 4 +-- lib/Bio/Translator.pm | 58 +++++++++++++++--------------- lib/Bio/Translator/Table.pm | 60 +++++++++++++++---------------- lib/Bio/Translator/Utils.pm | 22 ++++++------ lib/Bio/Translator/Validations.pm | 4 +-- t/01-translate.t | 4 +-- t/04-custom.t | 4 +-- t/21-codons.t | 4 +-- t/22-regex.t | 4 +-- t/23-find.t | 4 +-- t/24-nonstop.t | 4 +-- t/25-getORF.t | 6 ++-- t/26-getCDS.t | 6 ++-- t/boilerplate.t | 2 +- 20 files changed, 112 insertions(+), 112 deletions(-) diff --git a/.includepath b/.includepath index 9858d0d..9908c38 100644 --- a/.includepath +++ b/.includepath @@ -1,7 +1,7 @@ - - + + diff --git a/.project b/.project index c138f35..991e069 100644 --- a/.project +++ b/.project @@ -1,10 +1,10 @@ - Bio-Tiny-Translator + Bio-Translator - Bio-Tiny-Util-AA - Bio-Tiny-Util-DNA + Bio-Util-AA + Bio-Util-DNA diff --git a/Build.PL b/Build.PL index e60d61e..a31d3c6 100644 --- a/Build.PL +++ b/Build.PL @@ -3,18 +3,18 @@ use warnings; use Module::Build; my $builder = Module::Build->new( - module_name => 'Bio::Tiny::Translator', + module_name => 'Bio::Translator', license => 'perl', dist_author => 'Kevin Galinsky ', - dist_version_from => 'lib/Bio/Tiny/Translator.pm', + dist_version_from => 'lib/Bio/Translator.pm', build_requires => { 'Test::More' => 0, }, requires => { - 'Bio::Tiny::Util::AA' => '>= 0.1.0', - 'Bio::Tiny::Util::DNA' => '>= 0.2.0' + 'Bio::Util::AA' => '>= 0.1.0', + 'Bio::Util::DNA' => '>= 0.2.0' }, - add_to_cleanup => [ 'Bio-Tiny-Translator-*' ], + add_to_cleanup => [ 'Bio-Translator-*' ], create_makefile_pl => 'traditional', ); diff --git a/Changes b/Changes index 59adbb1..e69ddda 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,4 @@ -Revision history for Bio::Tiny::Translator +Revision history for Bio::Translator 0.5.7 May 10 2011 - Changed namespace @@ -28,7 +28,7 @@ Revision history for Bio::Tiny::Translator 0.5.1 Apr 13 2009 - Better documentation in Utils - - Fixed bugs in Bio::Tiny::Translator::Utils::regex and find + - Fixed bugs in Bio::Translator::Utils::regex and find - Fixed load test and added new tests 0.5.0 Apr 2 2009 diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index f7e2691..b9ae58b 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -70,7 +70,7 @@ ^MANIFEST\.SKIP # Avoid archives of this distribution -\bBio-Tiny-Translator-[\d\.\_]+ +\bBio-Translator-[\d\.\_]+ # Avoid tests that aren't useful for end-user ^t/kwalitee diff --git a/README b/README index 7fe23a6..c0594be 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Bio::Tiny::Translator tries to be a robust translator object featuring translation +Bio::Translator tries to be a robust translator object featuring translation tables based off the the ones provided by NCBI (http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi). Key features include the ability to handle degenerate nucleotides and to @@ -18,21 +18,21 @@ SUPPORT AND DOCUMENTATION After installing, you can find documentation for this module with the perldoc command. - perldoc Bio::Tiny::Translator + perldoc Bio::Translator You can also look for information at: Search CPAN - http://search.cpan.org/dist/Bio-Tiny-Translator + http://search.cpan.org/dist/Bio-Translator CPAN Request Tracker: - http://rt.cpan.org/NoAuth/Bugs.html?Dist=Bio-Tiny-Translator + http://rt.cpan.org/NoAuth/Bugs.html?Dist=Bio-Translator AnnoCPAN, annotated CPAN documentation: - http://annocpan.org/dist/Bio-Tiny-Translator + http://annocpan.org/dist/Bio-Translator CPAN Ratings: - http://cpanratings.perl.org/d/Bio-Tiny-Translator + http://cpanratings.perl.org/d/Bio-Translator COPYRIGHT AND LICENCE diff --git a/bin/translate_fasta.pl b/bin/translate_fasta.pl index 6872037..98cf890 100755 --- a/bin/translate_fasta.pl +++ b/bin/translate_fasta.pl @@ -8,11 +8,11 @@ use strict; #use warnings; -use Bio::Tiny::Translator; +use Bio::Translator; use Getopt::Euclid ':vars'; # Instantiate the translator -my $t = Bio::Tiny::Translator->new($ARGV_translation_table); +my $t = Bio::Translator->new($ARGV_translation_table); # Build the list of file handles or standard input diff --git a/lib/Bio/Translator.pm b/lib/Bio/Translator.pm index 58a9ea3..919e2a7 100644 --- a/lib/Bio/Translator.pm +++ b/lib/Bio/Translator.pm @@ -1,4 +1,4 @@ -package Bio::Tiny::Translator; +package Bio::Translator; use strict; use warnings; @@ -7,20 +7,20 @@ use version; our $VERSION = qv('0.6.0'); =head1 NAME -Bio::Tiny::Translator - Translate DNA sequences +Bio::Translator - Translate DNA sequences =head1 SYNOPSIS - use Bio::Tiny::Translator; + use Bio::Translator; - my $translator = new Bio::Tiny::Translator(); - my $translator = new Bio::Tiny::Translator(11); - my $translator = new Bio::Tiny::Translator( 12, 'id' ); - my $translator = new Bio::Tiny::Translator( 'Yeast Mitochondrial', 'name' ); - my $translator = new Bio::Tiny::Translator( 'mito', 'name' ); + my $translator = new Bio::Translator(); + my $translator = new Bio::Translator(11); + my $translator = new Bio::Translator( 12, 'id' ); + my $translator = new Bio::Translator( 'Yeast Mitochondrial', 'name' ); + my $translator = new Bio::Translator( 'mito', 'name' ); - my $translator = custom Bio::Tiny::Translator( \$custom_table ); - my $translator = custom Bio::Tiny::Translator( \$custom_table, 1 ); + my $translator = custom Bio::Translator( \$custom_table ); + my $translator = custom Bio::Translator( \$custom_table, 1 ); $translator->translate( \$seq ); $translator->translate( \$seq, { strand => 1 } ); @@ -28,14 +28,14 @@ Bio::Tiny::Translator - Translate DNA sequences =head1 DESCRIPTION -C tries to be a robust translator object featuring +C tries to be a robust translator object featuring translation tables based off the the ones provided by L. Key features include the ability to handle degenerate nucleotides and to translate to ambiguous amino acids. First, create a new translator object using one of the included tables or a -custom one (see C for table formats), and then +custom one (see C for table formats), and then passing your DNA sequences to your translator object. The translator uses interbase coordinates. See below for the difference between @@ -63,10 +63,10 @@ __PACKAGE__->mk_accessors('table'); use Carp; use Params::Validate; -use Bio::Tiny::Translator::Table; -use Bio::Tiny::Translator::Validations ':validations'; +use Bio::Translator::Table; +use Bio::Translator::Validations ':validations'; -use Bio::Tiny::Util::DNA qw/ $all_nucleotide_match /; +use Bio::Util::DNA qw/ $all_nucleotide_match /; =head1 CONSTRUCTORS @@ -76,18 +76,18 @@ sub _new { shift->SUPER::new( { table => shift } ) } =head2 new - my $translator = new Bio::Tiny::Translator(); - my $translator = new Bio::Tiny::Translator( $id ); - my $translator = new Bio::Tiny::Translator( $id, \%params ); + my $translator = new Bio::Translator(); + my $translator = new Bio::Translator( $id ); + my $translator = new Bio::Translator( $id, \%params ); Create a translator with a translation table provided by $id. Please see -Bio::Tiny::Translator::Table for the full list of options. +Bio::Translator::Table for the full list of options. =cut sub new { my $class = shift; - my $table = Bio::Tiny::Translator::Table->new(@_) or return; + my $table = Bio::Translator::Table->new(@_) or return; $class->_new($table); } @@ -97,13 +97,13 @@ sub new { my $translator = $translator->custom( $table_ref, \%params ); Create a translator with a custom translation table. Please see -Bio::Tiny::Translator::Table for the full list of options. +Bio::Translator::Table for the full list of options. =cut sub custom { my $class = shift; - my $table = Bio::Tiny::Translator::Table->custom(@_) or return; + my $table = Bio::Translator::Table->custom(@_) or return; $class->_new($table); } @@ -358,8 +358,8 @@ Kevin Galinsky, C =head1 BUGS Please report any bugs or feature requests to -C, or through the web interface at -L. +C, or through the web interface at +L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. @@ -367,7 +367,7 @@ your bug as I make changes. You can find documentation for this module with the perldoc command. - perldoc Bio::Tiny::Translator + perldoc Bio::Translator You can also look for information at: @@ -375,19 +375,19 @@ You can also look for information at: =item * AnnoCPAN: Annotated CPAN documentation -L +L =item * CPAN Ratings -L +L =item * RT: CPAN's request tracker -L +L =item * Search CPAN -L +L =back diff --git a/lib/Bio/Translator/Table.pm b/lib/Bio/Translator/Table.pm index a325e1d..b413c44 100644 --- a/lib/Bio/Translator/Table.pm +++ b/lib/Bio/Translator/Table.pm @@ -1,24 +1,24 @@ -package Bio::Tiny::Translator::Table; +package Bio::Translator::Table; use strict; use warnings; =head1 NAME -Bio::Tiny::Translator::Table - translation table +Bio::Translator::Table - translation table =head1 SYNOPSIS - use Bio::Tiny::Translator::Table; + use Bio::Translator::Table; - my $table = new Bio::Tiny::Translator(); - my $table = new Bio::Tiny::Translator(11); - my $table = new Bio::Tiny::Translator( 12, { type => 'id' } ); - my $table = new Bio::Tiny::Translator( 'Yeast Mitochondrial', { type => 'name' } ); - my $table = new Bio::Tiny::Translator( 'mito', { type => 'name' } ); + my $table = new Bio::Translator(); + my $table = new Bio::Translator(11); + my $table = new Bio::Translator( 12, { type => 'id' } ); + my $table = new Bio::Translator( 'Yeast Mitochondrial', { type => 'name' } ); + my $table = new Bio::Translator( 'mito', { type => 'name' } ); - my $table = custom Bio::Tiny::Translator( \$custom_table ); - my $tale = custom Bio::Tiny::Translator( \$custom_table, { bootstrap => 0 } ); + my $table = custom Bio::Translator( \$custom_table ); + my $tale = custom Bio::Translator( \$custom_table, { bootstrap => 0 } ); =cut @@ -29,7 +29,7 @@ __PACKAGE__->mk_accessors(qw(id names codon2aa codon2start aa2codons)); use Params::Validate; use Carp; -use Bio::Tiny::Util::DNA qw( +use Bio::Util::DNA qw( %degenerate2nucleotides %nucleotides2degenerate %degenerate_hierarchy @@ -45,7 +45,7 @@ use Bio::Tiny::Util::DNA qw( reverse_complement ); -use Bio::Tiny::Util::AA qw( +use Bio::Util::AA qw( %ambiguous_forward %ambiguous_map $aa_match @@ -64,18 +64,18 @@ sub _new { shift->SUPER::new( { names => [], - codon2aa => Bio::Tiny::Translator::Table::Pair->new(), - codon2start => Bio::Tiny::Translator::Table::Pair->new(), - aa2codons => Bio::Tiny::Translator::Table::Pair->new() + codon2aa => Bio::Translator::Table::Pair->new(), + codon2start => Bio::Translator::Table::Pair->new(), + aa2codons => Bio::Translator::Table::Pair->new() } ); } =head2 new - my $table = Bio::Tiny::Translator::Table->new(); - my $table = Bio::Tiny::Translator::Table->new( $id ); - my $table = Bio::Tiny::Translator::Table->new( $id, \%params ); + my $table = Bio::Translator::Table->new(); + my $table = Bio::Translator::Table->new( $id ); + my $table = Bio::Translator::Table->new( $id, \%params ); This method creates a translation table by loading a table string from the internal list. Pass an ID and the type of ID. By default, it will load the @@ -107,18 +107,18 @@ strings. By default, the "Standard" translation table will be loaded. You may instantiate this translation table by calling any of the following: - my $t = Bio::Tiny::Translator::Table->new(); - my $t = Bio::Tiny::Translator::Table->new(1); - my $t = Bio::Tiny::Translator::Table->new( 1, { type => 'id' } ); - my $t = Bio::Tiny::Translator::Table->new( 'Standard', { type => 'name' } ); - my $t = Bio::Tiny::Translator::Table->new( 'SGC0', { type => 'name' } ); - my $t = Bio::Tiny::Translator::Table->new( 'standard', { type => 'name' } ); - my $t = Bio::Tiny::Translator::Table->new( 'stan', { type => 'name' } ); + my $t = Bio::Translator::Table->new(); + my $t = Bio::Translator::Table->new(1); + my $t = Bio::Translator::Table->new( 1, { type => 'id' } ); + my $t = Bio::Translator::Table->new( 'Standard', { type => 'name' } ); + my $t = Bio::Translator::Table->new( 'SGC0', { type => 'name' } ); + my $t = Bio::Translator::Table->new( 'standard', { type => 'name' } ); + my $t = Bio::Translator::Table->new( 'stan', { type => 'name' } ); For partial matches, this module will use the first matching translation table. - my $t = Bio::Tiny::Translator::Table->new( 'mitochondrial', { type => 'name' } ); + my $t = Bio::Translator::Table->new( 'mitochondrial', { type => 'name' } ); This will use translation table with ID 2, "Vertebrate Mitochondrial," because that is the first match (even though "Yeast Mitochondrial" would also match). @@ -178,8 +178,8 @@ sub new { =head2 custom() - my $table = Bio::Tiny::Translator::Table->custom( $table_ref ); - my $table = Bio::Tiny::Translator::Table->custom( $table_ref, \%params ); + my $table = Bio::Translator::Table->custom( $table_ref ); + my $table = Bio::Translator::Table->custom( $table_ref, \%params ); Create a translation table based off a passed table reference for custom translation tables. Loads degenerate nucleotides if bootstrap isn't set (this @@ -578,12 +578,12 @@ sub string { { - package Bio::Tiny::Translator::Table::Pair; + package Bio::Translator::Table::Pair; use strict; use warnings; - use Bio::Tiny::Util::DNA qw(reverse_complement); + use Bio::Util::DNA qw(reverse_complement); sub new { my $class = shift; diff --git a/lib/Bio/Translator/Utils.pm b/lib/Bio/Translator/Utils.pm index 6035bd6..cccc562 100644 --- a/lib/Bio/Translator/Utils.pm +++ b/lib/Bio/Translator/Utils.pm @@ -1,19 +1,19 @@ -package Bio::Tiny::Translator::Utils; +package Bio::Translator::Utils; use strict; use warnings; =head1 NAME -Bio::Tiny::Translator::Utils - Utilities that requrie a translation table +Bio::Translator::Utils - Utilities that requrie a translation table =head1 SYNOPSIS - use Bio::Tiny::Translator::Utils; + use Bio::Translator::Utils; - # Same constructor as Bio::Tiny::Translator - my $utils = new Bio::Tiny::Translator::Utils(); - my $utils = custom Bio::Tiny::Translator( \$custom_table ); + # Same constructor as Bio::Translator + my $utils = new Bio::Translator::Utils(); + my $utils = custom Bio::Translator( \$custom_table ); my $codons = $utils->codons( $residue ); my $regex = $utils->regex( $residue ); @@ -26,20 +26,20 @@ Bio::Tiny::Translator::Utils - Utilities that requrie a translation table =head1 DESCRIPTION -See Bio::Tiny::Translator for more info. Utils contains utilites that require +See Bio::Translator for more info. Utils contains utilites that require knowledge of the translation table. =cut -use base qw(Bio::Tiny::Translator); +use base qw(Bio::Translator); __PACKAGE__->mk_accessors(qw( _regexes )); use Params::Validate; -use Bio::Tiny::Translator::Validations qw(:validations :regexes); +use Bio::Translator::Validations qw(:validations :regexes); -use Bio::Tiny::Util::DNA qw( cleanDNA ); -use Bio::Tiny::Util::AA qw( $aa_match ); +use Bio::Util::DNA qw( cleanDNA ); +use Bio::Util::AA qw( $aa_match ); # Default values our $DEFAULT_STRAND = 1; diff --git a/lib/Bio/Translator/Validations.pm b/lib/Bio/Translator/Validations.pm index 55e66ee..6e52a6e 100644 --- a/lib/Bio/Translator/Validations.pm +++ b/lib/Bio/Translator/Validations.pm @@ -1,11 +1,11 @@ -package Bio::Tiny::Translator::Validations; +package Bio::Translator::Validations; use strict; use warnings; =head1 NAME -Bio::Tiny::Translator::Validations - validation methods and objects +Bio::Translator::Validations - validation methods and objects =cut diff --git a/t/01-translate.t b/t/01-translate.t index efbc4dc..143359f 100644 --- a/t/01-translate.t +++ b/t/01-translate.t @@ -2,11 +2,11 @@ use Test::More 'no_plan'; -use Bio::Tiny::Translator; +use Bio::Translator; my $seq = 'CTGATATCATGCATGCCATTCTCGACCGCTATGCGCCTCCTGTTCCTCGTGGGCCCAAAA'; -my $translator = new Bio::Tiny::Translator(); +my $translator = new Bio::Translator(); is( ${ $translator->translate( \$seq ) }, 'MISCMPFSTAMRLLFLVGPK', 'Translate frame 1' ); diff --git a/t/04-custom.t b/t/04-custom.t index be8f72b..348e950 100644 --- a/t/04-custom.t +++ b/t/04-custom.t @@ -2,12 +2,12 @@ use Test::More 'no_plan'; -use Bio::Tiny::Translator; +use Bio::Translator; my $translator; ok( - $translator = custom Bio::Tiny::Translator( + $translator = custom Bio::Translator( \'{ name "Standard" , name "SGC0" , diff --git a/t/21-codons.t b/t/21-codons.t index 6baa076..a0039a7 100644 --- a/t/21-codons.t +++ b/t/21-codons.t @@ -1,10 +1,10 @@ #!perl use Test::More 'no_plan'; -use Bio::Tiny::Translator::Utils; +use Bio::Translator::Utils; use List::Compare; -my $utils = new Bio::Tiny::Translator::Utils(); +my $utils = new Bio::Translator::Utils(); eval { $utils->codons() }; ok( $@, 'codons died with no parameters' ); diff --git a/t/22-regex.t b/t/22-regex.t index 5f20064..1aa3149 100644 --- a/t/22-regex.t +++ b/t/22-regex.t @@ -1,10 +1,10 @@ #!perl use Test::More 'no_plan'; -use Bio::Tiny::Translator::Utils; +use Bio::Translator::Utils; use List::Compare; -my $utils = new Bio::Tiny::Translator::Utils(); +my $utils = new Bio::Translator::Utils(); eval { $utils->regex() }; ok( $@, 'regex died with no parameters' ); diff --git a/t/23-find.t b/t/23-find.t index 2ef3fee..86e05ec 100644 --- a/t/23-find.t +++ b/t/23-find.t @@ -1,10 +1,10 @@ #!perl use Test::More 'no_plan'; -use Bio::Tiny::Translator::Utils; +use Bio::Translator::Utils; use List::Compare; -my $utils = new Bio::Tiny::Translator::Utils(); +my $utils = new Bio::Translator::Utils(); eval { $utils->find() }; ok( $@, 'find died with no options' ); diff --git a/t/24-nonstop.t b/t/24-nonstop.t index 7610dcd..6089fc7 100644 --- a/t/24-nonstop.t +++ b/t/24-nonstop.t @@ -3,9 +3,9 @@ use Test::More 'no_plan'; use List::Compare::Functional 'get_symdiff'; -use Bio::Tiny::Translator::Utils; +use Bio::Translator::Utils; -my $utils = new Bio::Tiny::Translator::Utils; +my $utils = new Bio::Translator::Utils; is( scalar( diff --git a/t/25-getORF.t b/t/25-getORF.t index 116de52..865d419 100644 --- a/t/25-getORF.t +++ b/t/25-getORF.t @@ -1,10 +1,10 @@ #!perl use Test::More 'no_plan'; -use Bio::Tiny::Util::DNA qw(randomDNA); +use Bio::Util::DNA qw(randomDNA); -use Bio::Tiny::Translator::Utils; +use Bio::Translator::Utils; -my $utils = new Bio::Tiny::Translator::Utils; +my $utils = new Bio::Translator::Utils; ok( $utils->getORF( randomDNA() ), 'getORF ran' ); diff --git a/t/26-getCDS.t b/t/26-getCDS.t index a4cf7fe..5faa1f3 100644 --- a/t/26-getCDS.t +++ b/t/26-getCDS.t @@ -1,10 +1,10 @@ #!perl use Test::More 'no_plan'; -use Bio::Tiny::Util::DNA qw(randomDNA); +use Bio::Util::DNA qw(randomDNA); -use Bio::Tiny::Translator::Utils; +use Bio::Translator::Utils; -my $utils = new Bio::Tiny::Translator::Utils; +my $utils = new Bio::Translator::Utils; ok( $utils->getCDS( randomDNA() ), 'getCDS ran' ); diff --git a/t/boilerplate.t b/t/boilerplate.t index a9d59aa..b4bd7ac 100644 --- a/t/boilerplate.t +++ b/t/boilerplate.t @@ -45,4 +45,4 @@ sub module_boilerplate_ok { ); } -module_boilerplate_ok('lib/Bio/Tiny/Translator.pm'); +module_boilerplate_ok('lib/Bio/Translator.pm');