On Thu, 14 Oct 2004 16:08:44 -0400, Willy West <[EMAIL PROTECTED]> wrote:
> On Thu, 14 Oct 2004 14:47:57 -0500, Errin Larsen <[EMAIL PROTECTED]> wrote:
> >
> 
> > > bio-informatics is a big area in which Perl is involved...   there's even
> > > a book from O'reilly on the subject...
> 
> > If what you say is true, then maybe Mike needs to take his questions
> > to those list?  I mean, if the problem he's describing is common and
> > the data format he's using is common, I bet it's been solved already.
> >
> > Hey mike, have you searched on CPAN (search.cpan.org) for this?
> >
> 
> that might be fine- but his question is fundamentally Perl in nature-
> he may use the information for bio-informatics, but he is looking for
> an answer regarding effective Perl use when dealing with strings-
> that's classic Perl and a classic question for this list :)
> 
> i wish i could answer his question right off the bat, but i can't :/
> 
> awell...
> 

very true.  I've been playin' with this problem, it seems very
fun/interesting.  I was thinking this would be alot easier to play
with if the characters in the string were all in an array.  so I
played with the length() function and the substr() function to push
them all into an array in a loop.  something like this (prolly a
prettier/easier way to do this):

use Data::Dumper;

my $human = "acgtt---cgatacg---acgact-----t";
my @human;

for my $pos( 0 .. (length($human) -1)) {
    push @human, substr($human, $pos, 1);
}

print Dumper([EMAIL PROTECTED];

The above produces the following output, which I was thinking might be
easier to work with for Mike's problem:

$VAR1 = [
          'a',
          'c',
          'g',
          't',
          't',
          '-',
          '-',
          '-',
          'c',
          'g',
          'a',
          't',
          'a',
          'c',
          'g',
          '-',
          '-',
          '-',
          'a',
          'c',
          'g',
          'a',
          'c',
          't',
          '-',
          '-',
          '-',
          '-',
          '-',
          't'
        ];

This is kinda fun!

--Errin

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to