docs: def needle_statistics(infile):
      """Reads in a needle alignment file and spits out statistics of the alignment.
  
      Args:
          infile (str): Alignment file name
  
      Returns:
          dict: alignment_properties - a dictionary telling you the number of gaps, identity, etc.
  
      """
  
      alignments = list(AlignIO.parse(infile, "emboss"))
      alignment_properties = defaultdict(dict)
  
      with open(infile) as f:
          line = f.readline()
  
          for i in range(len(alignments)):
              while line.rstrip() != "#=======================================":
                  line = f.readline()
                  if not line:
                      raise StopIteration
  
              while line[0] == "#":
                  # Read in the rest of this alignment header,
                  # try and discover the number of records expected and their length
                  parts = line[1:].split(":", 1)
                  key = parts[0].lower().strip()
                  if key == '1':
                      a_id = parts[1].strip()
                  if key == '2':
                      b_id = parts[1].strip()
                  if key == 'identity':
                      ident_parse = parts[1].strip().replace('(','').replace(')','').replace('%','').split()
                      ident_num = int(ident_parse[0].split('/')[0])
                      ident_percent = float(ident_parse[1])
                      alignment_properties[a_id + '_' + b_id]['identity'] = ident_num
                      alignment_properties[a_id + '_' + b_id]['percent_identity'] = ident_percent
                  if key == 'similarity':
                      sim_parse = parts[1].strip().replace('(','').replace(')','').replace('%','').split()
                      sim_num = int(sim_parse[0].split('/')[0])
                      sim_percent = float(sim_parse[1])
                      alignment_properties[a_id + '_' + b_id]['similarity'] = sim_num
                      alignment_properties[a_id + '_' + b_id]['percent_similarity'] = sim_percent
                  if key == 'gaps':
                      gap_parse = parts[1].strip().replace('(','').replace(')','').replace('%','').split()
                      gap_num = int(gap_parse[0].split('/')[0])
                      gap_percent = float(gap_parse[1])
                      alignment_properties[a_id + '_' + b_id]['gaps'] = gap_num
                      alignment_properties[a_id + '_' + b_id]['percent_gaps'] = gap_percent
                  if key == 'score':
                      score = float(parts[1].strip())
                      alignment_properties[a_id + '_' + b_id]['score'] = score
  
                  # And read in another line...
                  line = f.readline()
  
      return alignment_properties