Clean up downsample() and make it compatible with Python 3
Clean up downsample() and make it compatible with Python 3

lbeltrame/bcbio-nextgen,vladsaveliev/bcbio-nextgen,chapmanb/bcbio-nextgen,vladsaveliev/bcbio-nextgen,vladsaveliev/bcbio-nextgen,a113n/bcbio-nextgen,chapmanb/bcbio-nextgen,lbeltrame/bcbio-nextgen,lbeltrame/bcbio-nextgen,a113n/bcbio-nextgen,chapmanb/bcbio-nextgen,a113n/bcbio-nextgen