# Copyright (c) 2002-08 Peter Guntert. All rights reserved. ## 7MACROS: read_all - CYANA macro ## ## Parameters: ## unknown= (default: warning) ## ## Reads all given angle, coordinate or PDB files and stores them into the ## structure memories. File name may contain asterisk and question marks to ## select several structures at one time (e.g. "er*.ang" or "er???.cor"). The ## file name extension decides on the format of the individual files: files ## with filename extension ".ang" are read as angle files, files with ## filename extension ".pdb" are read as PDB coordinate files, and other ## files are read as DG coordinate files. var echo name file i l n firstprot syntax $macro:** unknown=*=warning echo:=off name:=d$getpid.nam file:= do i 1 nparam file:=$file $p$i end do system "/bin/ls $file > $name" n=0 firstprot=.true. do readline $name file file='$file' if (file.eq.'EOF') break if (file.ne.' ') then n=n+1 l=lenstr(file) if (file(max(1,l-3):l).eq.'.ang') then read ang $file structure=1 unknown=$unknown else if (file(max(1,l-3):l).eq.'.cor') then read cor $file structure=1 unknown=$unknown else if (file(max(1,l-4):l).eq.'.prot') then read prot $file unknown=$unknown $if(firstprot,' ','append') if (.not.existfile('$name.peaks')) \ print "\# Number of dimensions 2" >$name.peaks. read peaks $name.peaks unknown=$unknown $if(firstprot,' ','append') firstprot=.false. else read pdb $file structure=1 unknown=$unknown end if structure copy 0 n end if end do remove $name if (existfile('$name.peaks')) remove $name.peaks structure copy 1 0 if (n.gt.0) structure select 1..$n info=none print " $n structures read."