Skip to content

Commit

Permalink
fix a bug in valid sequence ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
mark0428 authored and mark0428 committed Jan 29, 2022
1 parent 78ccf3f commit e0158a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

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

For more information, please refer to the preprint: https://www.biorxiv.org/content/10.1101/2020.06.16.155705v1

### Dependencies

* Python 3.6
Expand Down Expand Up @@ -100,3 +98,9 @@ Chenkai Li ([email protected])
### Contact

If you have any questions, comments, or would like to report a bug, please file a Github issue or contact us.

### Citation

If you use AMPlify in your work, please cite [our publication](https://bmcgenomics.biomedcentral.com/articles/10.1186/s12864-022-08310-4):
> 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
--------------------------------------------------------------------------------
15 changes: 7 additions & 8 deletions src/AMPlify.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ def main():
y_class = []
y_length = []
y_charge = []

# get attention scores for each sequence
if args.attention == 'on':
attention_valid = get_attention_scores(y_indv_list_valid, att_model, peptide_valid, X_seq_valid)
Expand All @@ -227,27 +228,25 @@ def main():
else:
y_log_score.append(round(-10*np.log10(1-0.99999999), 4))
y_class.append(y_class_valid[ix])
y_length.append(len(peptide[i]))
y_charge.append(peptide[i].count('K') + peptide[i].count('R') - peptide[i].count('D') - peptide[i].count('E'))
if args.attention == 'on':
attention.append(list(attention_valid[ix]))

# calculate charge
y_charge.append(peptide[ix].count('K') + peptide[ix].count('R') - peptide[ix].count('D') - peptide[ix].count('E'))
# calculate length
y_length.append(len(peptide[ix]))
ix = ix + 1
else:
y_score.append('NA')
y_log_score.append('NA')
y_class.append('NA')
y_length.append('NA')
y_charge.append('NA')
if args.attention == 'on':
attention.append('NA')
y_charge.append('NA')
y_length.append('NA')

# output the predictions
out_txt = ''
for i in range(len(seq_id)):
temp_txt = 'Sequence ID: '+seq_id[i]+'\n'+'Sequence: '+peptide[i]+'\n' \
+ 'Length: ' + str(y_length[i]) + '\n' + 'Charge: ' + str(y_charge[i]) + '\n' \
+'Length: '+str(y_length[i])+'\n'+'Charge: '+str(y_charge[i])+'\n' \
+'Probability_score: '+str(y_score[i])+'\n'+'AMPlify_log_scaled_score: ' \
+str(y_log_score[i])+'\n'+'Prediction: '+y_class[i]+'\n'
if args.attention == 'on':
Expand Down

0 comments on commit e0158a5

Please sign in to comment.