|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
Re: concatenating identical sequencesby Limbic~Region (Chancellor) |
| on Oct 04, 2011 at 15:51 UTC ( #929585=note: print w/ replies, xml ) | Need Help?? |
|
$new_guy,
Alternatively, if you can't afford to fit the entire file in memory, you could still use this technique by storing the file offset and not the actual sequence. This will require more IO with tell and seek but should allow the same simplicity in the code. One last alternative would be to re-write the file merging all the rows for a record on one line. Next, sort the file so duplicate IDs are adjacent and then it should be straight forward to merge them. Since it appears each row is fixed length, recreating the original structure from a single line should be straight forward. Cheers - L~R
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||