i like this post (click again to cancel)
0
i dont like this post (click again to cancel) remove favorite mark from this question (click again to restore mark)

I am trying to parse a "peaks" file (generated by topspin) and convert it from binary to ascii, but couldn't find its file format. does anyone have any idea about the file format, or a program that does the conversion?

asked Jan 23 '13 at 11:27

badgerNMR's gravatar image

badgerNMR
1


2 Answers:
i like this answer (click again to cancel)
0
i dont like this answer (click again to cancel)

I have a number of AU programs that parse the ascii peak list. As Kirk says, it is possible to use the "convertpeaklist" command. If you want to do that in an AU program, use the following routine:

//Create a peaklist and convert it to ASCII for reading
XWP_PP
XCMD("sendgui convertpeaklist txt")

If you want to parse it, there are 4 header lines which may or may not be useful to you and then you can run through the peaks:

for (i=1;i<=500;i++) /* give up after 500 peaks*/
{

  if(fscanf(fptr,"%*d %f %f %f %f",&PEAKA[i],&PEAKH[i],&PEAKP[i],&PEAKI[i])<3)
  {
    /* no more peaks to read */
    fprintf(flog,"%d peaks found\n",npeaks);
    break;
  }
  else
  { 
    //Do something useful
  }
}

I hope that is useful...

link

answered Apr 16 '13 at 08:13

John%20Hollerton's gravatar image

John Hollerton
96

i like this answer (click again to cancel)
0
i dont like this answer (click again to cancel)

The pp and pps commands in older TopSpin versions (2.0 and older) will produce an ASCII pile called peaks.txt. Newer TopSpin versions (2.1 and newer) produce an ASCII peaklist.xml file instead, which should be trivial to parse. There is also a convertpeaklist command which will produce a text (or xml) peak list from the peaaks list. You can also peak pick to a JCAMP-DX file with the ppj command.

link

answered Jan 24 '13 at 10:33

Kirk%20Marat's gravatar image

Kirk Marat
711

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a good answer, for discussions, please use comments and please do remember to vote (login to vote)
toggle preview

powered by CNPROG