Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
>name_of_protein sequence_of_proteinNow, tha thing is that the same protein might appear more than once, say you have:
>protein1 ASFGTHTRHTHRHTHTRHTRHTR >protein2 ERYRYTRYHTRHTGEFEWWFEEFFFFREFRGRE >protein3 AWEERERGRGRGREGRGREGRRRRRRRRTTHTHTRHRHTRHTR >protein2 AASEFEFEFE >protein4 >REYTRHTRGRVEVCREVRWhat I need to do is: Read the file, when you see a protein (e.g protein1), store the length of the sequence(the line below) and then, scan through the rest of the document and, if you find the same protein name, compare the length of the sequence you found previously with the one you found later and store the initial protein name along with the sequence which has the biggest length.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: select strings with biggest length
by davido (Cardinal) on Nov 19, 2006 at 17:37 UTC | |
|
Re: select strings with biggest length
by grep (Monsignor) on Nov 19, 2006 at 17:52 UTC | |
|
Re: select strings with biggest length
by johngg (Canon) on Nov 19, 2006 at 18:26 UTC | |
|
Re: select strings with biggest length
by ambrus (Abbot) on Nov 19, 2006 at 18:04 UTC | |
|
Re: select strings with biggest length
by talexb (Chancellor) on Nov 19, 2006 at 17:20 UTC |