text: #!/usr/bin/env python
  
  """Create edges and nodes from a list of sequences that are a given hamming distance apart"""
  import numpy
  from plot import conv as pconv
  from plot import bar
  from general_seq import seq_IO
  import argparse 
  
  def main(sequences_ratio_file):
  
      sequences_ratio = seq_IO.read_sequences(sequences_ratio_file, additional_params=True)
  
      seq_ratio_dict = [ [l[1],l[2],l[3]] for l in (sequences_ratio) ]
      seq_cleaved_dict = [ l[4] for l in sequences_ratio ]
      seqs = [ l[0] for l in sequences_ratio ]
      
      avg_ratio = [ sum(v)/3.0 for v in seq_ratio_dict]
      min_ratio = [ sum(v)/3.0 - min(v) for v in seq_ratio_dict]
      max_ratio = [ max(v)-sum(v)/3.0 for v in seq_ratio_dict]
  
      fig, axarr = pconv.create_ax(1, 1, shx=True, shy=True)
      bar.draw_actual_plot(axarr[0,0], avg_ratio, 'c', "", "Sequence", "FLAG/HA Ratio", tick_label=seqs, yerr = [min_ratio, max_ratio] ) 
      pconv.save_fig(fig, sequences_ratio_file, "plot", 4, 4, tight=True, size=12)
  
  
  if __name__ == "__main__":
  
      parser = argparse.ArgumentParser(description=__doc__)
  
      parser.add_argument ('--epistasis_file', help="text file which contains epistasis data (as generated by EpistasisAllSeqs)")
  
      args = parser.parse_args()
  
      main(args.epistasis_file)
  