docs: def write_phosphopath_ratio(df, f, a, *args, **kwargs):
      """
      Write out the data frame ratio between two groups
      protein-Rsite-multiplicity-timepoint
      ID	Ratio
      Q13619-S10-1-1	0.5
      Q9H3Z4-S10-1-1	0.502
      Q6GQQ9-S100-1-1	0.504
      Q86YP4-S100-1-1	0.506
      Q9H307-S100-1-1	0.508
      Q8NEY1-S1000-1-1	0.51
      Q13541-S101-1-1	0.512
      O95785-S1012-2-1	0.514
      O95785-S1017-2-1	0.516
      Q9Y4G8-S1022-1-1	0.518
      P35658-S1023-1-1	0.52
  
      Provide a dataframe, filename for output and a control selector. A series of
       selectors following this will be compared (ratio mean) to the first. If you
       provide a kwargs timepoint_idx the timepoint information from your selection will
       be added from the selector index, e.g. timepoint_idx=1 will use the first level
       of the selector as timepoint information, so ("Control", 30) would give timepoint 30.
  
      :param df:
      :param a:
      :param *args
      :param **kwargs: use timepoint= to define column index for timepoint information, extracted from args.
      :return:
      """
      timepoint_idx = kwargs.get('timepoint_idx', None)
  
      proteins = [get_protein_id(k) for k in df.index.get_level_values('Proteins')]
      amino_acids = df.index.get_level_values('Amino acid')
      positions = _get_positions(df)
      multiplicity = [int(k[-1]) for k in df.index.get_level_values('Multiplicity')]
  
      apos = ["%s%s" % x for x in zip(amino_acids, positions)]
  
      phdfs = []
  
      # Convert timepoints to 1-based ordinal.
      tp_map = set()
      for c in args:
          tp_map.add(c[timepoint_idx])
      tp_map = sorted(tp_map)
  
      for c in args:
          v = df[a].mean(axis=1).values / df[c].mean(axis=1).values
          tp = [1 + tp_map.index(c[timepoint_idx])]
          tps = tp * len(proteins) if timepoint_idx else [1] * len(proteins)
  
          prar = ["%s-%s-%d-%d" % x for x in zip(proteins, apos, multiplicity, tps)]
          phdf = pd.DataFrame(np.array(list(zip(prar, v))))
          phdf.columns = ["ID", "Ratio"]
          phdfs.append(phdf)
  
      pd.concat(phdfs).to_csv(f, sep='\t', index=None)