nysol-take 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/mbiclique.rb +317 -0
- data/bin/mbipolish.rb +362 -0
- data/bin/mccomp.rb +235 -0
- data/bin/mclique.rb +295 -0
- data/bin/mclique2g.rb +105 -0
- data/bin/mcliqueInfo.rb +203 -0
- data/bin/mfriends.rb +202 -0
- data/bin/mgdiff.rb +252 -0
- data/bin/mhifriend.rb +456 -0
- data/bin/mhipolish.rb +465 -0
- data/bin/mitemset.rb +168 -0
- data/bin/mpal.rb +410 -0
- data/bin/mpolishing.rb +399 -0
- data/bin/msequence.rb +165 -0
- data/bin/mtra2g.rb +476 -0
- data/bin/mtra2gc.rb +360 -0
- data/ext/grhfilrun/extconf.rb +12 -0
- data/ext/grhfilrun/grhfilrun.c +85 -0
- data/ext/grhfilrun/src/_sspc.c +358 -0
- data/ext/grhfilrun/src/aheap.c +545 -0
- data/ext/grhfilrun/src/aheap.h +251 -0
- data/ext/grhfilrun/src/base.c +92 -0
- data/ext/grhfilrun/src/base.h +59 -0
- data/ext/grhfilrun/src/fstar.c +497 -0
- data/ext/grhfilrun/src/fstar.h +80 -0
- data/ext/grhfilrun/src/grhfil.c +214 -0
- data/ext/grhfilrun/src/itemset.c +713 -0
- data/ext/grhfilrun/src/itemset.h +170 -0
- data/ext/grhfilrun/src/problem.c +415 -0
- data/ext/grhfilrun/src/problem.h +179 -0
- data/ext/grhfilrun/src/queue.c +533 -0
- data/ext/grhfilrun/src/queue.h +182 -0
- data/ext/grhfilrun/src/sample.c +19 -0
- data/ext/grhfilrun/src/sspc.c +597 -0
- data/ext/grhfilrun/src/sspc2.c +491 -0
- data/ext/grhfilrun/src/stdlib2.c +1482 -0
- data/ext/grhfilrun/src/stdlib2.h +892 -0
- data/ext/grhfilrun/src/trsact.c +817 -0
- data/ext/grhfilrun/src/trsact.h +160 -0
- data/ext/grhfilrun/src/vec.c +745 -0
- data/ext/grhfilrun/src/vec.h +172 -0
- data/ext/lcmrun/extconf.rb +20 -0
- data/ext/lcmrun/lcmrun.cpp +99 -0
- data/ext/lcmrun/src/aheap.c +216 -0
- data/ext/lcmrun/src/aheap.h +111 -0
- data/ext/lcmrun/src/base.c +92 -0
- data/ext/lcmrun/src/base.h +59 -0
- data/ext/lcmrun/src/itemset.c +496 -0
- data/ext/lcmrun/src/itemset.h +157 -0
- data/ext/lcmrun/src/lcm.c +427 -0
- data/ext/lcmrun/src/problem.c +349 -0
- data/ext/lcmrun/src/problem.h +177 -0
- data/ext/lcmrun/src/queue.c +528 -0
- data/ext/lcmrun/src/queue.h +176 -0
- data/ext/lcmrun/src/sgraph.c +359 -0
- data/ext/lcmrun/src/sgraph.h +173 -0
- data/ext/lcmrun/src/stdlib2.c +1282 -0
- data/ext/lcmrun/src/stdlib2.h +823 -0
- data/ext/lcmrun/src/trsact.c +747 -0
- data/ext/lcmrun/src/trsact.h +159 -0
- data/ext/lcmrun/src/vec.c +731 -0
- data/ext/lcmrun/src/vec.h +171 -0
- data/ext/lcmseq0run/extconf.rb +20 -0
- data/ext/lcmseq0run/lcmseq0run.cpp +59 -0
- data/ext/lcmseq0run/src/aheap.c +216 -0
- data/ext/lcmseq0run/src/aheap.h +111 -0
- data/ext/lcmseq0run/src/base.c +92 -0
- data/ext/lcmseq0run/src/base.h +59 -0
- data/ext/lcmseq0run/src/itemset.c +518 -0
- data/ext/lcmseq0run/src/itemset.h +157 -0
- data/ext/lcmseq0run/src/itemset_zero.c +522 -0
- data/ext/lcmseq0run/src/lcm_seq.c +446 -0
- data/ext/lcmseq0run/src/lcm_seq_zero.c +446 -0
- data/ext/lcmseq0run/src/problem.c +439 -0
- data/ext/lcmseq0run/src/problem.h +179 -0
- data/ext/lcmseq0run/src/problem_zero.c +439 -0
- data/ext/lcmseq0run/src/queue.c +533 -0
- data/ext/lcmseq0run/src/queue.h +182 -0
- data/ext/lcmseq0run/src/stdlib2.c +1350 -0
- data/ext/lcmseq0run/src/stdlib2.h +864 -0
- data/ext/lcmseq0run/src/trsact.c +747 -0
- data/ext/lcmseq0run/src/trsact.h +159 -0
- data/ext/lcmseq0run/src/vec.c +779 -0
- data/ext/lcmseq0run/src/vec.h +172 -0
- data/ext/lcmseqrun/extconf.rb +20 -0
- data/ext/lcmseqrun/lcmseqrun.cpp +101 -0
- data/ext/lcmseqrun/src/aheap.c +216 -0
- data/ext/lcmseqrun/src/aheap.h +111 -0
- data/ext/lcmseqrun/src/base.c +92 -0
- data/ext/lcmseqrun/src/base.h +59 -0
- data/ext/lcmseqrun/src/itemset.c +518 -0
- data/ext/lcmseqrun/src/itemset.h +157 -0
- data/ext/lcmseqrun/src/itemset_zero.c +522 -0
- data/ext/lcmseqrun/src/lcm_seq.c +447 -0
- data/ext/lcmseqrun/src/lcm_seq_zero.c +446 -0
- data/ext/lcmseqrun/src/problem.c +439 -0
- data/ext/lcmseqrun/src/problem.h +179 -0
- data/ext/lcmseqrun/src/problem_zero.c +439 -0
- data/ext/lcmseqrun/src/queue.c +533 -0
- data/ext/lcmseqrun/src/queue.h +182 -0
- data/ext/lcmseqrun/src/stdlib2.c +1350 -0
- data/ext/lcmseqrun/src/stdlib2.h +864 -0
- data/ext/lcmseqrun/src/trsact.c +747 -0
- data/ext/lcmseqrun/src/trsact.h +159 -0
- data/ext/lcmseqrun/src/vec.c +779 -0
- data/ext/lcmseqrun/src/vec.h +172 -0
- data/ext/lcmtransrun/extconf.rb +18 -0
- data/ext/lcmtransrun/lcmtransrun.cpp +264 -0
- data/ext/macerun/extconf.rb +20 -0
- data/ext/macerun/macerun.cpp +57 -0
- data/ext/macerun/src/aheap.c +217 -0
- data/ext/macerun/src/aheap.h +112 -0
- data/ext/macerun/src/itemset.c +491 -0
- data/ext/macerun/src/itemset.h +158 -0
- data/ext/macerun/src/mace.c +503 -0
- data/ext/macerun/src/problem.c +346 -0
- data/ext/macerun/src/problem.h +174 -0
- data/ext/macerun/src/queue.c +529 -0
- data/ext/macerun/src/queue.h +177 -0
- data/ext/macerun/src/sgraph.c +360 -0
- data/ext/macerun/src/sgraph.h +174 -0
- data/ext/macerun/src/stdlib2.c +993 -0
- data/ext/macerun/src/stdlib2.h +811 -0
- data/ext/macerun/src/vec.c +634 -0
- data/ext/macerun/src/vec.h +170 -0
- data/ext/sspcrun/extconf.rb +20 -0
- data/ext/sspcrun/src/_sspc.c +358 -0
- data/ext/sspcrun/src/aheap.c +545 -0
- data/ext/sspcrun/src/aheap.h +251 -0
- data/ext/sspcrun/src/base.c +92 -0
- data/ext/sspcrun/src/base.h +59 -0
- data/ext/sspcrun/src/fstar.c +496 -0
- data/ext/sspcrun/src/fstar.h +80 -0
- data/ext/sspcrun/src/grhfil.c +213 -0
- data/ext/sspcrun/src/itemset.c +713 -0
- data/ext/sspcrun/src/itemset.h +170 -0
- data/ext/sspcrun/src/problem.c +415 -0
- data/ext/sspcrun/src/problem.h +179 -0
- data/ext/sspcrun/src/queue.c +533 -0
- data/ext/sspcrun/src/queue.h +182 -0
- data/ext/sspcrun/src/sample.c +19 -0
- data/ext/sspcrun/src/sspc.c +598 -0
- data/ext/sspcrun/src/sspc2.c +491 -0
- data/ext/sspcrun/src/stdlib2.c +1482 -0
- data/ext/sspcrun/src/stdlib2.h +892 -0
- data/ext/sspcrun/src/trsact.c +817 -0
- data/ext/sspcrun/src/trsact.h +160 -0
- data/ext/sspcrun/src/vec.c +745 -0
- data/ext/sspcrun/src/vec.h +172 -0
- data/ext/sspcrun/sspcrun.cpp +54 -0
- data/lib/nysol/enumLcmEp.rb +338 -0
- data/lib/nysol/enumLcmEsp.rb +284 -0
- data/lib/nysol/enumLcmIs.rb +275 -0
- data/lib/nysol/enumLcmSeq.rb +143 -0
- data/lib/nysol/items.rb +201 -0
- data/lib/nysol/seqDB.rb +256 -0
- data/lib/nysol/take.rb +39 -0
- data/lib/nysol/taxonomy.rb +113 -0
- data/lib/nysol/traDB.rb +257 -0
- metadata +239 -0
@@ -0,0 +1,213 @@
|
|
1
|
+
/* SACHICA: Scalable Algorithm for Characteristic and Homologinous Interval CAlclation */
|
2
|
+
/* 2004 Takeaki Uno */
|
3
|
+
/* matdraw */
|
4
|
+
|
5
|
+
#ifndef _grhfil_c_
|
6
|
+
#define _grhfil_c_
|
7
|
+
|
8
|
+
// #define FSTAR_INT unsigned int
|
9
|
+
// internal_params.l1 : #edges written to the output file
|
10
|
+
|
11
|
+
#define WEIGHT_DOUBLE
|
12
|
+
|
13
|
+
#include"fstar.c"
|
14
|
+
#include"problem.c"
|
15
|
+
|
16
|
+
#define GRHFIL_INS_ROWID 1024
|
17
|
+
|
18
|
+
/* error routine */
|
19
|
+
void GRHFIL_error (){
|
20
|
+
ERROR_MES = "command explanation";
|
21
|
+
print_err ("graph filtering: transform/convert/extract graph/subgraph\n\
|
22
|
+
grhfil dDUBeEq [options] input-file output-file\n\
|
23
|
+
%%:show progress, _:no message, +:write solutions in append mode\n\
|
24
|
+
d:directed graph (x->y), D:directed graph with reverse direction (x<-y)\n\
|
25
|
+
U,u:undirected graph (u:edge for both direction), B:bipartite graph, e,E:read/write file as edge list\n\
|
26
|
+
s,S:sort vertex adjacent list in increasing/decreasing order\n\
|
27
|
+
n,N:read/write the number of vertices and edges written in/at 1st line of the file\n\
|
28
|
+
v,V:node ID in read/write file starts from 1, q:non-transform mode (valid with -P option)\n\
|
29
|
+
0:insert vertex ID as the first entry, for each vertex (adjacency list mode)\n\
|
30
|
+
9:give weight 1 to each vertex ID (with 0)\n\
|
31
|
+
w,W:read/write edge weights in the graph file\n\
|
32
|
+
1:unify consecutive two same numbers into one\n\
|
33
|
+
[options]\n\
|
34
|
+
-t,T [num]: remove vertices with degree smaller/larger then [num]\n\
|
35
|
+
-i,I [num]: remove vertices with in-degree smaller/larger then [num]\n\
|
36
|
+
-o,O [num]: remove vertices with out-degree smaller/larger then [num]\n\
|
37
|
+
-r,R [num]: remove edges with weights smaller/larger then [num]\n\
|
38
|
+
-n [num]: specify #nodes\n\
|
39
|
+
-X [num1] [num2]: multiply each weight by [num1] and trancate by [num2]\n\
|
40
|
+
-w,W [filename]: weight file to be read/write\n\
|
41
|
+
-d [filename]: take difference with graph of [filename] (2nd -d: specify the threshold value)\n\
|
42
|
+
-m,M [filename]: take intersection/union with graph of [filename]\n\
|
43
|
+
-p [filename]: permute the vertex ID to coutinuous numbering and output the permutation table to the file\n\
|
44
|
+
-Q [filename]: permute the numbers in the file according to the table \n");
|
45
|
+
EXIT;
|
46
|
+
}
|
47
|
+
|
48
|
+
int GRHFIL_read_param_iter (char *a, int *ff){
|
49
|
+
int f=0;
|
50
|
+
*ff = 2;
|
51
|
+
if ( strchr(a, 'u') ){ f |= LOAD_EDGE; *ff = 0; }
|
52
|
+
if ( strchr(a, 'U') ) *ff = 0;
|
53
|
+
if ( strchr(a, 'B') ){ f |= LOAD_BIPARTITE; *ff = 1; }
|
54
|
+
if ( strchr(a, 'D') ){ *ff = -1; f |= LOAD_TPOSE; }
|
55
|
+
if ( strchr(a, 'd') ) *ff = 1;
|
56
|
+
if ( strchr(a, 'e') ) f |= LOAD_ELE;
|
57
|
+
if ( strchr(a, 's') ) f |= LOAD_INCSORT;
|
58
|
+
if ( strchr(a, 'S') ) f |= LOAD_DECSORT;
|
59
|
+
if ( strchr(a, 'n') ) f |= LOAD_GRAPHNUM;
|
60
|
+
if ( strchr(a, 'w') ) f |= LOAD_EDGEW;
|
61
|
+
if ( strchr(a, 'v') ) f |= LOAD_ID1;
|
62
|
+
return (f);
|
63
|
+
}
|
64
|
+
|
65
|
+
/* read filenames from command line parameters */
|
66
|
+
void GRHFIL_read_param (PROBLEM *PP, int argc, char *argv[]){
|
67
|
+
int c=1;
|
68
|
+
FSTAR *FS = &PP->FS;
|
69
|
+
if ( argc<c+3 ){ GRHFIL_error (); return; }
|
70
|
+
FS->edge_dir = 2;
|
71
|
+
|
72
|
+
if ( !strchr (argv[c], '_') ){ FS->flag |= SHOW_MESSAGE; }
|
73
|
+
if ( strchr (argv[c], '+') ) PP->II.flag |= ITEMSET_APPEND;
|
74
|
+
|
75
|
+
FS->flag |= GRHFIL_read_param_iter (argv[c], &FS->edge_dir);
|
76
|
+
|
77
|
+
if ( strchr(argv[c], 'u') ) PP->problem |= LOAD_EDGE;
|
78
|
+
|
79
|
+
if ( strchr(argv[c], 'E') ) PP->problem |= LOAD_ELE;
|
80
|
+
if ( strchr(argv[c], 'N') ) PP->problem |= LOAD_GRAPHNUM;
|
81
|
+
if ( strchr(argv[c], 'W') ) PP->problem |= LOAD_EDGEW;
|
82
|
+
if ( strchr(argv[c], 'V') ) PP->problem |= LOAD_ID1;
|
83
|
+
if ( strchr(argv[c], 'q') ){ PP->dir = 1; FS->edge_dir = 0; }
|
84
|
+
if ( strchr(argv[c], '0') ){ PP->problem |= FSTAR_INS_ROWID; }
|
85
|
+
if ( strchr(argv[c], '9') ){ PP->problem |= FSTAR_INS_ROWID_WEIGHT; }
|
86
|
+
if ( strchr(argv[c], '1') ){ PP->problem |= LOAD_RM_DUP; }
|
87
|
+
if ( FS->edge_dir == 2 ) error ("one of B, D, d, u or U has to be given", EXIT);
|
88
|
+
|
89
|
+
c++;
|
90
|
+
while ( argv[c][0] == '-' ){
|
91
|
+
switch (argv[c][1]){
|
92
|
+
case 't': FS->deg_lb = atoi(argv[c+1]);
|
93
|
+
break; case 'T': FS->deg_ub = atoi(argv[c+1]);
|
94
|
+
break; case 'i': FS->in_lb = atoi(argv[c+1]);
|
95
|
+
break; case 'I': FS->in_ub = atoi(argv[c+1]);
|
96
|
+
break; case 'o': FS->out_lb = atoi(argv[c+1]);
|
97
|
+
break; case 'O': FS->out_ub = atoi(argv[c+1]);
|
98
|
+
break; case 'r': FS->w_lb = atof(argv[c+1]);
|
99
|
+
break; case 'R': FS->w_ub = atof(argv[c+1]);
|
100
|
+
break; case 'X': PP->ratio = atof(argv[c+1]); PP->th = atof(argv[c+2]); c++;
|
101
|
+
break; case 'w': FS->wfname = argv[c+1];
|
102
|
+
break; case 'W': PP->weight_fname = argv[c+1];
|
103
|
+
break; case 'p': PP->table_fname = argv[c+1];
|
104
|
+
break; case 'Q': PP->table_fname = argv[c+1]; PP->dir =1;
|
105
|
+
break; case 'd': if ( PP->FS2.fname ){
|
106
|
+
PP->th2 = atof(argv[c+1]);
|
107
|
+
PP->root = 4;
|
108
|
+
} else {
|
109
|
+
PP->FS2.fname = argv[c+1];
|
110
|
+
PP->root = 3; PP->th2 = 1;
|
111
|
+
PP->FS2.flag |= GRHFIL_read_param_iter (&argv[c][2], &PP->FS2.edge_dir);
|
112
|
+
printf ("%d \n", GRHFIL_read_param_iter (&argv[c][2], &PP->FS2.edge_dir));
|
113
|
+
if ( PP->FS2.edge_dir == 2 ) PP->FS2.edge_dir = FS->edge_dir; }
|
114
|
+
break; case 'm': PP->FS2.fname = argv[c+1]; PP->root = 1;
|
115
|
+
PP->FS2.flag |= GRHFIL_read_param_iter (&argv[c][2], &PP->FS2.edge_dir);
|
116
|
+
break; case 'M': PP->FS2.fname = argv[c+1]; PP->root = 2;
|
117
|
+
PP->FS2.flag |= GRHFIL_read_param_iter (&argv[c][2], &PP->FS2.edge_dir);
|
118
|
+
break; case 'n': PP->rows = atoi(argv[c+1]);
|
119
|
+
break; case ',': PP->II.separator = argv[c+1][0];
|
120
|
+
break; default: goto NEXT;
|
121
|
+
}
|
122
|
+
c += 2;
|
123
|
+
if ( argc<c+2 ){ GRHFIL_error (); return; }
|
124
|
+
}
|
125
|
+
|
126
|
+
NEXT:;
|
127
|
+
PP->FS.fname = argv[c];
|
128
|
+
PP->output_fname = argv[c+1];
|
129
|
+
print_mes (FS, "input-file %s, output-file %s\n", PP->FS.fname, PP->output_fname);
|
130
|
+
print_mes (FS, "degree threshold: ");
|
131
|
+
if ( FS->deg_lb>0 ) print_mes (FS, FSTAR_INTF" <", FS->deg_lb);
|
132
|
+
if ( FS->deg_lb>0 || FS->deg_ub<FSTAR_INTHUGE) print_mes (FS, " degree ");
|
133
|
+
if ( FS->deg_ub<FSTAR_INTHUGE ) print_mes (FS, "< "FSTAR_INTF" ", FS->deg_ub);
|
134
|
+
|
135
|
+
if ( FS->in_lb>0 ) print_mes (FS, FSTAR_INTF" <", FS->in_lb);
|
136
|
+
if ( FS->in_lb>0 || FS->in_ub<FSTAR_INTHUGE) print_mes (FS, " in-degree ");
|
137
|
+
if ( FS->in_ub<FSTAR_INTHUGE ) print_mes (FS, "< "FSTAR_INTF" ", FS->in_ub);
|
138
|
+
|
139
|
+
if ( FS->out_lb>0 ) print_mes (FS, FSTAR_INTF" <", FS->out_lb);
|
140
|
+
if ( FS->out_lb>0 || FS->out_ub<FSTAR_INTHUGE) print_mes (FS, " out-degree ");
|
141
|
+
if ( FS->out_ub<FSTAR_INTHUGE ) print_mes (FS, "< "FSTAR_INTF" ", FS->out_ub);
|
142
|
+
print_mes (FS, "\n");
|
143
|
+
|
144
|
+
if ( PP->table_fname ) print_mes (FS, "permutation-table-file %s\n", PP->table_fname);
|
145
|
+
|
146
|
+
}
|
147
|
+
|
148
|
+
|
149
|
+
/* main routine */
|
150
|
+
int GRHFIL_main (int argc, char *argv[]){
|
151
|
+
PROBLEM PP;
|
152
|
+
FSTAR *FS = &PP.FS;
|
153
|
+
FILE2 fp, fp2;
|
154
|
+
LONG l, x;
|
155
|
+
char i;
|
156
|
+
WEIGHT w;
|
157
|
+
PROBLEM_init (&PP);
|
158
|
+
GRHFIL_read_param (&PP, argc, argv);
|
159
|
+
FS->out_node_num = PP.rows;
|
160
|
+
if ( PP.dir ) ARY_LOAD (PP.FS.table, int, l, PP.table_fname, 1, EXIT);
|
161
|
+
|
162
|
+
// no transformation (just replace the numbers and separators)
|
163
|
+
if ( PP.dir ){
|
164
|
+
FILE2_open (fp, FS->fname, "r", EXIT);
|
165
|
+
FILE2_open (fp2, PP.output_fname, "w", EXIT);
|
166
|
+
do {
|
167
|
+
i=0; x=0;
|
168
|
+
do {
|
169
|
+
l = FILE2_read_int (&fp);
|
170
|
+
if ( (FILE_err&4)==0 ){
|
171
|
+
FILE2_print_int (&fp2, FS->table? FS->table[l]: l, i);
|
172
|
+
i = PP.II.separator;
|
173
|
+
if ( (FS->flag&LOAD_EDGEW) && (((FS->flag&LOAD_ELE)&&x==1) || !(FS->flag&LOAD_ELE)) ){
|
174
|
+
w = FILE2_read_double (&fp);
|
175
|
+
FILE2_print_int (&fp2, w, i);
|
176
|
+
}
|
177
|
+
FILE2_flush (&fp2);
|
178
|
+
}
|
179
|
+
x++;
|
180
|
+
} while ( (FILE_err&3)==0 );
|
181
|
+
FILE2_puts (&fp2, "\n");
|
182
|
+
} while ( (FILE_err&2)==0 );
|
183
|
+
FILE2_close (&fp);
|
184
|
+
FILE2_closew (&fp2);
|
185
|
+
return (0);
|
186
|
+
}
|
187
|
+
|
188
|
+
PROBLEM_load (&PP);
|
189
|
+
if ( PP.ratio != 0 || PP.th != 0 ){ // multiply & trancate
|
190
|
+
FLOOP (l, 0, FS->edge_num+1){ FS->edge_w[l] *= PP.ratio; ENMIN (FS->edge_w[l], PP.th); }
|
191
|
+
}
|
192
|
+
FS->flag = PP.problem; // +(FS->flag&LOAD_EDGE);
|
193
|
+
if ( !PP.dir ) FSTAR_write_table_file (FS, PP.table_fname);
|
194
|
+
if ( PP.root ) internal_params.l1 = FSTAR_write_graph_operation (FS, &PP.FS2, PP.output_fname, PP.weight_fname, PP.root, PP.th2);
|
195
|
+
else internal_params.l1 = FSTAR_write_graph (FS, PP.output_fname, PP.weight_fname);
|
196
|
+
|
197
|
+
PROBLEM_end (&PP);
|
198
|
+
return (0);
|
199
|
+
}
|
200
|
+
|
201
|
+
/*******************************************************************************/
|
202
|
+
#ifndef _NO_MAIN_
|
203
|
+
#define _NO_MAIN_
|
204
|
+
int main (int argc, char *argv[]){
|
205
|
+
return (GRHFIL_main (argc, argv));
|
206
|
+
}
|
207
|
+
#endif
|
208
|
+
/*******************************************************************************/
|
209
|
+
|
210
|
+
#endif
|
211
|
+
|
212
|
+
|
213
|
+
|