Skip to content

Commit

Permalink
Fixed a bug that (in rare cases) mis-reported the number of dual-loca…
Browse files Browse the repository at this point in the history
…lized proteins for classes cTP/possible mTP and mTP/possible cTP. This happened when re-scanning of transit peptide interval for possible TP with all window sizes resulted in a window with higher probability than the main TP.
  • Loading branch information
JanaSperschneider committed May 16, 2017
1 parent 00a7c2a commit 488eee5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Scripts/LOCALIZER.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
printed60, printed70, printed80, printed90 = False, False, False, False

for i, (seq, full_seq, RESULTS_PATH, OPTION, WEKA_PATH, PEPSTATS_PATH, SCRIPT_PATH) in enumerate(input_list):
# The format is: NLS_motifs, bipart_motif, NLStradamus_result, result_chloro_mito
# The format is: NLS_motifs, bipart_motif, NLStradamus_result, result_chloro_mito
localizations.append(localization.predict_localization([seq, full_seq, RESULTS_PATH, OPTION, WEKA_PATH, PEPSTATS_PATH, SCRIPT_PATH]))
if float(len(input_list)) > 10.0:
if i/float(len(input_list)) > 0.10 and not printed10:
Expand Down
25 changes: 24 additions & 1 deletion Scripts/localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,11 @@ def pepstats_aas(WINDOW_IDS, WINDOW_SEQS, TMP_PATH, PEPSTATS_PATH):
charge = float(re.findall("[-+]?\d+.\d+", str(charge_line))[1])

isoelectric_line = content[start + 4:start + 5]
isoelectric = float(re.findall("\d+.\d+", str(isoelectric_line))[0])
# In rare cases the isoelectric point calculation returns 'None'
try:
isoelectric = float(re.findall("\d+.\d+", str(isoelectric_line))[0])
except:
isoelectric = 0.0

# Watch out, in the pepstats software, if isoelectric point == None, an
# extra line will be introduced
Expand Down Expand Up @@ -654,6 +658,25 @@ def predict_localization(input_data):
if result_mito[0][2] > result_mito_coordinates[2]:
result_mito_coordinates = [int(result_mito_coordinates[0] + result_mito[0][0]), int(result_mito_coordinates[0] + result_mito[0][1]), result_mito[0][2], result_mito[0][3]]
# -----------------------------------------------------------------------------------------------------------
# After re-scanning the intervals there could be the possibility that the dual
# localization has switched from e.g. cTP/possible mTP to mTP/possible cTP

if result_chloro_mito_coordinates and result_mito_coordinates:
# Check that the order is correct for cTP/possible mTP and change if necessary
if result_chloro_mito_coordinates[2] < result_mito_coordinates[2]:
# cTP becomes possible cTP
result_chloro_coordinates = [result_chloro_mito_coordinates[0], result_chloro_mito_coordinates[1], result_chloro_mito_coordinates[2], result_chloro_mito_coordinates[3]]
# possible mTP becomes mTP
result_chloro_mito_coordinates = [result_mito_coordinates[0], result_mito_coordinates[1], result_mito_coordinates[2], result_mito_coordinates[3]]

if result_chloro_mito_coordinates and result_chloro_coordinates:
# Check that the order is correct for mTP/possible cTP and change if necessary
if result_chloro_mito_coordinates[2] < result_chloro_coordinates[2]:
# mTP becomes possible mTP
result_mito_coordinates = [result_chloro_mito_coordinates[0], result_chloro_mito_coordinates[1], result_chloro_mito_coordinates[2], result_chloro_mito_coordinates[3]]
# possible cTP becomes cTP
result_chloro_mito_coordinates = [result_chloro_coordinates[0], result_chloro_coordinates[1], result_chloro_coordinates[2], result_chloro_coordinates[3]]
# -----------------------------------------------------------------------------------------------------------
# Search for bipartite NLS
bipart_motif = bipart_NLS(seq)
# Search for NLS
Expand Down

0 comments on commit 488eee5

Please sign in to comment.