1 | PROJECT pb_com |
---|
2 | OBJECT_KEY PT, # MAIN PREFIX |
---|
3 | MAX_KEY 37, # MAX NUMBER OF AN ATTRIBUTE |
---|
4 | MAX_OBJECT 12, # MAX DIFFERENT USER STRUCTURES |
---|
5 | MAX_STRING_LEN 1024, |
---|
6 | MAX_PAR_CNT 16, |
---|
7 | MAGIC_NUMBER 0x615054, # MAGIC_NUMBER 6 HEX DIGITS (see AISC/magic.lst@PTSERVER) |
---|
8 | |
---|
9 | SERVER_INCLUDES (~ |
---|
10 | #include <stdio.h> |
---|
11 | #include "PT_server.h" |
---|
12 | #include "PT_com.h"~) |
---|
13 | INCLUDE_INCLUDES (~$$(#FILE aisc_include.header)~) |
---|
14 | |
---|
15 | DATA { |
---|
16 | |
---|
17 | # ********************************* USER DATA ******************************************* |
---|
18 | |
---|
19 | @CONST, @VALUE, @DOCU; |
---|
20 | LIST_SIZE, 20, (~Size of I_STR Buffer~); |
---|
21 | PERC_SIZE, 20, (~How many centigrades to look~); |
---|
22 | ALPHA_SIZE, 52, (~26 BIG, 26 small letters~); |
---|
23 | DOMAIN_MIN_LENGTH, 8, (~Minimum length of a domain~); |
---|
24 | PT_PART_DEEP, 2, (~The Deep of the Partitions~); |
---|
25 | |
---|
26 | |
---|
27 | # ******************************* PRIVAT STRUCTURES: DO NOT CHANGE ********************************* |
---|
28 | |
---|
29 | @STRUCT, @SKEY, @SKEYC, @SDOCU; |
---|
30 | |
---|
31 | dll_public, , , (~parent of dll (=DoubledLinkedList)~), { |
---|
32 | @TYPE, @IDENT, @REF, @ACC, @SAVE, @KEY, @KEYC, @INIT, @DOCU; |
---|
33 | t_key, key, t, r, , , , , (~The key~); |
---|
34 | int, cnt, t, r, , CNT, 0, , (~Number of elements~); |
---|
35 | long, hash, t, , , , , , (~Hash Table~); |
---|
36 | dllheader_ext, parent, flt, r, , PARENT, 1, , (~My Owner~); |
---|
37 | dllheader_ext, last, flt, r, , LAST, 2, , (~Pointer to the last element~); |
---|
38 | }; |
---|
39 | |
---|
40 | |
---|
41 | dll_header, COMMON, 0, (~link header (should be head of each function)~), { |
---|
42 | @TYPE, @IDENT, @REF, @ACC, @SAVE, @KEY, @KEYC, @INIT, @DOCU; |
---|
43 | t_key, key, t, r, , KEY, 0, , (~The Key~); |
---|
44 | aisc_string, aisc_get_keystring, %, r, , KEYSTRING, 1, , (~THE STRING of the KEY~); |
---|
45 | dll_public, parent, ls, r, , (~~), 2, , (~Pointer to dll_public~); |
---|
46 | aisc_string, ident, t, , 1, IDENT, 5, , (~The ident [not necessary]~); |
---|
47 | }; |
---|
48 | |
---|
49 | |
---|
50 | # ********************************* USER STRUCTURES ******************************************* |
---|
51 | |
---|
52 | # new probe design/match: |
---|
53 | |
---|
54 | PT_tprobes, TPROBE, 9, (~the probe we want to test~), { |
---|
55 | @TYPE, @IDENT, @REF, @ACC, @KEY, @KEYC, @INIT, @DOCU; |
---|
56 | dllh, mh, t, , (~~), 0, , (~Header~); |
---|
57 | aisc_string,sequence, t, r, SEQUENCE, 8, , (~The Sequence to check~); |
---|
58 | int, seq_len, t, , , , , (~The len of the sequence~); |
---|
59 | double, sum_bonds, t, , , , , (~The sum of all bonds~); |
---|
60 | double, quality, t, r, QUALITY, 9, , (~The quality of the probe = GROUPSIZE*dT~); |
---|
61 | int, groupsize, t, r, GROUPSIZE, 10, , (~The Size of the group~); |
---|
62 | int, hairpin, t, r, HAIRPIN, 11, , (~How many hairpin bonds~); |
---|
63 | double, whairpin, t, r, WHAIRPIN, 12, , (~Weighted Hairpins~); |
---|
64 | int, perc, vt, r, PERC, 13, , (~Result: How many non group hits per centigrade~), SIZE PERC_SIZE; |
---|
65 | double, temp, t, r, TEMPERATURE, 14, , (~The temperature of the probe~); |
---|
66 | int, mishits, t, r, MISHIT, 15, , (~How many outgroup members hit~); |
---|
67 | int, apos, t, , APOS, 16, , (~The absolute position of probe~); |
---|
68 | int, get_r_pos, t, , ECOLI_POS, 17, , (~The ecoli based position of probe~); |
---|
69 | aisc_string,get_design_info, %, r, INFO, 19, , (~the info text for each of the designed probes~); |
---|
70 | }; |
---|
71 | |
---|
72 | PT_bond, , , (~the definition of a bond~), { |
---|
73 | @TYPE, @IDENT, @REF, @ACC, @KEY, @KEYC, @INIT, @DOCU; |
---|
74 | double, val, t, , VAL, 0, 0.0, (~how strong is that bond~); |
---|
75 | }; |
---|
76 | |
---|
77 | PT_sequence, SEQUENCE, 8, (~the additional sequences~), { |
---|
78 | @TYPE, @IDENT, @REF, @ACC, @KEY, @KEYC, @INIT, @DOCU; |
---|
79 | dllh, mh, t, , (~~), 0, , (~Header~); |
---|
80 | bytestring,seq, t, , SEQUENCE, 8, , (~The Sequence~); |
---|
81 | }; |
---|
82 | |
---|
83 | PT_pdc, PDC, 7, (~probe design~), { |
---|
84 | @TYPE, @IDENT, @REF, @ACC, @KEY, @KEYC, @INIT, @DOCU; |
---|
85 | dllh, mh, t, , (~~), 0, , (~Header~); |
---|
86 | double, dte, t, , DTEDGE, 9, 50.0, (~The Temperature drop per percent mismatch on the edge of the probe~); |
---|
87 | double, dt, t, , DT, 10, 50.0, (~The temperature drop per percent mismatch~); |
---|
88 | int, looplen, t, , LOOPLEN, 14, 4, (~The Loop Length of a probe~); |
---|
89 | int, min_probelen, t, , MIN_PROBELEN, 15, 18, (~the minimum length of the designed probes~); |
---|
90 | double, mintemp, t, , MINTEMP, 16, 30.0, (~minimum temperature~); |
---|
91 | double, maxtemp, t, , MAXTEMP, 17, 100.0, (~maximum temperature~); |
---|
92 | double, min_gc, t, , MINGC, 18, .3, (~the minimum GC content~); |
---|
93 | double, max_gc, t, , MAXGC, 19, 1.0, (~the maximum GC content~); |
---|
94 | double, maxbonds, t, , MAXBOND, 20, 4.0, (~The maximum of hairpin bonds~); |
---|
95 | int, min_ecolipos, t, , MIN_ECOLIPOS, 21, -1, (~the minimum ecoli position [1..N]. -1 means 'no restriction'~); |
---|
96 | int, max_ecolipos, t, , MAX_ECOLIPOS, 22, -1, (~the maximum ecoli position [1..N]. -1 means 'no restriction'~); |
---|
97 | double, min_coverage, t, , MINTARGETS, 23, .7, (~the minimum coverage for the targetted group of species~); |
---|
98 | int, max_mishits, t, , MISHIT, 24, 0, (~the maximum mishits~); |
---|
99 | int, clipresult, t, , CLIPRESULT, 25, 40, (~Clip the Result list~); |
---|
100 | int, pos_groups, vt, , , , , (~Position of Groups~), SIZE ALPHA_SIZE; |
---|
101 | bytestring, checksums, t, w, CHECKSUMS, 26, , (~a list of sequence checksums separated by '#' is optional~); |
---|
102 | bytestring, names, t, w, NAMES, 27, , (~a list of names separated by '#' is expected~); |
---|
103 | bytestring, PT_unknown_names, %, r, UNKNOWN_NAMES, 28, , (~List of unknown names~); |
---|
104 | PT_sequence, sequences, d, , SEQUENCE, 29, , (~Additional Sequences~); |
---|
105 | int, PT_start_design, %, w, GO, 31, , (~Start the design procedure~); |
---|
106 | PT_tprobes, tprobes, d, r, TPROBE, 32, , (~The result~); |
---|
107 | double, max_rj_coverage, t, r, MAX_RJ_TARGETS, 34, 0.0, (~the maximum rejected coverage for the targetted group of species~); |
---|
108 | int, min_rj_mishits, t, r, MIN_RJ_MISHIT, 35, INT_MAX, (~the minimum rejected mishits~); |
---|
109 | aisc_string, get_design_hinfo, %, r, INFO_HEADER, 36, , (~the result info header of this probe design~); |
---|
110 | int, max_probelen, t, , MAX_PROBELEN, 37, -1, (~the maximum length of the designed probes (or -1 to use MIN_PROBELEN~); |
---|
111 | }; |
---|
112 | |
---|
113 | # function to iterate through all probes existing in PT-Server |
---|
114 | |
---|
115 | PT_exProb, PEP, 6, (~iterate all existing probes~), { |
---|
116 | @TYPE, @IDENT, @REF, @ACC, @KEY, @KEYC, @INIT, @DOCU; |
---|
117 | dllh, mh, t, , (~~), 0, , (~Header~); |
---|
118 | int, plength, t, , PLENGTH, 8, 20, (~Length of searched probes~); |
---|
119 | int, numget, t, , NUMGET, 9, 200, (~Number of searched probes~); |
---|
120 | int, readable, t, , READABLE, 14, 0, (~Return readable probes~); |
---|
121 | int, separator, t, , SEPARATOR, 15, 59, (~Separator for result (';') ~); |
---|
122 | int, tu, t, , TU, 16, 84, (~Char used for T/U ('T') ~); |
---|
123 | int, restart, t, , RESTART, 10, 1, (~1 => start from beginning~); |
---|
124 | bytestring, next_probe, t, , NEXT_PROBE, 11, , (~next probe to look for (internal)~); |
---|
125 | int, PT_find_exProb, %, w, FIND_PROBES,12, , (~search probes (result=separated by SEPARATOR )~); |
---|
126 | aisc_string, result, t, r, RESULT, 13, , (~The result~); |
---|
127 | }; |
---|
128 | |
---|
129 | # get next relatives (used by AWTC and NALIGNER) |
---|
130 | |
---|
131 | PT_family_list, FAMILYLIST, 5, (~the family list~), { |
---|
132 | @TYPE, @IDENT, @REF, @ACC, @SAVE, @KEY, @KEYC, @INIT, @DOCU; |
---|
133 | dllh, mh, t, , , (~~), 0, , (~Header~); |
---|
134 | aisc_string, name, t, r, , NAME, 8, , (~name of species~); |
---|
135 | int, matches, t, r, , MATCHES, 9, , (~number of matches~); |
---|
136 | double, rel_matches, t, r, , REL_MATCHES, 10, , (~MATCHES / (SEQ_LEN - PROBE_LEN + 1)~); |
---|
137 | }; |
---|
138 | |
---|
139 | PT_family, FAMILYFINDER, 12, (~next relative search~), { |
---|
140 | @TYPE, @IDENT, @REF, @ACC, @SAVE, @KEY, @KEYC, @INIT, @DOCU; |
---|
141 | dllh, mh, t, , , (~~), 0, , (~Header~); |
---|
142 | bytestring, find_family, %, w, , FIND_FAMILY, 8, , (~Searches the family~); |
---|
143 | int, pr_len, t, rw, , PROBE_LEN, 9, 12, (~Length of probes~); |
---|
144 | int, mis_nr, t, rw, , MISMATCH_NUMBER, 10, 0, (~Number of mismatches~); |
---|
145 | int, only_A_probes, t, rw, , FIND_TYPE, 11, 0, (~Type of search: 0 = search all, 1 = only a*~); |
---|
146 | int, complement, t, rw, , COMPLEMENT, 12, 1, (~Search for complement? (see FF_complement)~); |
---|
147 | PT_family_list, fl, d, r, , FAMILY_LIST, 13, , (~Sorted List of family~); # note: This uses 13 AND 14! |
---|
148 | int, list_size, t, r, , FAMILY_LIST_SIZE, 15, , (~size of result list~); |
---|
149 | int, sort_type, t, rw, , SORT_TYPE, 16, 0, (~Type of sorting 0 = MATCHES, 1 = REL_MATCHES~); |
---|
150 | int, sort_max, t, rw, , SORT_MAX, 17, 0, (~Sort only the SORT_MAX best hits~); |
---|
151 | int, range_start, t, rw, , RANGE_STARTPOS, 18, -1, (~if != -1 -> ignore matches starting left of that position [0..N-1]~); |
---|
152 | int, range_end, t, rw, , RANGE_ENDPOS, 19, -1, (~if != -1 -> ignore matches ending right of that position [0..N-1]~); |
---|
153 | double, min_score, t, rw, , MIN_SCORE, 20, 0, (~Skip results with rel or abs score below MIN_SCORE (affects reported FAMILY_LIST_SIZE)~); |
---|
154 | int, rel_scoring, t, rw, , REL_SCORING, 21, 0, (~relative scoring scaling mode (see RelativeScoreScaling)~); |
---|
155 | aisc_string, ff_error, t, r, , ERROR, 22, "", (~the error text~); |
---|
156 | }; |
---|
157 | |
---|
158 | # used below in LOCS/MATCH_STRING |
---|
159 | |
---|
160 | PT_probematch, MATCHLIST, 4, (~the probe match list~), { |
---|
161 | @TYPE, @IDENT, @REF, @ACC, @SAVE, @KEY, @KEYC, @INIT, @DOCU; |
---|
162 | dllh, mh, t, , , (~~), 0, , (~Header~); |
---|
163 | int, name, t, r, , ID, 8, , (~id of species~); |
---|
164 | aisc_string, virt_name, %, r, , NAME, 9, , (~name of species~); |
---|
165 | int, b_pos, t, r, , POS, 10, , (~pos of probe~); |
---|
166 | int, g_pos, t, r, , GPOS, 11, , (~pos of probe (gene relative)~); |
---|
167 | int, rpos, t, r, , , , , (~relative pos of probe~); |
---|
168 | int, mismatches, t, r, , MISMATCHES, 12, , (~number of mismatches~); |
---|
169 | aisc_string, virt_fullname, %, r, , FULLNAME, 13, , (~fullname of species (or genename if it's a gene pt server)~); |
---|
170 | double, wmismatches, t, r, , WMISMATCHES, 14, , (~number of weighted mismatches~); |
---|
171 | int, N_mismatches, t, r, , N_MISMATCHES, 15, , (~number of 'N' mismatches~); |
---|
172 | double, dt, t, r, , DT, 16, , (~the dt of a probe~); |
---|
173 | char, sequence, l, r, , SEQUENCE, 17, , (~path of probe~); |
---|
174 | int, reversed, t, r, , REVERSED, 18, , (~reversed probe matches~); |
---|
175 | aisc_string, get_match_overlay, %, r, , OVERLAY, 19, , (~ascii visualization of match~); |
---|
176 | aisc_string, get_match_acc, %, r, , FIELD_ACC, 20, , (~get db field acc~); |
---|
177 | int, get_match_start, %, r, , FIELD_START, 21, , (~get db field start~); |
---|
178 | int, get_match_stop, %, r, , FIELD_STOP, 22, , (~get db field stop~); |
---|
179 | }; |
---|
180 | |
---|
181 | # used below in MAIN/SPECIESLIST |
---|
182 | |
---|
183 | PT_species_list, SPECIESLIST, 3, (~the species list~), { |
---|
184 | @TYPE, @IDENT, @REF, @ACC, @SAVE, @KEY, @KEYC, @INIT, @DOCU; |
---|
185 | dllh, mh, t, , , (~~), 0, , (~Header~); |
---|
186 | int, member, t, rw, , MEMBER, 8, , (~species member of group~); |
---|
187 | }; |
---|
188 | |
---|
189 | # global interface |
---|
190 | |
---|
191 | PT_local, LOCS, 2, (~local communication buffer~), { |
---|
192 | @TYPE, @IDENT, @REF, @ACC, @SAVE, @KEY, @KEYC, @INIT, @DOCU; |
---|
193 | dllh, mh, t, , , (~~), 0, , (~Header~); |
---|
194 | int, socket, t, , , , , pt_init_socket(THIS), (~the callback~), DESTROY pt_destroy_socket(THIS); |
---|
195 | |
---|
196 | aisc_string, probe_match, %, w, , SEARCHMATCH, 8, , (~Searches all species where probe matches~); |
---|
197 | aisc_string, pm_sequence, t, , , , , , (~the sequence~); |
---|
198 | aisc_string, pm_csequence, t, , , , , , (~the complement sequence~); |
---|
199 | int, pm_also_revcomp, t, rw, , MATCH_ALSO_REVCOMP, 9, 1, (~also report reverse-complement matches. reported for each resulting probe in MATCHLIST.REVERSED~); |
---|
200 | int, pm_complement_first, t, rw, , COMPLEMENT_FIRST, 10, , (~first of all, complement probe~); |
---|
201 | int, pm_max, t, rw, , MATCH_MAX_MISMATCHES, 11, , (~max mismatches~); |
---|
202 | int, pm_max_hits, t, rw, , MATCH_MAX_HITS, 12, 1000000, (~max number of hits reported (0=unlimited)~); |
---|
203 | int, sort_by, t, rw, , MATCH_SORT_BY, 13, , (~0 == mismatches 1 == weighted mismatches 2 == weighted mismatches with pos and strength~); |
---|
204 | int, pm_nmatches_ignored, t, rw, , MATCH_N_ACCEPT, 14, 1, (~max. of accepted matches vs N~); |
---|
205 | int, pm_nmatches_limit, t, rw, , MATCH_N_LIMIT, 33, 4, (~N-matches are only accepted, if less than NMATCHES_LIMIT occur, otherwise no N-matches are accepted ~); |
---|
206 | PT_probematch, pm, d, r, , MATCH_LIST, 15, , (~result: List of species where probe matches~); |
---|
207 | int, matches_truncated, t, r, , MATCHES_TRUNCATED, 17, , (~result: whether MATCH_LIST was truncated~); |
---|
208 | bytestring, match_string, %, r, , MATCH_STRING, 18, , (~result: List of species where probe matches~); |
---|
209 | |
---|
210 | bytestring, MP_match_string, %, r, , MP_MATCH_STRING, 19, , (~result: List of species where probe matches (each entry is followed by: number of mismatches and weighted mismatches)~); |
---|
211 | bytestring, MP_all_species_string,%, r, , MP_ALL_SPECIES_STRING,20, , (~result: List of all species in Database~); |
---|
212 | int, MP_count_all_species, %, r, , MP_COUNT_ALL_SPECIES, 21, , (~result: Number of all species in Database~); |
---|
213 | |
---|
214 | aisc_string, ls_error, t, r, , ERROR, 22, "", (~the error text~); |
---|
215 | |
---|
216 | int, group_count, t, r, , PROBE_NGROUP, 23, , (~result: Number of selected species~); |
---|
217 | |
---|
218 | PT_pdc, pdc, d, , , PROBE_DESIGN_CONFIG, 24, , (~The new probe design~); |
---|
219 | PT_exProb, ep, d, , , PROBE_FIND_CONFIG, 26, , (~Find all existing probes~); |
---|
220 | |
---|
221 | PT_family, ffinder, d, , , FFINDER, 28, , (~next relative search~); |
---|
222 | |
---|
223 | aisc_string, user, t, rw, , USER, 30, "unknown", (~the username~); |
---|
224 | aisc_string, address, t, rw, , ADDRESS, 31, "unknown", (~the useraddress~); |
---|
225 | aisc_string, login, t, rw, , LOGINTIME, 32, "notime", (~the date the user logged in~); |
---|
226 | |
---|
227 | PT_bond, bond, siv, , , BOND, 34, , (~The bond matrix~), SIZE (4*4); |
---|
228 | int, dummy, t, , , , , init_bond_matrix(THIS), (~init bond matrix~); |
---|
229 | double, split, t, , , SPLIT, 35, .5, (~Split the domains if bond value is less the average bond value - split~); |
---|
230 | }; |
---|
231 | |
---|
232 | PT_main, MAIN, 1, (~global data~), { |
---|
233 | @TYPE, @IDENT, @REF, @ACC, @SAVE, @KEY, @KEYC, @INIT, @DOCU; |
---|
234 | t_key, key, t, n, , , , , (~the KEY~); |
---|
235 | PT_local, loc_st, d, , , LOCS, 1, , (~the parameters~); |
---|
236 | aisc_string, server_shutdown,%, w, , SHUTDOWN, 3, , (~shut down~); |
---|
237 | int, who, t, rw, , STARTER, 4, , (~who started this server~); |
---|
238 | int, m_type, t, , , MESSAGE_TYPE, 5, 0, (~the message type~); |
---|
239 | aisc_string, m_text, t, , , MESSAGE, 6, "NO_MSG", (~the message text~); |
---|
240 | int, broadcast, %, w, , BROADCAST, 7, , (~broadcast func~); |
---|
241 | PT_species_list,sl, d, r, , SPECIESLIST, 8, , (~list of species~); |
---|
242 | aisc_string, dumpname, t, rw, , DUMP_NAME, 10, "", (~filename used for DUMP_INDEX~); |
---|
243 | int, PT_index_dump, %, r, , DUMP_INDEX, 11, , (~dump index (=postree) to file~); |
---|
244 | }; |
---|
245 | |
---|
246 | }; |
---|