def sort_peaks_by_tss_distances(feature, peaks): """ Sort peaks by edge-to-TSS distances to a feature Arguments: feature (Feature): feature instance peaks (PeakSet): set of peaks that will be sorted into order according to the smallest distance of their edges from the TSS position of the feature. The sorting is done in place. """ peaks.peaks = sorted(peaks.peaks, key=lambda p: distances.tss_distances(p, feature))
def sort_features_by_tss_distances(peak, features): """ Sort features by TSS-to-edge distances to a peak Arguments: peak (Peak): peak instance features (FeatureSet): set of features that will be sorted into order according to the smallest distance of their TSS positions to the edges of the peak. The sorting is done in place. """ features.features = sorted(features.features, key=lambda f: distances.tss_distances(peak, f))
def sort_peaks_by_tss_distances(feature,peaks): """ Sort peaks by edge-to-TSS distances to a feature Arguments: feature (Feature): feature instance peaks (PeakSet): set of peaks that will be sorted into order according to the smallest distance of their edges from the TSS position of the feature. The sorting is done in place. """ peaks.peaks = sorted(peaks.peaks, key = lambda p: distances.tss_distances(p,feature))
def sort_features_by_tss_distances(peak,features): """ Sort features by TSS-to-edge distances to a peak Arguments: peak (Peak): peak instance features (FeatureSet): set of features that will be sorted into order according to the smallest distance of their TSS positions to the edges of the peak. The sorting is done in place. """ features.features = sorted(features.features, key = lambda f: distances.tss_distances(peak,f))