BhariD has asked for the wisdom of the Perl Monks concerning the following question:
I have the following data file
string length start end count ACNGYNDHNG 10 1333 1343 1152 AVDVHVHNGG 10 209 219 2916 ACNGYNDHNGARRT 14 1333 1347 4608 GNDNNVNNRHNNNNVMNNVNNT 22 1589 1611 6291456
I want to pair them based on the values in the second (start) and third column (end). The pairing is true if the difference between end of one string and start value of the other string is greater than 300. if not no pairing occurs.
so for above data, this is what I am trying to get to:
Pair1: AVDVHVHNGG 10 209 219 2916 ACNGYNDHNG 10 1333 1343 1152 Distance: 1114 Pair2: AVDVHVHNGG 10 209 219 2916 ACNGYNDHNGARRT 14 1333 1347 4608 Distance: 1114 Pair3: AVDVHVHNGG 10 209 219 2916 GNDNNVNNRHNNNNVMNNVNNT 22 1589 1611 6291456 Distance: 1370
can anyone please help me start on this
Thanks!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to pair strings based on positional differences
by almut (Canon) on Mar 26, 2010 at 20:02 UTC | |
|
Re: how to pair strings based on positional differences
by keszler (Priest) on Mar 26, 2010 at 20:12 UTC |