Syntactic Confectionery Delight | |
PerlMonks |
Loop through file to create interval treeby pinha (Initiate) |
on May 23, 2014 at 14:31 UTC ( [id://1087218]=perlquestion: print w/replies, xml ) | Need Help?? |
pinha has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I have a series of tables with the following interval information:
I want to find overlaps between the intervals of the IDs. Do different IDs have overlapping intervals? If so, what is the overlap and where? I realise that the best way to approach my problem is to use an interval tree. I have been trying to use the module Set::IntervalTree but I am stuck. Basically I am not sure how to loop through my file columns to fill the interval tree. This is what I have so far:
I now want to use each one of the $low, $high and $ID to fill in the tree. I would like to be able to loop through the file automatically. I have lots of files with lots of lines and so entering the values manually is not a good option To sum up, I would love if someone could help me understand how I loop through the lines of my $fh so that I can fill in the interval tree according to the following requirement: $tree->insert($ID, $low, $high) for each one of the lines. Thank you so much in advance!
Back to
Seekers of Perl Wisdom
|
|