6 int Agetbloc(FILE *,struct seqdat *,int *);
15 /* alsnum: Aim - produce TEXT commands for ALSCRIPT that will generate numbers
16 corresponding to a given sequence in the blockfile.
20 alsnum <seqnum> <startnum> <interval> <position> < blockfile > output
24 seqnum: The number of the sequence in the blockfile.
26 startnum: The number to use for the first residue in the sequence (e.g. 1).
28 interval: The numbering interval (e.g. 10).
30 position: Where to place the text in the alscript output (ie the Y coordinate).
33 ALL ARGUMENTS ARE REQUIRED
36 G. J. Barton (25 May 1993).
38 $Id: alsnum.c,v 1.2 1998/09/17 16:54:59 geoff Exp $
40 Revision 1.2 1998/09/17 16:54:59 geoff
41 Check consistency with archive
46 main(int argc,char *argv[])
50 extern FILE *std_in,*std_out,*std_err;
51 extern int MAXtlen,MAXnbloc;
52 extern int MAXilen,precis,MAXslen;
54 int seqnum,startnum,interval,position;
66 "Usage: alsnum <seqnum> <startnum> <interval> <position> < blockfile > output\n");
70 seqnum = atoi(argv[1]);
71 startnum = atoi(argv[2]);
72 interval = atoi(argv[3]);
73 position = atoi(argv[4]);
76 bloc = (struct seqdat *) malloc(sizeof(struct seqdat) * MAXnbloc);
77 mcheck((char *) bloc,"Cannot get space for bloc");
78 if(!Agetbloc(std_in,bloc,&nseq))error("Cannot read bloc file",1);
80 /* have read block file */
82 nums = (int *) GJmalloc(sizeof(int) * bloc[seqnum].slen);
86 /* get the array of numbers - use blank . or - as non-amino acid character */
87 for(i=1;i<bloc[seqnum].slen-1;++i){
88 if(bloc[seqnum].seq[i] == ' ' ||
89 bloc[seqnum].seq[i] == '.' ||
90 bloc[seqnum].seq[i] == '-' ){
99 /* now go down the array and output TEXT commands at interval intervals */
101 fprintf(std_out,"# Text commands created for numbering\n");
102 fprintf(std_out,"# Sequence Number: %d\n",seqnum);
103 fprintf(std_out,"# Starting Number: %d\n",startnum);
104 fprintf(std_out,"# Interval: %d\n",interval);
105 fprintf(std_out,"# Position: %d\n",position);
107 for(i=1;i<bloc[seqnum].slen-1;++i){
108 if(nums[i] != 0 && (float) (nums[i]/interval) == (float)nums[i]/(float)interval){
109 fprintf(std_out,"TEXT %d %d \"%d\"\n",i,position,nums[i]);