def calculate_signal_peptide_features_table(all_scale_tables, all_sequences): result = [] for item in all_sequences: line = [] accession = item[0] signal_seq = item[1] rest_seq = item[2] line.append(accession) line.append(signal_seq) line.append(rest_seq) for scale in all_scale_tables: table = all_scale_tables[scale] scale_signal_seq = calc_scale(signal_seq, table) scale_rest_seq = calc_scale(rest_seq, table) line.append(scale_signal_seq) line.append(scale_rest_seq) result.append(line) del line return result
def calc_min_max_scale_value(sequence,table): min_window_size = 9 min_scale_signal_seq = 10000 max_scale_signal_seq = -10000 if (len(sequence)<=min_window_size): return 0,0 for window_size in range(min_window_size, len(sequence)+1): for window_start in range(0,len(sequence)+1-window_size): window_end = window_start + window_size seq = sequence[window_start:window_end] value = calc_scale(seq, table) if (value > max_scale_signal_seq): max_scale_signal_seq = value if (value < min_scale_signal_seq): min_scale_signal_seq = value return min_scale_signal_seq,max_scale_signal_seq