in reply to Sliding window perl program
But if file 1 has several lines, then you need to explain how to do the match between the two files.
From looking at your data, maybe you want this: for each line in file 1, check the ID (e.g. chr11) in the second field, pick up the pivot value in the 4th field (650), and grab in file 2 all lines whose ID is chr11 and whose second field is within the range (650-500..650+500).
If this is what you want, I suggest that you should read the full file 1 and store ID/4th field of each line in a hash. Close File 1. Read file 2, for each line in file 2, check the ID, lookup the pivot value for this ID in the hash, and check if field 2 falls within the range.
|
|---|