How can I sort two arrays of coordinates in numerical order by the start coordinates e.g.
my @starts = (100,100,200,300,400,500,525);
my @ends = (150,125,250,350,450,550,550);
but choose the biggest difference if there are two matching in either the starts or ends list? E.g.
my @uniq_starts = (100,200,300,400,500);
my @unique_ends = (150,250,350,450,550);
Any help greatly appreciated!
Also, how about if the lists are like this?
my @starts = (100,125,200,300,400,500,525);
my @ends = (150,175,250,350,450,550,550);
This would give me the following for the in between values:
-25, 25, 50, 50, 50, -25
I would need the following output:
my @uniq_starts = (100,200,300,400,500);
my @unique_ends = (175,250,350,450,550);
So my in between values are:
25, 50, 50, 50
I can get around this by just removing and ignoring any negative values, as I can imagine this would make things much more complicated.