Skip to content

Commit e0158a5

Browse files
mark0428mark0428
authored andcommitted
fix a bug in valid sequence ordering
1 parent 78ccf3f commit e0158a5

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
AMPlify is an attentive deep learning model for antimicrobial peptide prediction.
44

5-
For more information, please refer to the preprint: https://www.biorxiv.org/content/10.1101/2020.06.16.155705v1
6-
75
### Dependencies
86

97
* Python 3.6
@@ -100,3 +98,9 @@ Chenkai Li (cli@bcgsc.ca)
10098
### Contact
10199

102100
If you have any questions, comments, or would like to report a bug, please file a Github issue or contact us.
101+
102+
### Citation
103+
104+
If you use AMPlify in your work, please cite [our publication](https://bmcgenomics.biomedcentral.com/articles/10.1186/s12864-022-08310-4):
105+
> Li, C., Sutherland, D., Hammond, S.A. et al. AMPlify: attentive deep learning model for discovery of novel antimicrobial peptides effective against WHO priority pathogens. BMC Genomics 23, 77 (2022). https://doi.org/10.1186/s12864-022-08310-4
106+
--------------------------------------------------------------------------------

src/AMPlify.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ def main():
212212
y_class = []
213213
y_length = []
214214
y_charge = []
215+
215216
# get attention scores for each sequence
216217
if args.attention == 'on':
217218
attention_valid = get_attention_scores(y_indv_list_valid, att_model, peptide_valid, X_seq_valid)
@@ -227,27 +228,25 @@ def main():
227228
else:
228229
y_log_score.append(round(-10*np.log10(1-0.99999999), 4))
229230
y_class.append(y_class_valid[ix])
231+
y_length.append(len(peptide[i]))
232+
y_charge.append(peptide[i].count('K') + peptide[i].count('R') - peptide[i].count('D') - peptide[i].count('E'))
230233
if args.attention == 'on':
231234
attention.append(list(attention_valid[ix]))
232-
233-
# calculate charge
234-
y_charge.append(peptide[ix].count('K') + peptide[ix].count('R') - peptide[ix].count('D') - peptide[ix].count('E'))
235-
# calculate length
236-
y_length.append(len(peptide[ix]))
237235
ix = ix + 1
238236
else:
239237
y_score.append('NA')
240238
y_log_score.append('NA')
241239
y_class.append('NA')
240+
y_length.append('NA')
241+
y_charge.append('NA')
242242
if args.attention == 'on':
243243
attention.append('NA')
244-
y_charge.append('NA')
245-
y_length.append('NA')
244+
246245
# output the predictions
247246
out_txt = ''
248247
for i in range(len(seq_id)):
249248
temp_txt = 'Sequence ID: '+seq_id[i]+'\n'+'Sequence: '+peptide[i]+'\n' \
250-
+ 'Length: ' + str(y_length[i]) + '\n' + 'Charge: ' + str(y_charge[i]) + '\n' \
249+
+'Length: '+str(y_length[i])+'\n'+'Charge: '+str(y_charge[i])+'\n' \
251250
+'Probability_score: '+str(y_score[i])+'\n'+'AMPlify_log_scaled_score: ' \
252251
+str(y_log_score[i])+'\n'+'Prediction: '+y_class[i]+'\n'
253252
if args.attention == 'on':

0 commit comments

Comments
 (0)