def whichSide( snp, interval ) : ichrom,ileft,iright = interval[0],interval[1],interval[2] diff = globes.sortableChrom( snp.chrom ) - \ globes.sortableChrom( ichrom ) if diff < 0 : return -1 elif diff == 0 : if ileft <= snp.genomicLoc <= iright : return 0 elif snp.genomicLoc < ileft : return -1 else : return 1 else : return 1
def sortHelper( interval ) : return ( globes.sortableChrom( interval[0] ), interval[1], interval[2] )