1ExperimentFile(3) Staden Package ExperimentFile(3)
2
3
4
6 exp_read_info, exp_fread_info, exp_create_info, exp_destroy_info,
7 exp_create_range, exp_extract_range, exp_get_feature_index,
8 exp_get_int, exp_get_rng, exp_get_str, exp_put_int, exp_put_rng,
9 exp_put_str, exp_print_line, exp_print_seq, exp_print_file, opos2str,
10 str2opos, conf2str, str2conf - Manipulations of the Experiment File
11 format
12
13
14
16 #include <expFileIO.h>
17
18 Exp_info *exp_read_info(
19 char *file);
20
21 Exp_info *exp_fread_info(
22 FILE *fp);
23
24 Exp_info *exp_create_info();
25
26 void exp_destroy_info(
27 Exp_info *e);
28
29 char *exp_create_range(
30 char *str,
31 int start,
32 int end);
33
34 int exp_extract_range(
35 char *str,
36 int *start,
37 int *end);
38
39 int exp_get_feature_index(
40 char *e);
41
42 int exp_get_int(
43 Exp_info *e,
44 int id,
45 int *val);
46
47 int exp_get_rng(
48 Exp_info *e,
49 int id,
50 int *from,
51 int *to);
52
53 int exp_get_str(
54 Exp_info *e,
55 int id,
56 char *s,
57 f_implicit s_l);
58
59 int exp_put_int(
60 Exp_info *e,
61 int id,
62 int *val);
63
64 int exp_put_rng(
65 Exp_info *e,
66 int id,
67 int *from,
68 int *to);
69
70 int exp_put_str(
71 Exp_info *e,
72 int id,
73 char *s,
74 f_implicit s_l);
75
76 int exp_print_line(
77 FILE *fp,
78 Exp_info *e,
79 int eflt,
80 int i);
81
82 int exp_print_seq(
83 FILE *fp,
84 Exp_info *e,
85 int eflt,
86 int i);
87
88 void exp_print_file(
89 FILE *fp,
90 Exp_info *e);
91
92 char *opos2str(
93 int2 *opos,
94 int len,
95 char *buf);
96
97 int str2opos(
98 int2 *opos,
99 char *buf);
100
101 char *conf2str(
102 int1 *conf,
103 int len,
104 char *buf);
105
106 int str2conf(
107 int1 *conf,
108 char *buf);
109
110
112 These functions manipulate Experiment Files. They include functions for
113 reading, writing, and editing the files. The principle structure used
114 by the routines is the Exp_info structure. This is as follows.
115 #define MAXIMUM_EFLT_LENGTH 4
116 #define MAXIMUM_EFLTS 48
117 #define EXP_FILE_LINE_LENGTH 128
118
119 typedef Array Exp_entries;
120
121 typedef struct {
122 Array entries[MAXIMUM_EFLTS]; /* array of array of entries */
123 int Nentries[MAXIMUM_EFLTS]; /* array of number of entries */
124 FILE *fp;
125 } Exp_info;
126
127 #define NULL_Exp_info ( (Exp_info *) NULL )
128
129 For the purposes of simple and efficient coding, each line on an exper‐
130 iment file must be smaller than the defined EXP_FILE_LINE_LENGTH, which
131 is 128 characters.
132
133 Many functions take an experiment file line type identifier as an argu‐
134 ment. These functions are listed in the prototypes as taking int id.
135 Here id should be specified using one of the macros defining in the
136 header file. They take the form of EFLT_XX where XX is the line type.
137 For instance, the ID line type identifier should be written as EFLT_ID.
138
139 The C functions available follow. Some FORTRAN interfaces are also
140 available, but these are not documented. See the include file for their
141 prototypes.
142
143 exp_read_info and exp_fread_info read an experiment file into an allo‐
144 cated Exp_info structure. If successful, the structure pointer is
145 return. Otherwise the null pointer is returned.
146
147 exp_create_info allocates and initialises a new, blank, Exp_info struc‐
148 ture. If successful, the structure pointer is return. Otherwise the
149 null pointer is returned.
150
151 exp_destroy_info deallocates an Exp_info structure.
152
153 exp_create_range creates a string using the experiment file range for‐
154 mat of "start..stop". This format is used by the AQ, ON, TG and TC line
155 types. The buffer specified should be large enough to hold the string.
156 The function returns the str pointer supplied as an argument.
157
158 exp_extract_range extracts the start and end values from the string
159 representation of a range; "start..stop". The values are stored in the
160 integer pointers sent as arguments. If successful, the function returns
161 0. Otherwise -1 is returned.
162
163 exp_get_feature_index converts from a string representation of an
164 experiment file line type to the integer value. For example,
165 exp_get_feature_index("SQ") returns the integer 22, which is the same
166 as the EFLT_SQ definition.
167
168 exp_get_int obtains the integer value held in a specific line type. The
169 value is stored in the integer pointer val. If successful, the function
170 returns 0. Otherwise 1 is returned.
171
172 exp_get_rng obtains the range values held in a specific line type. The
173 values are stored in the integer pointers from and to. If successful,
174 the function returns 0. Otherwise 1 is returned.
175
176 exp_get_str obtains the string value held in a specific line type. The
177 value is stored in the string s. At most s_l characters are copied. If
178 successful, the function returns 0. Otherwise 1 is returned.
179
180 exp_put_int writes the integer pointed to by val to the specified line
181 type. If successful, the function returns 0. Otherwise 1 is returned.
182
183 exp_put_rng writes the range pointed to by from and to to the specified
184 line type. If successful, the function returns 0. Otherwise 1 is
185 returned.
186
187 exp_put_str writes the string s of length s_l to the specified line
188 type. If successful, the function returns 0. Otherwise 1 is returned.
189
190 exp_print_line outputs all entries of the specified type to the speci‐
191 fied file pointer.
192
193 exp_print_seq
194
195 exp_print_file outputs all entries of all line types to the specified
196 file pointer.
197
198 opos2str converts an array of original positions held in opos with len
199 elements to a string suitable for use in the ON line type. The buf
200 should be large enough to hold the string, which in the worst case will
201 be 4 * sequence length. Returns buf.
202
203 str2opos converts the experiment file original position string held in
204 buf to an array of original positions to be stored in opos. opos must
205 be large enough to hold the data, hence it should be of the same length
206 as the sequence. Returns the number of elements written to the opos
207 array.
208
209 conf2str converts an array of confidence values helf in confR with len
210 elements to a string suitable for use in the AV line type. The buf
211 should be large enough to hold the string, which in the worst case will
212 be 4 * sequence length. Returns buf.
213
214 str2conf convers the experiment file confidence values string held in
215 buf to an array of confidence values to be stored in conf. conf must be
216 large enough to hold the data, hence it should be of the same length as
217 the sequence. Returns the number of elements written to the conf array.
218
219
221 ExperimentFile(4)
222
223
224
225 ExperimentFile(3)