def dispatch (bowtie_input, f21, r21, f25, r25):
  IN = open (bowtie_input)
  F21= open (f21, "w")
  R21= open (r21, "w")
  F25= open (f25, "w")
  R25= open (r25, "w")
  for line in IN:
    fields = line.split()
    read_header = fields[0]
    read_polarity = fields[1]
    read_sequence = fields[4]
    if "N" in read_sequence: continue
    read_size = len(read_sequence)
    if read_polarity == "+" and read_size == 25:
      seq = RNAtranslate (read_sequence)
      print >> F25, ">%s\n%s" % (read_header, seq)
    elif read_polarity == "-" and read_size == 25:
       seq = RNAtranslate (antipara(read_sequence))
       print >> R25, ">%s\n%s" % (read_header, seq)    
    elif read_polarity == "+" and read_size == 21:
      seq = RNAtranslate (read_sequence)
      print >> F21, ">%s\n%s" % (read_header, seq)
    elif read_polarity == "-" and read_size == 21:
       seq = RNAtranslate (antipara(read_sequence))
       print >> R21, (read_header, seq) % ">%s\n%s"
  IN.close()
  F21.close()
  R21.close()
  F25.close()
  R25.close()
  return
dataset/ETHPy150Open ARTbio/tools-artbio/unstable/local_tools/fasta_sorter.py/dispatch/swapped operands of `%`