[Bioperl-l] Fw: perly suffix trees--
Chris Fields
cjfields at illinois.edu
Thu Jul 16 16:31:20 UTC 2009
I still like masak's perl6 simple oneliner for translating a simple
sequence:
my $dna = "ttaagg"; sub translate($dna) { "FFLLSSSSYY!!CC!
WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG".comb[map { :
4($_) }, $dna.trans("tcag" => "0123").comb(/.../)] }; say
translate($dna)
Scary, ain't it? It works quite well with rakudo. See the following
for the explanation:
http://use.perl.org/~masak/journal/39238
chris
On Jul 16, 2009, at 8:55 AM, Aaron Mackey wrote:
> Fair enough, thanks!
>
> FYI, I've used one of Ian Korf's other clever tricks in my own code
> before:
> using six different intron states (combined with 3 exon states that
> correspond to the previous intron's phase) in a gene-model HMM to
> ensure
> that spliced codons don't encode stop codons. I'm not aware of any
> other
> gene finder that implements that structure directly (my impression
> is that
> these cases are disallowed through some *post hoc* checking).
>
> -Aaron
>
> On Thu, Jul 16, 2009 at 8:48 AM, Mark A. Jensen <maj at fortinbras.us>
> wrote:
>
>> To the list with you, I have no secrets-- maybe Ian will chime in.
>> cheers,
>> MAJ
>> ----- Original Message -----
>> From: Aaron Mackey
>> To: Mark A. Jensen
>> Sent: Thursday, July 16, 2009 8:41 AM
>> Subject: Re: [Bioperl-l] perly suffix trees--
>>
>>
>> The code on that wiki page looks suspiciously incomplete. For
>> example, you
>> declare $i = 0 in readDictionary, then never use it again. It also
>> looks
>> like you only ever create entries for the entire word, and never any
>> suffices (which presumably was what the $i was going to be for, to
>> offset
>> into each word).
>>
>> Further, it looks like the readDictionary loop will clobber already-
>> seen
>> fragments by reassigning "1" (when they might already be the prefix
>> to some
>> other suffix). Perhaps the missing $i loop would reveal to me how
>> this
>> would be avoided.
>>
>> It also seems like testing for a hashref to equal 1 during the
>> search is
>> asking for type mismatch trouble; perhaps better to directly test
>> the ref()
>> status to determine rightmost/inner status? But that's just style,
>> not
>> substance.
>>
>> Best wishes,
>>
>> -Aaron
>>
>>
>> On Mon, Jul 13, 2009 at 10:15 PM, Mark A. Jensen <maj at fortinbras.us>
>> wrote:
>>
>> Hi All-
>> Russell sent me an almost magical Perl algorithm for creating a
>> suffix
>> tree
>> or something like one. It was cool enough to make a scrap out of it--
>> http://www.bioperl.org/wiki/Suffix_trees_from_thin_air
>> Have a look; might be diverting-
>> cheers
>> Mark
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>
>>
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
More information about the Bioperl-l
mailing list