Istirion has asked for the wisdom of the Perl Monks concerning the following question:
I have a programming problem which I can't solve on my own and therefor Id like to ask for your help.
Earlier in the programm I read a complete inputfile via <STDIN>, process and split it in pieces and get something like a really big array of strings. Each string is a part of DNA, so it looks like "ATCGCAT..." (very long!). I can join the complete array into one string for further analysis of the DNA. But I also would like to do this:
1) Check every item of the array, starting with [0] if it passes an easy test (here: I just want to see, if the string of bases can be divided by 3 and therefor has the correct number for further analysis and transformation into aminoacids)
2) Join all strings in the array which passed the test into one big string (>6 mio. characters), letting out those which didn't pass (wrong number of bases).
3) Send some info to a logfile, which says something like this "Found x blocks (x = number of elemens in the array = $#array), joined y of them and left out z." The leftout parts should follow, like
Not used blocks# 1200 1500 5000 ...
I think it could be really easily solved, but right now I don't see the solution... :-(
Thank you very much for your help!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Analyse an array and join only some elements of it
by moritz (Cardinal) on Jun 15, 2012 at 13:11 UTC | |
by tobyink (Canon) on Jun 15, 2012 at 13:52 UTC | |
|
Re: Analyse an array and join only some elements of it
by jwkrahn (Abbot) on Jun 15, 2012 at 14:30 UTC | |
|
Re: Analyse an array and join only some elements of it
by AnomalousMonk (Archbishop) on Jun 15, 2012 at 17:56 UTC | |
|
Re: Analyse an array and join only some elements of it
by Cristoforo (Curate) on Jun 16, 2012 at 15:54 UTC | |
by Istirion (Initiate) on Jun 18, 2012 at 16:02 UTC |