generate_states_path fix start_pos
@@ -360,13 +360,20 @@ def generate_states_path( candidate_bins, predicted_proba, binsize, i_open_regio
label_prev = labels_list[ np.argmax(proba_prev) ]
proba_curr = np.array([ predicted_proba[l][ i_open_region ], predicted_proba[l][ i_nucleosomal_region ], predicted_proba[l][ i_background_region ] ])
label_curr = labels_list[ np.argmax(proba_curr) ]
+ if candidate_bins[l-1][0] == candidate_bins[l][0]: #if we are looking at the same chromosome ...
if label_prev != label_curr:
end_pos = candidate_bins[l-1][1]
ret_states_path.append( (candidate_bins[l][0].decode(), start_pos, end_pos, label_prev) )
start_pos = candidate_bins[l][1]-binsize
+
elif l == len(predicted_proba)-1:
end_pos = candidate_bins[l][1]
ret_states_path.append( (candidate_bins[l][0].decode(), start_pos, end_pos, label_prev) )
+ else:
+ start_pos = candidate_bins[l][1]-binsize
+
+
+
return ret_states_path
def save_accessible_regions( states_path, accessible_region_file ):
