[Bioperl-l] Reverse Comp Coding Puzzler
Jamie Hatfield (AGCoL)
jamie@genome.arizona.edu
Mon Jan 13 17:11:09 EST 2003
See if this works. Obviously, replace $prot with your protein sequence.
========================
#!/usr/local/bin/perl -w
use Bio::Tools::CodonTable;
use strict;
my $codTable = Bio::Tools::CodonTable->new();
my $prot = "MPVARDI";
my @allPossible = ("");
foreach my $aa (split(//, $prot)) {
## translate the current aa into its possible codons
my @codons = $codTable->revtranslate($aa);
my @temp;
## take each of the possible coding sequences so far
## and append the current possible codons onto it, creating a new
possible
## coding sequence.
while (@allPossible) {
my $rev = pop @allPossible;
foreach my $cod (@codons) {
push @temp, $rev . $cod;
}
}
@allPossible = @temp;
}
print "$prot translates to:\n";
foreach $prot (@allPossible) {
print "$prot\n";
}
===================================
----------------------------------------------------------------------
Jamie Hatfield Room 541H, Marley Building
Systems Programmer University of Arizona
Arizona Genomics Computational Tucson, AZ 85721
Laboratory (AGCoL) (520) 626-9598
-----Original Message-----
From: bioperl-l-admin@bioperl.org [mailto:bioperl-l-admin@bioperl.org]
On Behalf Of David Nix
Sent: Monday, January 13, 2003 9:37 AM
To: bioperl-l@bioperl.org
Subject: [Bioperl-l] Reverse Comp Coding Puzzler
Hello Folks,
I'm working on a perl program that identifies all restriction sites
that
can be inserted or deleted from an oligo used for site directed
mutagenesis
without changing the encoded amino acid sequence. One problem that I
need
to overcome is how to get all unique oligo permutations of a 7 amino
acid
peptide, preferably one at a time. These will be restriction mapped,
compared to the original sequence one is mutating, and any differences
ranked and returned to the user.
At first pass this seems like it should be easy, I can do it with pencil
and
paper, but getting it into a perl script is proving challenging for my
novice programming skills. Any suggestions or pointers you would have
would
be greatly appreciated!
Here's an example:
Take a peptide like...
M P V A R D I
Each amino acid is encoded by the following (I've got them in arrays)...
my @M = qw(ATG);
my @P = qw(CCA CCC CCG CCT);
my @V = qw(GTA GTC GTG GTT);
my @A = qw(GCA GCC GCG GCT);
my @R = qw(CGA CGC CGG CGT AGA AGG);
my @D = qw(GAC GAT);
my @I = qw(ATA ATC ATT);
A few oligo permutation would be...
$oligo1 = $M[0] . $P[0] . $V[0] . $A[0] . $R[0] . $D[0] . $I[0];
$oligo2 = $M[0] . $P[0] . $V[0] . $A[0] . $R[0] . $D[0] . $I[1];
$oligo3 = $M[0] . $P[0] . $V[0] . $A[0] . $R[0] . $D[0] . $I[2];
Now how would one write a script that gets at all the other 2301
permutations (1 x 4 x 4 x 4 x 6 x 2 x 3)! Ugg! I've been at this for a
day
without much luck! Suggestions?
Cheers,
Dave
--
David Austin Nix, PhD
University of California, Berkeley
Department of Molecular and Cell Biology
371 LSA #3200
Berkeley, CA 94720-3200
510-642-6799 (lab)
510-643-0062 (fax)
Nix@uclink.berkeley.edu
_______________________________________________
Bioperl-l mailing list
Bioperl-l@bioperl.org
http://bioperl.org/mailman/listinfo/bioperl-l
More information about the Bioperl-l
mailing list