======================= predict.awk ======================= #!/usr/bin/gawk -f # name : predict.awk # author : Eiso AB ; eisoab@gmail.com #@ purpose : make list of predicted peaks from shift-lists # input : assignments ( shift.list ) # correlations : [x]cor-file: spec.cor spec.xcor # # example: # predict.awk out=sparky /software/src/PREDICT/COR/hnca.cor prot.shifts # predict.awk out=xeasy spec=XH.cor $name.shifts # # # for examples of corerlation files see: # /software/src/PREDICT/COR/*.cor # or: ./scripts/predict/COR/*.cor (from scripts.tgz) # # # disregard comments # # recognized input: # # # correlate nucl1 nucl2 nucl3 ref1 ref2 ref3 [ filter1 [filter2 [..]]] # correlation type # correlate exit # skip rest of file # dom 1 3 2 # after this line, # switch spectral domains ; also with cmdline option: -v dom=1,3,2 # order: 1st column,3rd column, 2nd column # # # ... comments # all chars after # are skipped # # nodiag 1,2 # sets var nodiag=1 # remove diagonal peaks from plain 1,2 [ default] # also achieved with option: -v nodiag=1 # # keepdiag # keep diagonal peaks # sets var nodiag=0 # # CORRELATION FORMAT: # # correlate nucl1 nucl2 nucl3 ref1 ref2 ref3 [ filter1 [filter2 [..]]] # # the nucl. and filter keywords should match atom-names # and are interpreted as: # 1. regular expresions if given as /string/ # 2. exact matches if given as string # NB strings should not contain spaces # # examples # expression matches # ha -> ha # /ha/ -> ha1, ha2 # /as./ -> asp, asn ; # /gl[un]/ -> glu, gln # /[qh]b[123]?/ -> hb, hb1 hb2 hb3 qb3 # /[qh]b/ -> hb, hb1 hb2 hb3 qb3 # /^hn?$/ -> h , hn # # the ref values are relative sequence numbers # the filters refer to relative sequence number 0 # # that means that for this correlation the h and n atoms should # be from an asn or gln: # # correlate h c n 0 -1 0 /asn|gln/ # # and in the next the c comes from and asn or gln. # # correlate h c n 1 0 1 /asn|gln/ # # # SHIFT LIST FORMAT: [free-format, input is converted to lower-case] # resnum resnam atnam shift shift-error # # example: # 20 ala ha 4.696 0.014 # # xeasy .prot files are also accepted # # hn is converted to h unless the commandline option # -v keephn=1 is used [???check] # # # DEBUGGING INFO # cmdline options # -v debug=1 # # -v out="" show peak types [ pktyp specname peaknr nucl1 nucl2 .... int ] # # -v out=ppm give peak positions in ppm format [will print errors too] # # -v out=asg give peak positions + assignments # # -v out=noe give peak positions + assignments # # -v out=nv equal to out=xpk # -v out=xpk give nmrview (xpk) file with predicted peaks # if this option is given a *.xpk file is expected as additional input file # for the header # # will be set automatically if the file # of the last argument is '.xpk' # # -v out=xeasy equal to out=peaks # -v out=peaks give xeasy (.peaks) file with predicted peaks # if this option is given a *.peaks file belonging to the spectrum # is expected as additional input file for the header # # will be set automatically if the file # of the last argument is '.peaks' # # # -v cyaf cyanaformat, e.g. # #CYANAFORMAT HNh # # [-v] errout=1 print ppm errors as in 45.343~1.230 # # [-v] dom=1,2,3 set domains # # [-v] spec=name default:XH # read from cor-file /software/src/PREDICT/COR/name.cor # [ spectrum name to insert in peaklist ] # XH gives 2d hsqc (C and/or N) # # -v nodiag=1 [ no diagonals ] # -v keepdiag=1 [ keep diagonals ] # -v nocharge=1 [ remove charge of residues ] # # -v keepunassigned=0 [ if 1, keep unassigned shifts (ppm>900) ] # # or one of the following strings in the input: # DEBUG # sets debug=1 # NODEBUG # sets debug=0 # # # a .peaks can be given as input file in order to get the peaks headers # a .xpk can be given as input file in order to get the peaks headers # # gawk '$4>0.1 && $11>0.1 && $18 > 1{next}1' hbhacbcaconh_pred_stat.xpk > qq.xpk