in reply to Human genome array

  1. Read in a line
  2. Split it into characters
  3. put the characters into an array
  4. push a ref to that array into the main array.
  5. Repeat until done, or out of resources.

Also, try it yourself first, don't ask us to do your work for you unless you're willing to let us cash your paycheck for you too.

Replies are listed 'Best First'.
Re^2: Human genome array
by uvnew (Acolyte) on Jul 19, 2011 at 15:58 UTC
    Thank you for your reply. I have attempted to do it myself for several hours and asking in this forum is a result of my lack of success to solve the problem. My broken code wouldn't help to make anything clearer. Thanks anyway.
      Post your code anyway! We can probably tell how you're trying to do things and what your incorrect assumptions are. You give a little, we give a lot back.
        Fair enough. Here's my main code so far:
        while (<FILE1>) { if ($_ =~ />/) #Header { if ($chr_num > 0) { my @str = split(undef,$temp_str); push (@genome,@str); } $chr_num++; print $chr_num . "\n"; $temp_str = ""; } else { my $temp = chomp($_); $temp_str = $temp_str . $temp; } }
        I think that I have a problem of line endings or input formatting because I have warnings for unitialized values in: my @str = split(undef,$temp_str)

      I have attempted to figure out what is wrong with your code for several minutes, and am posting to inform you of my lack of success. My crystal ball couldn't help to make anything clearer.

      On the bright side, the magic 8-ball did recommend that you should try adding use strict; use warnings; at the top of the script.

        That's great, thank you so much.