code: def write_phosphopath(df, f, extra_columns=None):
      
  
      proteins = [_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 = [k[-1] for k in df.index.get_level_values('Multiplicity')]
  
      apos = ["%s%s" % x for x in zip(amino_acids, positions)]
      prar = ["%s-%s" % x for x in zip(proteins, apos)]
  
      phdf = pd.DataFrame(np.array(list(zip(proteins, prar, apos, multiplicity))))
      if extra_columns:
          for c in extra_columns:
              phdf[c] = df[c].values
  
      phdf.to_csv(f, sep='\t', index=None, header=None)
docs: Write out the data frame of phosphosites in the following format::
  
          protein, protein-Rsite, Rsite, multiplicity
          Q13619	Q13619-S10	S10	1
          Q9H3Z4	Q9H3Z4-S10	S10	1
          Q6GQQ9	Q6GQQ9-S100	S100	1
          Q86YP4	Q86YP4-S100	S100	1
          Q9H307	Q9H307-S100	S100	1
          Q8NEY1	Q8NEY1-S1000	S1000	1
  
      The file is written as a comma-separated (CSV) file to file ``f``.
  
      :param df:
      :param f:
      :return: