Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorreiter committed Feb 23, 2024
1 parent c855897 commit e5f1476
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/run_nlpprecursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# This allows for backwards compatibility of the pickled models.
sys.modules["protai"] = nlpprecursor


def robust_predict(predict_function, *args, max_attempts=2, sleep_time=1):
"""
Attempts to call the predict function up to a maximum number of attempts.
Expand Down Expand Up @@ -49,7 +50,7 @@ def robust_predict(predict_function, *args, max_attempts=2, sleep_time=1):
def predict_ripp_sequences(models_dir, input_fasta):
"""
Uses NLPPrecursor to predict the class and cleavage sites of sequences from an input FASTA file,
filtering out sequences classified as "NONRIPP".
filtering out sequences classified as "NONRIPP".
Parameters:
- models_dir (str): The directory path where the model files are stored. Available for download
Expand Down Expand Up @@ -163,6 +164,7 @@ def extract_ripp_sequences(filtered_predictions, output_tsv, output_fasta):

SeqIO.write(fasta_records, output_fasta, "fasta")


def main(models_dir, input_fasta, output_tsv, output_fasta):
filtered_predictions = predict_ripp_sequences(models_dir, input_fasta)
extract_ripp_sequences(filtered_predictions, output_tsv, output_fasta)
Expand Down

0 comments on commit e5f1476

Please sign in to comment.