Permalink
Browse files

Reversed problematic commit 8334d17

  • Loading branch information...
fangly committed Sep 10, 2012
1 parent dcdf5a7 commit c4fcdea6a92f127ef24336fe14cf3611d9d4e600
Showing with 32 additions and 117 deletions.
  1. +27 −32 Bio/Tools/IUPAC.pm
  2. +5 −85 t/Tools/IUPAC.t
View
@@ -66,7 +66,6 @@ described below:
X G or A or T or C
N G or A or T or C
-Note that T and U are both considered the same in this module.
IUPAC-IUP AMINO ACID SYMBOLS:
Biochem J. 1984 Apr 15; 219(2): 345-373
@@ -164,8 +163,6 @@ methods. Internal methods are usually preceded with a _
=cut
-# Let the code begin...
-
package Bio::Tools::IUPAC;
use strict;
@@ -178,26 +175,24 @@ BEGIN {
A => [qw(A)],
C => [qw(C)],
G => [qw(G)],
- T => [qw(T U)],
- U => [qw(U T)],
+ T => [qw(T)],
+ U => [qw(U)],
M => [qw(A C)],
R => [qw(A G)],
S => [qw(C G)],
- W => [qw(A T U)],
- Y => [qw(C T U)],
- K => [qw(G T U)],
+ W => [qw(A T)],
+ Y => [qw(C T)],
+ K => [qw(G T)],
V => [qw(A C G)],
- H => [qw(A C T U)],
- D => [qw(A G T U)],
- B => [qw(C G T U)],
- N => [qw(A C G T U)],
- X => [qw(A C G T U)],
+ H => [qw(A C T)],
+ D => [qw(A G T)],
+ B => [qw(C G T)],
+ N => [qw(A C G T)],
+ X => [qw(A C G T)],
);
# Same as %IUB but ambiguous residues are matched to ambiguous residues only
%IUB_AMB = (
- T => [qw()],
- U => [qw()],
M => [qw(M)],
R => [qw(R)],
W => [qw(W)],
@@ -213,23 +208,23 @@ BEGIN {
# The inverse of %IUB
%REV_IUB = (
- A => 'A',
- T => 'T',
- U => 'U',
- C => 'C',
- G => 'G',
- AC => 'M',
- AG => 'R',
- ATU => 'W',
- CG => 'S',
- CTU => 'Y',
- GTU => 'K',
- ACG => 'V',
- ACTU => 'H',
- AGTU => 'D',
- CGTU => 'B',
- ACGTU => 'N',
- N => 'N'
+ A => 'A',
+ T => 'T',
+ U => 'U',
+ C => 'C',
+ G => 'G',
+ AC => 'M',
+ AG => 'R',
+ AT => 'W',
+ CG => 'S',
+ CT => 'Y',
+ GT => 'K',
+ ACG => 'V',
+ ACT => 'H',
+ AGT => 'D',
+ CGT => 'B',
+ ACGT => 'N',
+ N => 'N'
);
# Same thing with proteins now
View
@@ -7,7 +7,7 @@ BEGIN {
use lib '.';
use Bio::Root::Test;
- test_begin(-tests => 189);
+ test_begin(-tests => 45);
use_ok('Bio::Tools::IUPAC');
use_ok('Bio::Seq');
@@ -33,9 +33,9 @@ ok $iupac = Bio::Tools::IUPAC->new( -seq => $ambiseq );
ok my $regexp = $iupac->regexp;
-is $regexp, 'A[AGR][TU]CG[TU][TU]G[ACGTUBDHKMNRSVWY]', 'Regexp';
+is $regexp, 'A[AGR]TCGTTG[ACGTBDHKMNRSVWY]', 'Regexp';
-is $iupac->count(), 80, 'Count';
+is $iupac->count(), 8, 'Count';
my @seqs;
while (my $uniqueseq = $iupac->next_seq()) {
@@ -45,88 +45,8 @@ while (my $uniqueseq = $iupac->next_seq()) {
}
@seqs = sort @seqs;
-is_deeply \@seqs, [
- 'AATCGTTGA',
- 'AATCGTTGC',
- 'AATCGTTGG',
- 'AATCGTTGT',
- 'AATCGTTGU',
- 'AATCGTUGA',
- 'AATCGTUGC',
- 'AATCGTUGG',
- 'AATCGTUGT',
- 'AATCGTUGU',
- 'AATCGUTGA',
- 'AATCGUTGC',
- 'AATCGUTGG',
- 'AATCGUTGT',
- 'AATCGUTGU',
- 'AATCGUUGA',
- 'AATCGUUGC',
- 'AATCGUUGG',
- 'AATCGUUGT',
- 'AATCGUUGU',
- 'AAUCGTTGA',
- 'AAUCGTTGC',
- 'AAUCGTTGG',
- 'AAUCGTTGT',
- 'AAUCGTTGU',
- 'AAUCGTUGA',
- 'AAUCGTUGC',
- 'AAUCGTUGG',
- 'AAUCGTUGT',
- 'AAUCGTUGU',
- 'AAUCGUTGA',
- 'AAUCGUTGC',
- 'AAUCGUTGG',
- 'AAUCGUTGT',
- 'AAUCGUTGU',
- 'AAUCGUUGA',
- 'AAUCGUUGC',
- 'AAUCGUUGG',
- 'AAUCGUUGT',
- 'AAUCGUUGU',
- 'AGTCGTTGA',
- 'AGTCGTTGC',
- 'AGTCGTTGG',
- 'AGTCGTTGT',
- 'AGTCGTTGU',
- 'AGTCGTUGA',
- 'AGTCGTUGC',
- 'AGTCGTUGG',
- 'AGTCGTUGT',
- 'AGTCGTUGU',
- 'AGTCGUTGA',
- 'AGTCGUTGC',
- 'AGTCGUTGG',
- 'AGTCGUTGT',
- 'AGTCGUTGU',
- 'AGTCGUUGA',
- 'AGTCGUUGC',
- 'AGTCGUUGG',
- 'AGTCGUUGT',
- 'AGTCGUUGU',
- 'AGUCGTTGA',
- 'AGUCGTTGC',
- 'AGUCGTTGG',
- 'AGUCGTTGT',
- 'AGUCGTTGU',
- 'AGUCGTUGA',
- 'AGUCGTUGC',
- 'AGUCGTUGG',
- 'AGUCGTUGT',
- 'AGUCGTUGU',
- 'AGUCGUTGA',
- 'AGUCGUTGC',
- 'AGUCGUTGG',
- 'AGUCGUTGT',
- 'AGUCGUTGU',
- 'AGUCGUUGA',
- 'AGUCGUUGC',
- 'AGUCGUUGG',
- 'AGUCGUUGT',
- 'AGUCGUUGU'
-];
+is_deeply \@seqs, [ 'AATCGTTGA', 'AATCGTTGC', 'AATCGTTGG', 'AATCGTTGT',
+ 'AGTCGTTGA', 'AGTCGTTGC', 'AGTCGTTGG', 'AGTCGTTGT' ];
like $ambiseq->seq, qr/$regexp/i, 'Regexp matches ambiguous sequences';
like 'ARTCGTTGW', qr/$regexp/i;

0 comments on commit c4fcdea

Please sign in to comment.