Renyulb28 has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks, the dilemma that we are having right now is with figuring out how to merge every two columns within the data file. The file is as follows; first column is the ID, and every column after that is a marker, except two markers make a whole, so that is what we want. These are space delimited. The colleague who knows python only suggested a long difficult method of writing out each combination (ie 1+2, 3+4, etc.) and with R it is even more problematic.
3851 A A G G T T ... 3854 A A G G T T ...
The output for the above example would look like this:
3851 AA GG TT ... 3854 AA GG TT ...
Is there a simple Perl script available for this task?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Loop to merge every two columns
by wind (Priest) on May 11, 2011 at 20:30 UTC | |
by JavaFan (Canon) on May 12, 2011 at 09:33 UTC | |
by wind (Priest) on May 20, 2011 at 01:45 UTC | |
by JavaFan (Canon) on May 20, 2011 at 11:14 UTC | |
by Tanktalus (Canon) on May 20, 2011 at 21:00 UTC | |
| |
by stvn (Monsignor) on May 21, 2011 at 01:31 UTC | |
by wind (Priest) on May 20, 2011 at 17:47 UTC | |
Re: Loop to merge every two columns
by LanX (Saint) on May 11, 2011 at 20:33 UTC | |
Re: Loop to merge every two columns
by johngg (Canon) on May 11, 2011 at 22:57 UTC |