Angharad has asked for the wisdom of the Perl Monks concerning the following question:
The lines starting with '>' are the headers and the series of letters and dashes underneath each header is the 'sequence' associated with that header. I would like to split this data so that the header is one element in the array and the sequence data underneath is in another so - for example>SEQ1 -----I--RL--AAIDVDG-NLT----------D--R--D-RL-ISTKA-IESIRS--A- -E-K--------K-GLT-VSL----LS------GN-V----I-PVV---YA-L------K IF---------------L-----GINGPVF------------------------------ >SEQ2 -MKI----KA--ISIDIDG-TIT------YPN-R-------MIHEK--A-LEAIRR--A- -E-S--------L-GIP-IML----VT------GN-T----V-QFA---EA-A------S IL---------------I-----G----TS-----------------GP-VV-------- >SEQ3 --KI----KA--ISIDIDG-TIT------YPN-R-------MIHEK--A-LEAIRR--A- -E-S--------L-GIP-IML----VT------GN-T----V-QFA---EA-A------S IL---------------I-----G----TS-----------------GP-VV-------- ---AE--D------GG---A---------------------------------------I
On first sight, it seems a fairly easy split operation, and I thought initially I could just split on new line, but I cant due to the sequence data occurring over several lines in the file. Any advise/thoughts on how I might be able to do this much appreciated. Thanks in advance.element[0] = >SEQ1 element[1] = -----I--RL--AAIDVDG-NLT----------D--R--D-RL-ISTKA-IESIRS- +-A- -E-K--------K-GLT-VSL----LS------GN-V----I-PVV---YA-L------K IF---------------L-----GINGPVF------------------------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: splitting data advice requested
by kennethk (Abbot) on May 13, 2009 at 14:44 UTC | |
by johngg (Canon) on May 13, 2009 at 15:45 UTC | |
|
Re: splitting data advice requested
by VinsWorldcom (Prior) on May 13, 2009 at 14:13 UTC | |
|
Re: splitting data advice requested
by bichonfrise74 (Vicar) on May 13, 2009 at 21:00 UTC | |
by oxone (Friar) on May 13, 2009 at 22:19 UTC | |
|
Re: splitting data advice requested
by Bloodnok (Vicar) on May 13, 2009 at 14:13 UTC |