# HG changeset patch # User bornea # Date 1463668515 14400 # Node ID 8102ffab0f8591e693829f17b71baf401484cb6b # Parent e414a55b4c42fb2297558afe7ca0c7927e804ae8 Uploaded diff -r e414a55b4c42 -r 8102ffab0f85 SAINT_preprocessing_mq_pep.py --- a/SAINT_preprocessing_mq_pep.py Thu May 19 10:29:44 2016 -0400 +++ b/SAINT_preprocessing_mq_pep.py Thu May 19 10:35:15 2016 -0400 @@ -251,6 +251,7 @@ bait_index.append(header.index(bait_item[0])) proteins = read_MaxQuant(MaxQuant_input).proteins errors = [] + valid_prots = [] for e in err: errors.append(e[0]) for a in proteins: @@ -260,18 +261,18 @@ # Ditto for \r. seq = get_info(a).seqlength GN = get_info(a).genename - if seq == 'NA': - if GN == 'NA': - errors.append(a) + if seq != 'NA': + if GN != 'NA': + valid_prots.append(a) with open('inter.txt', 'w') as input_file: l = 0; a = 0 for bb in bait: for lst in data: - if proteins[a] not in errors: + if valid_prots[a] not in errors: input_file.write(header[bait_index[l]] + '\t' + bb[1] + '\t' + proteins[a] + '\t' + lst[bait_index[l]] + '\n') a += 1 - if a == len(proteins): + if a == len(valid_prots): l += 1; a = 0