<commit_before>import helpers

def annotate_signalp4(params, proteins):
  for seqid in proteins:
    proteins[seqid]['is_signalp'] = False
    proteins[seqid]['signalp_cleave_position'] = None

  signalp4_out = 'signalp.out'
  cmd = '%(signalp4_bin)s -t %(signalp4_organism)s  %(fasta)s' % \
             params
  helpers.run(cmd, signalp4_out)

  for line in open(signalp4_out):
    if line.startswith("#"):
      continue
    words = line.split()
    seqid = helpers.parse_fasta_header(">"+words[0])[0]
    if (words[9] == "Y"):
      proteins[seqid]['is_signalp'] = True
      proteins[seqid]['signalp_cleave_position'] = int(words[4])

  return proteins
    <commit_msg>Always annotate predicted signalp cleavage site even if no overall signal peptide predicted.<commit_after>import helpers

def annotate_signalp4(params, proteins):
  for seqid in proteins:
    proteins[seqid]['is_signalp'] = False
    proteins[seqid]['signalp_cleave_position'] = None

  signalp4_out = 'signalp.out'
  cmd = '%(signalp4_bin)s -t %(signalp4_organism)s  %(fasta)s' % \
             params
  helpers.run(cmd, signalp4_out)

  for line in open(signalp4_out):
    if line.startswith("#"):
      continue
    words = line.split()
    seqid = helpers.parse_fasta_header(">"+words[0])[0]
    proteins[seqid]['signalp_cleave_position'] = int(words[4])
    if (words[9] == "Y"):
      proteins[seqid]['is_signalp'] = True
      #proteins[seqid]['signalp_cleave_position'] = int(words[4])

  return proteins
    
{'fraction_non_alphanumeric': 0.14017437961099932, 'fraction_numerical': 0.014084507042253521, 'mean_word_length': 4.057627118644068, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2838762', 'n_tokens_mistral': 553, 'n_tokens_neox': 534, 'n_words': 100}