Groups search result 8 for "Tobias Kind" |
Franz Borrmann <franz.borrmann@tu-berlin.de> wrote
> Dear Colleagues,
>
> we're looking for a possibility to get ASCII-files (TIC or
> SIM-chromatogram data) out of a HP-Chemstation (ver.G1034C) ..snip
> Thanks a lot
Dear Franz,
sometimes ago I wrote a nice :-) macro:
------------------------------------------------------------------------------
!HP2ASCII.MAC starts here
name HP2ASCII
!***
!*** this macro fully converts a HP Chemstation file to ASCII or JCAMP-DX
!*** (c)TK4ICBINB
!*** if an error occours during macro execution:false line break in macro
!***
!***(1) load a GC-MS file in HP Chemstation
!***(2) Choose Options Dialog Box --> Command line
!***(3) enter "macro" at command line and load HP2ASCII
!***(4) enter HP2ASCII at the command line to start
!***(5) Choose an option TIC+MS, TIC, JCAMP-DX
!***(6) Read in with XCL with ";" separator
!*** (from the actual HP data path)
!***
!*** possible files are : xMSspec.txt, xspecrow.txt,
!*** xTIConly.txt , JCMPGCMS.jdx
!*** BEWARE: XCL can read only a 256x65536 matrix!!! Yes 3x!
LOCAL label, button, choice
SDim label, 4
SDim button, 3
label[1] = "TIC+spectra nice output"
label[2] = "TIC+spectra ín one line"
label[3] = "Only TIC"
label[4] = "JCAMP 4 Lib2NIST"
button[1] = ""
button[2] = "OK"
button[3] = ""
choice = 1
INPUT6 3, 4,"HP2ASCII", label, button, choice
mychoice = choice
POINTS R0 ! Get scan range in NPOINTS
lowscan = 1
highscan = NPOINTS
if (mychoice = 1) then
NiceOutput
endif
if (mychoice = 2) then
LineOutput
endif
if (mychoice = 3) then
TICOutput
endIF
if (mychoice = 4) then
JCAMP4Lib2NIST
endIF
CLOSE #1
Alert "Beware: EXCEL is only 8-bit!",2
return
name NiceOutput
fileName$ = _DATAPATH$+_DATAFILE$ + "\xMSspec.txt"
OPEN fileName$ FOR OUTPUT AS #1
!change for header line output
PRINT USING #1,"%;%;%;%;%;%/","Scan","Time","TIC","MSPeaks","Mass","Abund"
i = 1
while i <= highscan
scan i
points x !get the number of spectra points
!***array starts from 0 , scans start from 1 aarrgghh
PRINT USING #1, "#;#.###;#;#/",i,r0[i-1,0],r0[i-1,1],NPOINTS
!*****************************************
!*** write out the mass pairs
masscount = 0 !array starts from zero
while masscount < NPOINTS
!*** take care !
!*** if you want true mass values use #.###
!*** and remove the round() function
!*** give out mass, abundance
print using #1 ,";;;;#.##;#/",round(x[masscount,0]),x[masscount,1]
masscount = masscount+1
endwhile
!*****************************************
i = i+1
print i
endwhile
return
name LineOutput
fileName$ = _DATAPATH$+_DATAFILE$ + "\xspecrow.txt"
OPEN fileName$ FOR OUTPUT AS #1
!header line output
PRINT USING #1,"%;%;%;%;%;%/","Scan","Time","TIC","MSPeaks","Mass","Abund"
i = 1
while i <= highscan
scan i
points x !get the number of spectra points
!***array starts from 0 , scans start from 1 aarrgghh
PRINT USING #1, "#;#.###;#;#",i,r0[i-1,0],r0[i-1,1],NPOINTS
!*****************************************
!*** write out the mass pairs
masscount = 0 !array starts from zero
while masscount < NPOINTS
! All spectra in one line
print using #1 ,";#.##;#",round(x[masscount,0]),x[masscount,1]
masscount = masscount+1
endwhile
!*****************************************
print using #1, "/"
i = i+1
print i
endwhile
return
name TICOutput
fileName$ = _DATAPATH$+_DATAFILE$ + "\xTIConly.txt"
OPEN fileName$ FOR OUTPUT AS #1
PRINT USING #1, "%;%;%;%;/","Scan","Time","TIC","MSPeaks"
i = 1
while i <= highscan
scan i
points x !get the number of spectra points
!***array starts from 0 , scans start from 1 aarrgghh
PRINT USING #1, "#;#.###;#;#/",i,r0[i-1,0],r0[i-1,1],NPOINTS
i = i+1
print i
endwhile
return
name JCAMP4Lib2NIST
! HP Chemstation GC-MS file to JCAMP-DX (HP2JCAMP)
! my contribution to the IUPAC year :-)
! but anyway, it would be better to use AMDIS32 and Lib2NIST
! and use only pure extracted peaks...
! for JCAMP look at
! http://wwwchem.uwimona.edu.jm:1104/software/jcampdx.html
! http://www.isas-dortmund.de/projects/jcamp/
! no compressed format -> ever built a hashtable in Chemstation ?
fileName$ = _DATAPATH$+_DATAFILE$ + "\JCMPGCMS.jdx"
OPEN fileName$ FOR OUTPUT AS #1
i = 1
while i <= highscan
scan i
points x !get the number of spectra points
!***array starts from 0 , scans start from 1 aarrgghh
PRINT USING #1, "% % %#/","##TITLE=",_DATAFILE$,"Scan ",i
PRINT #1, "##JCAMPDX= Revision 5.0"
PRINT #1, "##DATA TYPE= MASS SPECTRUM"
PRINT #1, "##DATA CLASS= PEAK TABLE"
PRINT #1, "##XUNITS= m/z"
PRINT #1, "##YUNITS= RELATIVE ABUNDANCE"
PRINT USING #1, "% #/", "##NPOINTS=", NPOINTS
PRINT #1, "##PEAK TABLE= (XY..XY)"
!*****************************************
!*** write out the mass pairs
masscount = 0 !array starts from zero
while masscount < NPOINTS
!*** take care !
!*** if you want true mass values use #.###
!*** and remove the round() function
!*** give out mass, abundance
print using #1 ,"# #/",round(x[masscount,0]),x[masscount,1]
masscount = masscount+1
endwhile
!*****************************************
i = i+1
print i
endwhile
return
!*** HP2ASCII.MAC ends here
-------------------------------------------------------------------------------
A good starting point are the google-groups:
http://groups.google.de/groups?hl=en&q=tic+chemstation+macro
and also the sci.techniques.mass-spec group (moderated).
The HP Chemstation has a really powerful and open concept.
If you want to have a nice programming environment please
download the macropad from
http://www.chem.agilent.com/cag/servsup/usersoft/main.html
There are a also a lot of examples in //hpchem/msexe/macros.hlp
With kind regards
Tobias Kind
www.amdis.net
PS:
Ever noticed SGS-Polymers ?
http://wwwstud.uni-leipzig.de/~che94beq/pradiobr.htm
©2002 Google