# Copyright (c) 2002-08 Peter Guntert. All rights reserved. ## 7MACROS: shifttable - CYANA macro ## ## Parameters: columns= (default: H,HA*,HB*,~H*) ## digits= (default: 2) ## full ## ## Prints a table of chemical shift values of selected atoms grouped in the given ## , specified as a comma-separated list of atom names, which may contain ## wildcards. Optionally, the atom name for a column may be be preceded by '~' to ## indicate that the atom name should be printed in front of every chemical shift ## value. In the case of hydrogen atoms, chemical shifts of the corresponding pseudo ## atoms are printed as well. Chemical shifts from one residue are printed in a row. ## Chemical shifts of atoms included in one column are not reprinted again in a later ## column. For hydrogen chemical shifts the number of after the decimal point ## can be specified. One digit less is used for chemical shifts for other atoms, e.g. ## carbons and nitrogens. If the option 'full' is set, then also empty rows and ## columns that do not contain chemical shift values are printed. var col cw i iter j j1 k l m n names qcol s str str2 str3 used w syntax columns=*=H,HA*,HB*,~H* digits=@i=2 full n=length('columns') do k 1 n col='$columns(k)' names(k)=col(1:1).eq.'~' if (names(k)) columns(k):=$col(2:) end do do iter 1 2 if (iter.eq.1) then do k 1 n cw(k)=0 if (full) cw(k)=lenstr('$columns(k)') end do else str:=Residue str2:=------- l=9 do k 1 n w=cw(k) if (w.gt.0) then l=l+3 str(l:l+w-1):=$columns(k) do i l l+w-1 str2(i:i):="-" end do l=l+w-1 end if end do if (l.le.9) return print print " $str" print " $str2" end if do i 1 nr s:=$rnam(i) str:="$s(1:3) $rnum(i)" l=9 used:= j1=ifira(i) do j j1 ifira(i+1)-1 used(j-j1+1)=.false. end do do k 1 n col='$columns(k)' qcol=col if (col(1:1).eq.'H') qcol='Q'//col(2:) str3:= do j j1 ifira(i+1)-1 s=shift(j,1) if (s.lt.990.0 .and. asel(j) .and. (match(anam(j),col) .or. match(anam(j),qcol)) .and..not.used(j-j1+1)) then used(j-j1+1)=.true. if (element(j).le.1) then str2:=$s(F${digits+3}.$digits) else str2:=$s(F$max(5,digits+3).$max(1,digits-1)) end if if (names(k)) str2:=$anamo(j) $str2 if ('$str3'.eq.' ') then str3:=$str2 else if (.not.names(k)) then str3:=$str3/$str2 else str3:=$str3, $str2 end if end if end do w=cw(k) if (iter.eq.1) then str2='$str3' cw(k)=max(w,lenstr(str2)) else if (w.gt.0) then l=l+3 str(l:l+w-1):=$str3 l=l+w-1 end if end do if (iter.eq.2 .and. (full .or. '$str(9:)'.ne.' ')) then print " $str" end if end do end do print