2
* Copyright (c) Medical Research Council 1994. All rights reserved.
4
* Permission to use, copy, modify and distribute this software and its
5
* documentation for any purpose is hereby granted without fee, provided that
6
* this copyright and notice appears in all copies.
8
* This file was written by James Bonfield, Simon Dear, Rodger Staden,
9
* as part of the Staden Package at the MRC Laboratory of Molecular
10
* Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
12
* MRC disclaims all warranties with regard to this software.
19
* Description: Routines for reading and writing to experiment files.
21
* 1. Opening experiment files
22
* 2. Reading information from an experiment file
23
* 3. Appending to experiment files
24
* 4. Closing an opened experiment file
36
* TG TYPE S position..length
37
* TG One or more comment lines starting at character position 10
38
* TG Each line represents a line of tag.
39
* TG Extra indentation is simply added to the comment.
41
* Where S is the strand, either "+", "-", or "=" (both).
45
* TG This comment contains
48
* So the above is a COMMent tag on both strands from bases 100 to 110
49
* inclusive containing the annotation
50
* "This comment contains\n several lines.\n"
52
* This is written using exp_put_str giving the multi line string:
53
* "COMM = 100..110\nThis comment contains\n several lines."
55
* (ie the indentation is added by the experiment file format, not by the
56
* calling routines. Similarly this indentation is stripped out again when
62
#include <string.h> /* IMPORT: strdup (hopefully!) */
65
#include "stadenarray.h"
66
#include "expFileIO.h"
69
/* Fixup for broken SunOS 4.x systems */
74
/*************************************************************
75
* Line types for experiment file
76
*************************************************************/
78
char eflt_feature_ids[MAXIMUM_EFLTS][MAXIMUM_EFLT_LENGTH+1] = {
79
"CF", /* 0 cloning vector sequence file */
80
"CN", /* 1 clone name */
81
"CS", /* 2 cloning vector sequence present in sequence */
82
"CV", /* 3 cloning vector type */
83
"DR", /* 4 direction of read */
84
"DT", /* 5 date of experiment */
85
"EN", /* 6 experiment name */
86
"EX", /* 7 experimental notes */
87
"FM", /* 8 sequencing vector fragmentation method */
88
"LN", /* 9 local format trace file name */
89
"LT", /* 10 local format trace file type */
90
"MC", /* 11 machine on which experiment ran */
91
"MN", /* 12 machine generated trace file name */
92
"MT", /* 13 machine generated trace file type */
93
"OP", /* 14 operator */
94
"PN", /* 15 primer name */
95
"QR", /* 16 poor quality sequence present at right (3') end */
96
"SC", /* 17 sequencing vector cloning site */
97
"SF", /* 18 sequencing vector sequence file */
98
"SI", /* 19 sequencing vector insertion length */
99
"SL", /* 20 sequencing vector present at left (5') end */
100
"SP", /* 21 sequencing vector primer site (relative to cloning site) */
101
"SQ", /* 22 sequence */
102
"SR", /* 23 sequencing vector present at right (3') end */
103
"ST", /* 24 strands */
104
"SV", /* 25 sequencing vector type */
105
"TN", /* 26 template name */
106
"QL", /* 27 poor quality sequence present at left (5') end */
107
"PS", /* 28 processing status */
108
"CC", /* 29 comments */
109
"SS", /* 30 sequence to screen against */
110
/* added 27-May-93 */
111
"TG", /* 31 gel tag line */
112
"ID", /* 32 identifier */
113
/* added 24-Sep-93 */
114
"AQ", /* 33 average quality measure */
115
/* added 15-Oct-93 */
116
"PR", /* 34 primer type */
117
"LI", /* 35 subclone library (mtd) */
118
"LE", /* 36 subclone library entry (well) */
119
/* added 19-Apr-94 */
120
"TC", /* 37 contig tag line */
121
"AC", /* 38 accession number */
122
/* added 11-Nov-94 */
123
"BC", /* 39 base calling software */
124
"ON", /* 40 original base numbers (positions) */
125
"AV", /* 41 accuracy (quality) values */
126
"PC", /* 42 position in contig */
127
"SE", /* 43 sense, whether it is complemented */
129
"CL", /* 44 cloning vector left end*/
130
"CR", /* 45 cloning vector right end*/
131
"AP", /* 46 assembly position */
132
"CH", /* 47 special chemistry used (eg taq) */
133
"PD", /* 48 primer data - the sequence of a primer */
134
"WT" /* 49 wild type trace */
141
/*************************************************************
142
* Output/update lines
143
*************************************************************/
145
int exp_print_line_(FILE *fp, char *eflt, char *entry)
147
* Output an experiment file line
157
int exp_print_line(FILE *fp, Exp_info *e, int eflt, int i)
159
* Output an experiment file line
162
return exp_print_line_(fp,
163
eflt_feature_ids[eflt],
164
arr(char *,e->entries[eflt],i)
169
* Outputs a multi-line experiment file line.
170
* Continuation lines are automatically added by adding 5 characters of extra
171
* indentation at the start of each continuation.
173
* returns -1 for failure, 0 for success.
175
int exp_print_mline(FILE *fp, Exp_info *e, int eflt, int i) {
178
p = arr(char *, e->entries[eflt], i);
181
if ((c = strchr(p, '\n')))
183
if (-1 == exp_print_line_(fp, eflt_feature_ids[eflt], p))
190
if ((c = strchr(p, '\n'))) {
194
if (-1 == fprintf(fp, "%-10s%s\n", eflt_feature_ids[eflt], p))
202
int exp_print_seq(FILE *fp, Exp_info *e, int eflt, int i)
204
* Output an experiment file multi line
209
if (fprintf(fp,"%-5s",eflt_feature_ids[eflt])<0) return 1;
211
l = strlen(seq = arr(char *,e->entries[eflt],i));
213
if (j%60==0) if ( fprintf(fp,"\n ") < 0 ) return 1;
214
if (j%10==0) if ( fprintf(fp," ") < 0 ) return 1;
215
if ( fprintf(fp,"%c",seq[j]) < 0 ) return 1;
217
if ( fprintf(fp,"\n//\n") < 0 ) return 1;
222
int exp_get_feature_index(char *e)
226
for (i = 0; i < MAXIMUM_EFLTS; i++)
227
if(strcmp(eflt_feature_ids[i],e)==0) return i;
233
/*************************************************************
235
*************************************************************/
238
* Creates a string of 'range format' from the start and end points.
239
* The string (of form start..end) is also returned.
241
char *exp_create_range(char *str, int start, int end) {
242
sprintf(str, "%d..%d", start, end);
247
* Extracts the start and end points from a range string.
248
* Returns 0 for success and -1 for failure.
250
int exp_extract_range(char *str, int *start, int *end) {
251
return sscanf(str, "%d..%d", start, end) != 2;
254
Exp_info *exp_create_info(void)
256
* Allocate space for new experiment file information
262
new = (Exp_info *)xmalloc(sizeof(Exp_info));
264
for(i=0; i< MAXIMUM_EFLTS ; i++) {
265
new->Nentries[i] = 0;
266
new->entries[i] = ArrayCreate(sizeof(char *), 1/*one entry*/);
275
void exp_destroy_info(Exp_info *e)
277
* Destroy experiment file information
282
if (e != NULL_Exp_info) {
283
for (i = 0; i < MAXIMUM_EFLTS; i++) {
284
Array a = e->entries[i];
285
for(j=0;j<e->Nentries[i];j++)
286
if (arr(char *,a,j) != NULL) xfree(arr(char *,a,j));
289
if (e->fp != NULL) fclose(e->fp);
299
static char *exp_read_sequence(FILE *fp)
301
* Read from file a sequence, discarding all white space til a // is encountered
306
char line[EXP_FILE_LINE_LENGTH+1];
310
seq = (char *)xmalloc(seql+1);
315
l = fgets(line,EXP_FILE_LINE_LENGTH,fp);
316
while (l!= NULL && strncmp(l,"//",2)) {
319
if (! isspace(*a)) *b++=*a;
321
seql = seql + b-line;
322
seq = (char *)xrealloc(seq,seql+1);
326
l = fgets(line,EXP_FILE_LINE_LENGTH,fp);
334
* Converts the opos[] array into a char array.
335
* In doing so this shrinks the data size by using a .. notation.
336
* No check is made that buf is large enough. It is recommended that buf is
337
* allocated to 5*len which covers the worst case (for sequences less that
340
* Note that on older systems sprintf may return the first argument rather
341
* than the number of characters written.
342
* For this reason we have to do the counting ourselves.
344
char *opos2str(int2 *opos, int len, char *buf) {
345
int i, st, f, dir = 0;
346
char *r = buf, *rs = buf;
349
for (i = 1; i < len; f=opos[i++]) {
353
else if (opos[i] == f-1)
356
if (dir && opos[i] != f + dir) {
358
sprintf(buf, "%d..%d ", opos[st], opos[i-1]);
360
sprintf(buf, "%d ", opos[st]);
366
} else if (dir == 0) {
367
sprintf(buf, "%d ", f);
381
sprintf(buf, "%d..%d", opos[st], opos[i-1]);
383
sprintf(buf, "%d", opos[st]);
390
* Expands from the character string .. notation to the opos[] array, up to
391
* a maximum of len elements in opos[].
393
* Returns the length of the opos array.
395
int str2opos(int2 *opos, int len, char *buf) {
396
int i, n1, n2, st, en, m, j = 0;
399
m = sscanf(buf, "%d%n..%d%n", &st, &n1, &en, &n2);
408
for (i = st; i <= en && j < len; i++)
411
for (i = st; i >= en && j < len; i--)
426
* Converts the accuracy value string (AV) to the confidence array up to
427
* a maximum of len elements in conf[].
429
* The AV string is of format:
430
* "x y z ..." where x, y and z are confidence values for the first three
432
* "a,b,c,d e,f,g,h i,j,k,l ..." where the 4-tuples represent the four
433
* confidence values for each base.
435
* Returns: number of confidence values read, or -1 for error.
437
int str2conf(int1 *conf, int len, char *buf) {
438
int val1, ind = 0, pos;
440
while (*buf && sscanf(buf, "%d%n", &val1, &pos) == 1 && ind < len) {
441
if (buf[pos] == ',') {
442
fprintf(stderr, "4-tuple system is currently unsupported\n");
454
* Converts the confidence array to the accuracy value string (AV).
456
* Note no memory overrun checks are performed on buf. It is recommended
457
* that it is allocated to 4*len (worst case of "100 " for each base).
459
* Returns the buf argument.
461
char *conf2str(int1 *conf, int len, char *buf) {
463
char *ret = buf, *rs = buf;
465
for (i = 0; i < len; i++) {
466
sprintf(buf, "%d ", conf[i]);
479
/*************************************************************
480
* Main C interface routines
481
*************************************************************/
485
* Closes an experiment file (if open), but does not free it.
487
void exp_close(Exp_info *e) {
495
Exp_info *exp_read_info(char *file)
497
* Read in an experiment file and return handle
506
if ((fp = fopen(file,"r"))==NULL) {
507
return NULL_Exp_info;
510
e = exp_fread_info(fp);
513
if (NULL_Exp_info == e) {
514
return NULL_Exp_info;
518
* reopen for appending
520
e->fp = fopen(file,"a");
528
* Read in an experiment file and return handle
530
Exp_info *exp_fread_info(FILE *fp)
533
char line[EXP_FILE_LINE_LENGTH+1];
535
e = exp_create_info();
542
if (e != NULL_Exp_info) {
543
while (fgets(line,EXP_FILE_LINE_LENGTH,e->fp) != NULL) {
548
* zero terminate first argument
549
* set c to point to second argument
551
* FIXME: c should point to character 6 always. Indentation is
552
* important when considering continuation lines.
554
for (c=line;*c && !isspace(*c); c++) ;
557
for (;*c && isspace(*c); c++) ;
560
entry = exp_get_feature_index(line);
563
* Tag lines may be split over multiple lines. If we have no
564
* tag type then we append to the existing tag.
566
if ((int)(c-line) >= 10/* continuation lines */
567
&& (entry == EFLT_TG || entry == EFLT_TC ||
568
entry == EFLT_ON || entry == EFLT_AV)) {
573
* Extend our current line by the appropriate amount
575
en = exp_get_entry(e,entry);
577
l2 = strlen(&line[10]);
579
if (NULL == (en = exp_get_entry(e, entry) =
580
(char *)xrealloc(en, l1 + l2 + 1)))
585
* Append the new line (without the \n char)
589
strcpy(&en[l1+1], &line[10]);
592
* Increment number of entries for line type entry
593
* This will force exp_get_entry() to return pointer to
594
* next free element in array
596
(void)ArrayRef(e->entries[entry],e->Nentries[entry]++);
598
if (entry == EFLT_SQ)
599
exp_get_entry(e,entry) = exp_read_sequence(e->fp);
601
char *eoln = strchr(c,'\n');
604
if (eoln!=NULL) *eoln='\0';
606
if (entry == EFLT_LT)
607
for (i=3; isspace(c[i]) && i >= 0; c[i--]='\0');
609
exp_get_entry(e,entry) = (char *)strdup(c);
619
static int exp_check_eid_read(Exp_info *e,int id)
621
* Check these are a valid combination and that
622
* an entry exists for read
628
id >= MAXIMUM_EFLTS ||
629
e->Nentries[id] == 0 ||
630
eflt_feature_ids[id][0]=='\0'
634
static int exp_check_eid_write(Exp_info *e,int id)
636
* Check these are a valid combination and that
637
* an entry exists for write
642
id >= MAXIMUM_EFLTS ||
644
eflt_feature_ids[id][0]=='\0');
652
int exp_get_int(Exp_info *e, int id, int *val)
654
* Get the integer for entry id
660
if ( exp_check_eid_read(e,id) ) return 1;
661
*val = atoi(exp_get_entry(e,id));
666
int exp_get_rng(Exp_info *e, int id, int *from, int *to)
668
* Get the integer pair for entry id
674
if ( exp_check_eid_read(e,id) ) return 1;
675
(void)exp_extract_range(exp_get_entry(e,id), from, to);
682
int exp_get_str(Exp_info *e, int id, char *s, f_implicit s_l)
684
* Get the string for entry id
690
if ( exp_check_eid_read(e,id) ) return 1;
691
strncpy(s,exp_get_entry(e,id),s_l);
697
static int exp_append_str(Exp_info *e, int id, char *s, int len)
699
* Append the string to experiment file for entry id
705
(void)ArrayRef(e->entries[id],e->Nentries[id]++);
706
exp_get_entry(e,id) = (char *)xmalloc(len+1);
707
strncpy(exp_get_entry(e,id), s, len);
708
exp_get_entry(e,id)[len] = '\0';
711
return exp_print_seq(e->fp,e,id,e->Nentries[id]-1);
712
else if (id == EFLT_TG || id == EFLT_TC ||
713
id == EFLT_ON || id == EFLT_AV)
714
return exp_print_mline(e->fp,e,id,e->Nentries[id]-1);
716
return exp_print_line(e->fp,e,id,e->Nentries[id]-1);
720
int exp_put_int(Exp_info *e, int id, int *val)
722
* Append the integer for entry id to the experiment file
728
char buf[EXP_FILE_LINE_LENGTH];
729
if ( exp_check_eid_write(e,id) ) return 1;
730
sprintf(buf,"%d",*val);
731
return exp_append_str(e,id,buf,strlen(buf));
735
int exp_put_rng(Exp_info *e, int id, int *from, int *to)
737
* Append the integer pair for entry id to the experiment file
743
char buf[EXP_FILE_LINE_LENGTH];
744
if ( exp_check_eid_write(e,id) ) return 1;
746
(void )exp_create_range(buf, *from, *to);
748
return exp_append_str(e,id,buf,strlen(buf));
753
int exp_put_str(Exp_info *e, int id, char *s, f_implicit s_l)
755
* Append the string for entry id to the experiment file
761
if ( exp_check_eid_write(e,id) ) return 1;
762
return exp_append_str(e,id,s,s_l);
770
static void c2fstr(char *c, int max_c, char *f, int max_f)
772
#define min(A,B) ( (A) < (B) ? (A) : (B) )
778
for( ; i<max_f; i++) f[i]=' ';
782
static int fstrlen(char *f, int max_f)
784
for (; max_f > 0 && (isspace(f[max_f-1]) || f[max_f-1]=='\0'); max_f--);
788
static void f2cstr(char *f, int max_f, char *c, int max_c)
792
i = min(fstrlen(f,max_f),max_c);
801
/*************************************************************
803
*************************************************************/
807
static int init_done = 0;
808
static int NHandles = 0;
809
static Exp_info **Handles = NULL;
811
static int initialise(void)
815
if (init_done) return 0;
818
NHandles = FOPEN_MAX;
820
if ( (Handles = (Exp_info **)xmalloc(sizeof(Exp_info *) * NHandles)) == NULL) {
825
for (i=0; i<NHandles; i++) Handles[i] = NULL;
831
static int get_free_handle(void)
833
* find a free entry in the Exp array
834
* returns -1 if there is none
841
if (!NHandles) return -1; /* no slots! */
842
for (i=0; i<NHandles && Handles[i]!=NULL; i++) ;
843
return (i==NHandles)?-1:i;
847
static int check_handle(f_int *handle)
849
return (handle == NULL ||
850
(int) (*handle) <= 0 ||
851
(int) (*handle) > NHandles);
856
f_int expopn_(char *fn, f_implicit fn_l)
858
* FORTRAN interface to exp_open_file()
864
if ( (handle = get_free_handle()) >= 0 ) {
865
f2cstr(fn,fn_l,cfn,1024);
866
Handles[handle] = exp_read_info(cfn);
869
return (f_int) (handle+1);
874
f_proc_ret expkil_(f_int *handle)
876
* FORTRAN interface to exp_destroy_info
880
if ( check_handle(handle) ) f_proc_return();
881
e = (Exp_info *) Handles[(int)(*handle)-1];
885
Handles[(int)(*handle)-1] = NULL;
891
f_int expri_(f_int *handle, f_int *id, f_int *val)
893
* FORTRAN interface to exp_get_int
897
if ( check_handle(handle) ) return 1;
898
e = (Exp_info *) Handles[(int)(*handle)-1];
900
return exp_get_int(e, (int)*id, (int *)val);
904
f_int exprr_(f_int *handle, f_int *id, f_int *from, f_int *to)
906
* FORTRAN interface to exp_get_rng
910
if ( check_handle(handle) ) return 1;
911
e = (Exp_info *) Handles[(int)(*handle)-1];
913
return exp_get_rng(e,(int)*id,(int *)from,(int *)to);
918
f_int exprsa_(f_int *handle, f_int *id, char *s, f_int *max_len, f_implicit s_l)
920
* FORTRAN interface to exp_get_str workalike
921
* NOTE: for use with FORTRAN CHARACTER arrays instead CHARACTER strings
925
if ( check_handle(handle) ) return 1;
926
e = (Exp_info *) Handles[(int)(*handle)-1];
928
if ( exp_check_eid_read(e,*id) ) return 1;
929
c2fstr(exp_get_entry(e,*id),(int)*max_len,s,(int)*max_len);
934
f_int exprs_(f_int *handle, f_int *id, char *s, f_implicit s_l)
936
* FORTRAN interface to exp_get_str workalike
937
* NOTE: for use with FORTRAN CHARACTER strings instead CHARACTER arrays
941
if ( check_handle(handle) ) return 1;
942
e = (Exp_info *) Handles[(int)(*handle)-1];
944
if ( exp_check_eid_read(e,*id) ) return 1;
945
c2fstr(exp_get_entry(e,*id),s_l,s,s_l);
950
f_int expwi_(f_int *handle, f_int *id, f_int *val)
952
* FORTRAN interface to exp_put_int
956
if ( check_handle(handle) ) return 1;
957
e = (Exp_info *) Handles[(int)(*handle)-1];
959
return exp_put_int(e, (int)*id, (int *)val);
963
f_int expwr_(f_int *handle, f_int *id, f_int *from, f_int *to)
965
* FORTRAN interface to exp_put_rng
969
if ( check_handle(handle) ) return 1;
970
e = (Exp_info *) Handles[(int)(*handle)-1];
972
return exp_put_rng(e, (int)*id, (int *)from, (int *)to);
977
f_int expwsa_(f_int *handle, f_int *id, char *s, f_int *max_len, f_implicit s_l)
979
* FORTRAN interface to exp_put_str workalike
980
* NOTE: for use with FORTRAN CHARACTER arrays instead CHARACTER strings
984
char buf[EXP_FILE_LINE_LENGTH];
985
if ( check_handle(handle) ) return 1;
986
e = (Exp_info *) Handles[(int)(*handle)-1];
989
if ( exp_check_eid_write(e,*id) ) return 1;
990
/* don't allow multi-line entries to be written */
991
if (*id == EFLT_SQ ) return 1;
992
f2cstr(s,(int)*max_len,buf,sizeof(buf));
993
return exp_append_str(e,*id,buf,strlen(buf));
997
f_int expws_(f_int *handle, f_int *id, char *s, f_implicit s_l)
999
* FORTRAN interface to exp_put_str workalike
1000
* NOTE: for use with FORTRAN CHARACTER strings instead CHARACTER arrays
1003
char buf[EXP_FILE_LINE_LENGTH];
1005
if ( check_handle(handle) ) return 1;
1006
e = (Exp_info *) Handles[(int)(*handle)-1];
1009
if ( exp_check_eid_write(e,*id) ) return 1;
1010
/* don't allow multi-line entries to be written */
1011
if (*id == EFLT_SQ ) return 1;
1012
f2cstr(s,s_l,buf,sizeof(buf));
1013
return exp_append_str(e,*id,buf,s_l);
1017
* FORTRAN interface to exp_create_range()
1019
void expcr_(char *str, f_int *start, f_int *end, f_implicit str_l) {
1020
exp_create_range(str, *start, *end);
1021
c2fstr(str, str_l, str, str_l);
1027
* FORTRAN interface to exp_extract_range()
1030
f_int exper_(char *str, f_int *start, f_int *end, f_implicit str_l) {
1031
return exp_extract_range(str, start, end);
1037
/*************************************************************
1039
*************************************************************/
1041
static void print_line(FILE *fp, Exp_info *e, int eflt, int all)
1045
for(i=0;i<e->Nentries[eflt];i++) exp_print_line(fp,e,eflt,i);
1046
} else if (e->Nentries[eflt] > 0) {
1047
exp_print_line(fp,e,eflt,e->Nentries[eflt]-1);
1052
static void print_mline(FILE *fp, Exp_info *e, int eflt, int all)
1056
for(i=0;i<e->Nentries[eflt];i++) exp_print_mline(fp,e,eflt,i);
1057
} else if (e->Nentries[eflt] > 0) {
1058
exp_print_mline(fp,e,eflt,e->Nentries[eflt]-1);
1064
static void print_seq(FILE *fp, Exp_info *e, int eflt)
1066
if (e->Nentries[eflt] > 0)
1067
exp_print_seq(fp,e,eflt,e->Nentries[eflt]-1);
1073
void exp_print_file(FILE *fp, Exp_info *e)
1075
print_line(fp,e,EFLT_ID, 0);
1076
print_line(fp,e,EFLT_AC, 0);
1077
print_line(fp,e,EFLT_EN, 0);
1079
print_line(fp,e,EFLT_CC, 1);
1080
print_line(fp,e,EFLT_EX, 1);
1081
print_line(fp,e,EFLT_PS, 1);
1083
print_line(fp,e,EFLT_LN, 0);
1084
print_line(fp,e,EFLT_LT, 0);
1086
print_line(fp,e,EFLT_CF, 0);
1087
print_line(fp,e,EFLT_CV, 0);
1088
print_line(fp,e,EFLT_CS, 0);
1089
print_line(fp,e,EFLT_CL, 0);
1090
print_line(fp,e,EFLT_CR, 0);
1092
print_line(fp,e,EFLT_SF, 0);
1093
print_line(fp,e,EFLT_SV, 0);
1094
print_line(fp,e,EFLT_SI, 0);
1095
print_line(fp,e,EFLT_SC, 0);
1096
print_line(fp,e,EFLT_SP, 0);
1097
print_line(fp,e,EFLT_PD, 0);
1098
print_line(fp,e,EFLT_FM, 0);
1099
print_line(fp,e,EFLT_SL, 0);
1100
print_line(fp,e,EFLT_SR, 0);
1102
print_line(fp,e,EFLT_QL, 0);
1103
print_line(fp,e,EFLT_QR, 0);
1105
print_mline(fp,e,EFLT_TG,1);
1106
print_mline(fp,e,EFLT_TC,1);
1108
print_line(fp,e,EFLT_CN, 0);
1109
print_line(fp,e,EFLT_TN, 0);
1110
print_line(fp,e,EFLT_PN, 0);
1111
print_line(fp,e,EFLT_PR, 0);
1112
print_line(fp,e,EFLT_LI, 0);
1113
print_line(fp,e,EFLT_LE, 0);
1114
print_line(fp,e,EFLT_CH, 0);
1116
print_mline(fp,e,EFLT_ON,0);
1117
print_line(fp,e,EFLT_AQ, 0);
1118
print_mline(fp,e,EFLT_AV,0);
1120
print_line(fp,e,EFLT_DR, 0);
1121
print_line(fp,e,EFLT_SE, 0);
1122
print_line(fp,e,EFLT_PC, 0);
1123
print_line(fp,e,EFLT_AP, 0);
1124
print_line(fp,e,EFLT_ST, 0);
1126
print_line(fp,e,EFLT_DT, 0);
1127
print_line(fp,e,EFLT_MC, 0);
1128
print_line(fp,e,EFLT_MN, 0);
1129
print_line(fp,e,EFLT_MT, 0);
1130
print_line(fp,e,EFLT_OP, 1);
1131
print_line(fp,e,EFLT_BC, 0);
1132
print_line(fp,e,EFLT_SS, 0);
1134
print_seq (fp,e,EFLT_SQ);
1139
* Allocate an set a new experiment file entry
1141
char *exp_set_entry(Exp_info *e, int eflt, char *str) {
1145
if (NULL == ArrayRef(e->entries[eflt], e->Nentries[eflt]))
1148
e->Nentries[eflt]++;
1151
if (NULL == (s = exp_get_entry(e, eflt) = (char *)xmalloc(l+1))) {
1152
e->Nentries[eflt]--;