code: def insert_size_stats(dists):
      
      med = numpy.median(dists)
      filter_dists = list(filter(lambda x: x < med + 10 * med, dists))
      median = numpy.median(filter_dists)
      return {"mean": float(numpy.mean(filter_dists)), "std": float(numpy.std(filter_dists)),
              "median": float(median),
              "mad": float(numpy.median([abs(x - median) for x in filter_dists]))}
docs: Calcualtes mean/median and MAD from distances, avoiding outliers.
  
      MAD is the Median Absolute Deviation: http://en.wikipedia.org/wiki/Median_absolute_deviation