Help for this page

Select Code to Download


  1. or download this
    sub merge {
      my ($pre,$cur,$nex, $mindist) = @_;
    ...
      my $decicion_to_merge = ...
      if( $decicion_to_merge == 1 ){ ... merge the intervals ... }
    }
    
  2. or download this
    sub     get_sorted_intervals_as_array {
            my $atree = shift;
    ...
            );
            return @ret
    }
    
  3. or download this
    my @ints = get_sorted_intervals_as_array($tree);
    for($i=1;$i<scalar(@ints)-1;$i++){
    ...
       $nex = $ints[$i+1];
       merge($pre, $cur, $nex, 1234); # 1234 user-specified distance
    }
    
  4. or download this
    my %Interval  = (
       'chromosome' => 'Chr1',
    ...
       'type' => 'A',
       'id' => 1
    );
    
  5. or download this
    sub can_merge {
      my ($i1, $i2) = @_;
    ...
      ...
      return $newi # return the new interval representing the merge
    }