# HG changeset patch # User galaxyp # Date 1505404486 14400 # Node ID a6341e7574221eb5b2085c98ebf25cbb41292a25 # Parent c093af6f2a6c003ac8e1a8c9ce035597690bee75 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/pi_db_tools commit decb06dc90d7069d317968b979f649a04720b264 diff -r c093af6f2a6c -r a6341e757422 __pycache__/peptide_pi_annotator.cpython-36.pyc Binary file __pycache__/peptide_pi_annotator.cpython-36.pyc has changed diff -r c093af6f2a6c -r a6341e757422 delta_pi_calc.xml --- a/delta_pi_calc.xml Fri Sep 01 03:14:37 2017 -0400 +++ b/delta_pi_calc.xml Thu Sep 14 11:54:46 2017 -0400 @@ -1,4 +1,4 @@ - + to peptide table python diff -r c093af6f2a6c -r a6341e757422 peptide_pi_annotator.py --- a/peptide_pi_annotator.py Fri Sep 01 03:14:37 2017 -0400 +++ b/peptide_pi_annotator.py Thu Sep 14 11:54:46 2017 -0400 @@ -43,10 +43,10 @@ fp.write('\n') -def get_first_matching_pattern(patterns, string): - for pattern in patterns: +def get_strip(strips, string): + for pattern in strips.keys(): if re.search(pattern, string): - return pattern + return strips[pattern] return False @@ -71,11 +71,6 @@ yield header + ['Experimental pI', 'Predicted pI', 'Delta pI'] for line in fp: line = line.strip('\n').split('\t') - strip = strips[get_first_matching_pattern(strips.keys(), - line[stripcol])] - exp_pi = (strip['fr_width'] * int(line[frac_col]) + - strip['intercept']) - sequence = line[seqcol] for weight in ignoremods: if weight == '*': @@ -90,12 +85,26 @@ not_predicted_count += 1 pred_pi, delta_pi = 'NA', 'NA' else: - delta_pi = exp_pi - pred_pi predicted_count += 1 + strip = get_strip(strips, line[stripcol]) + if not strip: + exp_pi, delta_pi = 'NA', 'NA' + else: + try: + exp_pi = (strip['fr_width'] * int(line[frac_col]) + + strip['intercept']) + except ValueError: + print('Cannot detect fraction for PSM {}'.format(sequence)) + exp_pi, delta_pi = 'NA', 'NA' + else: + if pred_pi != 'NA': + delta_pi = exp_pi - pred_pi + else: + delta_pi = 'NA' yield line + [exp_pi, pred_pi, delta_pi] print('Number of peptides without pI prediction: {}\n' - 'Number of peptides with predicion: {}\n'.format(not_predicted_count, - predicted_count)) + 'Number of peptides predicted: {}\n'.format(not_predicted_count, + predicted_count)) def parse_commandline(): diff -r c093af6f2a6c -r a6341e757422 pi_dbspec_align.xml --- a/pi_dbspec_align.xml Fri Sep 01 03:14:37 2017 -0400 +++ b/pi_dbspec_align.xml Thu Sep 14 11:54:46 2017 -0400 @@ -2,7 +2,7 @@ to resemble spectra fraction scheme python - biopython + biopython