Mercurial > repos > dawe > srf2fastq
comparison srf2fastq/io_lib-1.12.2/io_lib/seqIOABI.h @ 0:d901c9f41a6a default tip
Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
author | dawe |
---|---|
date | Tue, 07 Jun 2011 17:48:05 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:d901c9f41a6a |
---|---|
1 /* | |
2 * Copyright (c) Medical Research Council 1994. All rights reserved. | |
3 * | |
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. | |
7 * | |
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. | |
11 * | |
12 * MRC disclaims all warranties with regard to this software. | |
13 */ | |
14 | |
15 #ifndef _seqIOABI_h_ | |
16 #define _seqIOABI_h_ | |
17 | |
18 #include <sys/types.h> /* off_t */ | |
19 #include "io_lib/os.h" | |
20 | |
21 #ifdef __cplusplus | |
22 extern "C" { | |
23 #endif | |
24 | |
25 /* | |
26 * The ABI magic number - "ABIF" | |
27 */ | |
28 #define ABI_MAGIC ((int_4) ((((('A'<<8)+'B')<<8)+'I')<<8)+'F') | |
29 | |
30 /* | |
31 * The index is located towards the end of the ABI trace file. | |
32 * It's location is given by a longword at a fixed place. | |
33 */ | |
34 #define IndexPO ((off_t)26) | |
35 | |
36 #define IndexEntryLength 28 | |
37 | |
38 /* | |
39 * Here are some labels we will be looking for, four chars packed | |
40 * into an int_4 | |
41 */ | |
42 #define LABEL(a) ((int_4) ((((((a)[0]<<8)+(a)[1])<<8)+(a)[2])<<8)+(a)[3]) | |
43 #define DataEntryLabel LABEL("DATA") | |
44 #define BaseEntryLabel LABEL("PBAS") | |
45 #define BasePosEntryLabel LABEL("PLOC") | |
46 #define SpacingEntryLabel LABEL("SPAC") | |
47 #define SignalEntryLabel LABEL("S/N%") | |
48 #define FWO_Label LABEL("FWO_") | |
49 #define MCHNLabel LABEL("MCHN") | |
50 #define PDMFLabel LABEL("PDMF") | |
51 #define SMPLLabel LABEL("SMPL") | |
52 #define PPOSLabel LABEL("PPOS") | |
53 #define CMNTLabel LABEL("CMNT") | |
54 #define GelNameLabel LABEL("GELN") | |
55 #define LANELabel LABEL("LANE") | |
56 #define RUNDLabel LABEL("RUND") | |
57 #define RUNTLabel LABEL("RUNT") | |
58 #define MTXFLabel LABEL("MTXF") | |
59 #define SPACLabel LABEL("SPAC") | |
60 #define SVERLabel LABEL("SVER") | |
61 #define MODLLabel LABEL("MODL") | |
62 #define BaseConfLabel LABEL("PCON") | |
63 | |
64 | |
65 /* | |
66 * From the ABI results file connected to `fp' whose index starts | |
67 * at byte offset `indexO', return in `val' the `lw'th long word | |
68 * from the `count'th entry labelled `label'. | |
69 * The result is 0 for failure, or index offset for success. | |
70 */ | |
71 int getABIIndexEntryLW(FILE *fp, off_t indexO, | |
72 uint_4 label, uint_4 count, int lw, | |
73 uint_4 *val); | |
74 | |
75 /* | |
76 * From the ABI results file connected to `fp' whose index starts | |
77 * at byte offset `indexO', return in `val' the `sw'th short word | |
78 * from the `count'th entry labelled `label'. | |
79 * The result is 0 for failure, or index offset for success. | |
80 */ | |
81 int getABIIndexEntrySW(FILE *fp, off_t indexO, | |
82 uint_4 label, uint_4 count, int sw, | |
83 uint_2 *val); | |
84 | |
85 /* | |
86 * Gets the offset of the ABI index. | |
87 * Returns -1 for failure, 0 for success. | |
88 */ | |
89 int getABIIndexOffset(FILE *fp, uint_4 *indexO); | |
90 | |
91 /* | |
92 * Get an "ABI String". These strings are either pointed to by the index | |
93 * offset, or held in the offset itself when the string is <= 4 characters. | |
94 * The first byte of the string determines its length. | |
95 * 'string' is a buffer 256 characters long. | |
96 * | |
97 * Returns -1 for failure, string length for success. | |
98 */ | |
99 int getABIString(FILE *fp, off_t indexO, uint_4 label, uint_4 count, | |
100 char *string); | |
101 | |
102 /* | |
103 * Get an "ABI Int_1". This is raw 1-byte integer data pointed to by the | |
104 * offset, or held in the offset itself when the data is <= 4 characters. | |
105 * | |
106 * If indexO is 0 then we do not search for (or indeed use) label and count, | |
107 * but simply assume that we are already at the correct offset and read from | |
108 * here. (NB: This negates the length <= 4 check.) | |
109 * | |
110 * Returns -1 for failure, length desired for success (it'll only fill out | |
111 * up to max_data_len elements, but it gives an indication of whether there | |
112 * was more to come). | |
113 */ | |
114 int getABIint1(FILE *fp, off_t indexO, uint_4 label, uint_4 count, | |
115 uint_1 *data, int max_data_len); | |
116 | |
117 /* | |
118 * Get an "ABI Int_2". This is raw 2-byte integer data pointed to by the | |
119 * offset, or held in the offset itself when the data is <= 4 characters. | |
120 * | |
121 * Returns -1 for failure, length desired for success (it'll only fill out | |
122 * up to max_data_len elements, but it gives an indication of whether there | |
123 * was more to come). | |
124 */ | |
125 int getABIint2(FILE *fp, off_t indexO, uint_4 label, uint_4 count, | |
126 uint_2 *data, int max_data_len); | |
127 | |
128 /* | |
129 * Get an "ABI Int_4". This is raw 4-byte integer data pointed to by the | |
130 * offset, or held in the offset itself when the data is <= 4 characters. | |
131 * | |
132 * Returns -1 for failure, length desired for success (it'll only fill out | |
133 * up to max_data_len elements, but it gives an indication of whether there | |
134 * was more to come). | |
135 */ | |
136 int getABIint4(FILE *fp, off_t indexO, uint_4 label, uint_4 count, | |
137 uint_4 *data, int max_data_len); | |
138 | |
139 int dump_labels(FILE *fp, off_t indexO); | |
140 | |
141 /* | |
142 * Change the DATA counts for fetching traces | |
143 */ | |
144 void abi_set_data_counts(int f, int w, int o, int _); | |
145 | |
146 /* | |
147 * Put the DATA counts back to their defaults. | |
148 */ | |
149 void abi_reset_data_counts(void); | |
150 | |
151 #ifdef __cplusplus | |
152 } | |
153 #endif | |
154 | |
155 #endif /* _seqIOABI_h_ */ |