| 1 | #define MAXARGS 100 |
|---|
| 2 | |
|---|
| 3 | typedef struct { |
|---|
| 4 | char *str; |
|---|
| 5 | sint *flag; |
|---|
| 6 | int type; |
|---|
| 7 | char **arg; |
|---|
| 8 | } cmd_line_data; |
|---|
| 9 | |
|---|
| 10 | /* |
|---|
| 11 | command line switches |
|---|
| 12 | */ |
|---|
| 13 | sint setoptions = -1; |
|---|
| 14 | sint sethelp = -1; |
|---|
| 15 | sint setinteractive = -1; |
|---|
| 16 | sint setbatch = -1; |
|---|
| 17 | sint setgapopen = -1; |
|---|
| 18 | sint setgapext = -1; |
|---|
| 19 | sint setpwgapopen = -1; |
|---|
| 20 | sint setpwgapext = -1; |
|---|
| 21 | sint setoutorder = -1; |
|---|
| 22 | sint setbootlabels = -1; |
|---|
| 23 | sint setpwmatrix = -1; |
|---|
| 24 | sint setmatrix = -1; |
|---|
| 25 | sint setpwdnamatrix = -1; |
|---|
| 26 | sint setdnamatrix = -1; |
|---|
| 27 | sint setnegative = -1; |
|---|
| 28 | sint setnoweights = -1; |
|---|
| 29 | sint setoutput = -1; |
|---|
| 30 | sint setoutputtree = -1; |
|---|
| 31 | sint setquicktree = -1; |
|---|
| 32 | sint settype = -1; |
|---|
| 33 | sint setcase = -1; |
|---|
| 34 | sint setseqno = -1; |
|---|
| 35 | |
|---|
| 36 | sint setseqno_range = -1; |
|---|
| 37 | sint setrange = -1; |
|---|
| 38 | |
|---|
| 39 | sint settransweight = -1; |
|---|
| 40 | sint setseed = -1; |
|---|
| 41 | sint setscore = -1; |
|---|
| 42 | sint setwindow = -1; |
|---|
| 43 | sint setktuple = -1; |
|---|
| 44 | sint setkimura = -1; |
|---|
| 45 | sint settopdiags = -1; |
|---|
| 46 | sint setpairgap = -1; |
|---|
| 47 | sint settossgaps = -1; |
|---|
| 48 | sint setnopgap = -1; |
|---|
| 49 | sint setnohgap = -1; |
|---|
| 50 | sint setnovgap = -1; |
|---|
| 51 | sint sethgapres = -1; |
|---|
| 52 | sint setvgapres = -1; |
|---|
| 53 | sint setuseendgaps = -1; |
|---|
| 54 | sint setmaxdiv = -1; |
|---|
| 55 | sint setgapdist = -1; |
|---|
| 56 | sint setdebug = -1; |
|---|
| 57 | sint setoutfile = -1; |
|---|
| 58 | sint setinfile = -1; |
|---|
| 59 | sint setprofile1 = -1; |
|---|
| 60 | sint setprofile2 = -1; |
|---|
| 61 | sint setalign = -1; |
|---|
| 62 | sint setconvert = -1; |
|---|
| 63 | sint setnewtree = -1; |
|---|
| 64 | sint setusetree = -1; |
|---|
| 65 | sint setnewtree1 = -1; |
|---|
| 66 | sint setusetree1 = -1; |
|---|
| 67 | sint setnewtree2 = -1; |
|---|
| 68 | sint setusetree2 = -1; |
|---|
| 69 | sint setbootstrap = -1; |
|---|
| 70 | sint settree = -1; |
|---|
| 71 | sint setprofile = -1; |
|---|
| 72 | sint setsequences = -1; |
|---|
| 73 | sint setsecstr1 = -1; |
|---|
| 74 | sint setsecstr2 = -1; |
|---|
| 75 | sint setsecstroutput = -1; |
|---|
| 76 | sint sethelixgap = -1; |
|---|
| 77 | sint setstrandgap = -1; |
|---|
| 78 | sint setloopgap = -1; |
|---|
| 79 | sint setterminalgap = -1; |
|---|
| 80 | sint sethelixendin = -1; |
|---|
| 81 | sint sethelixendout = -1; |
|---|
| 82 | sint setstrandendin = -1; |
|---|
| 83 | sint setstrandendout = -1; |
|---|
| 84 | |
|---|
| 85 | /* |
|---|
| 86 | multiple alignment parameters |
|---|
| 87 | */ |
|---|
| 88 | float dna_gap_open = 15.0, dna_gap_extend = 6.66; |
|---|
| 89 | float prot_gap_open = 10.0, prot_gap_extend = 0.2; |
|---|
| 90 | sint profile_type = PROFILE; |
|---|
| 91 | sint gap_dist = 4; |
|---|
| 92 | sint output_order = ALIGNED; |
|---|
| 93 | sint divergence_cutoff = 30; |
|---|
| 94 | sint matnum = 3; |
|---|
| 95 | char mtrxname[FILENAMELEN+1] = "gonnet"; |
|---|
| 96 | sint dnamatnum = 1; |
|---|
| 97 | char dnamtrxname[FILENAMELEN+1] = "iub"; |
|---|
| 98 | char hyd_residues[] = "GPSNDQEKR"; |
|---|
| 99 | Boolean no_weights = FALSE; |
|---|
| 100 | Boolean neg_matrix = FALSE; |
|---|
| 101 | Boolean no_hyd_penalties = FALSE; |
|---|
| 102 | Boolean no_var_penalties = TRUE; |
|---|
| 103 | Boolean no_pref_penalties = FALSE; |
|---|
| 104 | Boolean use_endgaps = FALSE; |
|---|
| 105 | Boolean endgappenalties = FALSE; |
|---|
| 106 | Boolean reset_alignments_new = FALSE; /* DES */ |
|---|
| 107 | Boolean reset_alignments_all = FALSE; /* DES */ |
|---|
| 108 | sint output_struct_penalties = 0; |
|---|
| 109 | sint struct_penalties1 = NONE; |
|---|
| 110 | sint struct_penalties2 = NONE; |
|---|
| 111 | Boolean use_ss1 = TRUE; |
|---|
| 112 | Boolean use_ss2 = TRUE; |
|---|
| 113 | sint helix_penalty = 4; |
|---|
| 114 | sint strand_penalty = 4; |
|---|
| 115 | sint loop_penalty = 1; |
|---|
| 116 | sint helix_end_minus = 3; |
|---|
| 117 | sint helix_end_plus = 0; |
|---|
| 118 | sint strand_end_minus = 1; |
|---|
| 119 | sint strand_end_plus = 1; |
|---|
| 120 | sint helix_end_penalty = 2; |
|---|
| 121 | sint strand_end_penalty = 2; |
|---|
| 122 | Boolean use_ambiguities = FALSE; |
|---|
| 123 | |
|---|
| 124 | /* |
|---|
| 125 | pairwise alignment parameters |
|---|
| 126 | */ |
|---|
| 127 | float dna_pw_go_penalty = 15.0, dna_pw_ge_penalty = 6.66; |
|---|
| 128 | float prot_pw_go_penalty = 10.0, prot_pw_ge_penalty = 0.1; |
|---|
| 129 | sint pw_matnum = 3; |
|---|
| 130 | char pw_mtrxname[FILENAMELEN+1] = "gonnet"; |
|---|
| 131 | sint pw_dnamatnum = 1; |
|---|
| 132 | char pw_dnamtrxname[FILENAMELEN+1] = "iub"; |
|---|
| 133 | char usermtrxname[FILENAMELEN+1], pw_usermtrxname[FILENAMELEN+1]; |
|---|
| 134 | char dnausermtrxname[FILENAMELEN+1], pw_dnausermtrxname[FILENAMELEN+1]; |
|---|
| 135 | |
|---|
| 136 | Boolean quick_pairalign = FALSE; |
|---|
| 137 | float transition_weight = 0.5; |
|---|
| 138 | sint new_seq; |
|---|
| 139 | |
|---|
| 140 | /* |
|---|
| 141 | quick pairwise alignment parameters |
|---|
| 142 | */ |
|---|
| 143 | sint dna_ktup = 2; /* default parameters for DNA */ |
|---|
| 144 | sint dna_wind_gap = 5; |
|---|
| 145 | sint dna_signif = 4; |
|---|
| 146 | sint dna_window = 4; |
|---|
| 147 | |
|---|
| 148 | sint prot_ktup = 1; /* default parameters for proteins */ |
|---|
| 149 | sint prot_wind_gap = 3; |
|---|
| 150 | sint prot_signif = 5; |
|---|
| 151 | sint prot_window = 5; |
|---|
| 152 | Boolean percent=TRUE; |
|---|
| 153 | Boolean tossgaps = FALSE; |
|---|
| 154 | Boolean kimura = FALSE; |
|---|
| 155 | |
|---|
| 156 | |
|---|
| 157 | sint boot_ntrials = 1000; |
|---|
| 158 | unsigned sint boot_ran_seed = 111; |
|---|
| 159 | |
|---|
| 160 | |
|---|
| 161 | sint debug = 0; |
|---|
| 162 | |
|---|
| 163 | Boolean explicit_dnaflag = FALSE; /* Explicit setting of sequence type on comm.line*/ |
|---|
| 164 | Boolean lowercase = TRUE; /* Flag for GDE output - set on comm. line*/ |
|---|
| 165 | Boolean cl_seq_numbers = FALSE; |
|---|
| 166 | |
|---|
| 167 | Boolean seqRange = FALSE; /* Ramu */ |
|---|
| 168 | |
|---|
| 169 | Boolean output_clustal = TRUE; |
|---|
| 170 | Boolean output_gcg = FALSE; |
|---|
| 171 | Boolean output_phylip = FALSE; |
|---|
| 172 | Boolean output_nbrf = FALSE; |
|---|
| 173 | Boolean output_gde = FALSE; |
|---|
| 174 | Boolean output_nexus = FALSE; |
|---|
| 175 | Boolean output_fasta = FALSE; |
|---|
| 176 | |
|---|
| 177 | Boolean showaln = TRUE; |
|---|
| 178 | Boolean save_parameters = FALSE; |
|---|
| 179 | |
|---|
| 180 | /* DES */ |
|---|
| 181 | Boolean output_tree_clustal = FALSE; |
|---|
| 182 | Boolean output_tree_phylip = TRUE; |
|---|
| 183 | Boolean output_tree_distances = FALSE; |
|---|
| 184 | Boolean output_tree_nexus = FALSE; |
|---|
| 185 | Boolean output_pim = FALSE; |
|---|
| 186 | |
|---|
| 187 | |
|---|
| 188 | sint bootstrap_format = BS_BRANCH_LABELS; |
|---|
| 189 | |
|---|
| 190 | /*These are all the positively scoring groups that occur in the Gonnet Pam250 |
|---|
| 191 | matrix. There are strong and weak groups, defined as strong score >0.5 and |
|---|
| 192 | weak score =<0.5. Strong matching columns to be assigned ':' and weak matches |
|---|
| 193 | assigned '.' in the clustal output format. |
|---|
| 194 | */ |
|---|
| 195 | |
|---|
| 196 | char *res_cat1[] = { |
|---|
| 197 | "STA", |
|---|
| 198 | "NEQK", |
|---|
| 199 | "NHQK", |
|---|
| 200 | "NDEQ", |
|---|
| 201 | "QHRK", |
|---|
| 202 | "MILV", |
|---|
| 203 | "MILF", |
|---|
| 204 | "HY", |
|---|
| 205 | "FYW", |
|---|
| 206 | NULL }; |
|---|
| 207 | |
|---|
| 208 | char *res_cat2[] = { |
|---|
| 209 | "CSA", |
|---|
| 210 | "ATV", |
|---|
| 211 | "SAG", |
|---|
| 212 | "STNK", |
|---|
| 213 | "STPA", |
|---|
| 214 | "SGND", |
|---|
| 215 | "SNDEQK", |
|---|
| 216 | "NDEQHK", |
|---|
| 217 | "NEQHRK", |
|---|
| 218 | "FVLIM", |
|---|
| 219 | "HFY", |
|---|
| 220 | NULL }; |
|---|
| 221 | |
|---|
| 222 | |
|---|
| 223 | |
|---|
| 224 | static char *type_arg[] = { |
|---|
| 225 | "protein", |
|---|
| 226 | "dna", |
|---|
| 227 | ""}; |
|---|
| 228 | |
|---|
| 229 | static char *bootlabels_arg[] = { |
|---|
| 230 | "node", |
|---|
| 231 | "branch", |
|---|
| 232 | ""}; |
|---|
| 233 | |
|---|
| 234 | static char *outorder_arg[] = { |
|---|
| 235 | "input", |
|---|
| 236 | "aligned", |
|---|
| 237 | ""}; |
|---|
| 238 | |
|---|
| 239 | static char *case_arg[] = { |
|---|
| 240 | "lower", |
|---|
| 241 | "upper", |
|---|
| 242 | ""}; |
|---|
| 243 | |
|---|
| 244 | static char *seqno_arg[] = { |
|---|
| 245 | "off", |
|---|
| 246 | "on", |
|---|
| 247 | ""}; |
|---|
| 248 | |
|---|
| 249 | static char *seqno_range_arg[] = { |
|---|
| 250 | "off", |
|---|
| 251 | "on", |
|---|
| 252 | ""}; |
|---|
| 253 | |
|---|
| 254 | static char *score_arg[] = { |
|---|
| 255 | "percent", |
|---|
| 256 | "absolute", |
|---|
| 257 | ""}; |
|---|
| 258 | |
|---|
| 259 | static char *output_arg[] = { |
|---|
| 260 | "gcg", |
|---|
| 261 | "gde", |
|---|
| 262 | "pir", |
|---|
| 263 | "phylip", |
|---|
| 264 | "nexus", |
|---|
| 265 | "fasta", |
|---|
| 266 | ""}; |
|---|
| 267 | |
|---|
| 268 | static char *outputtree_arg[] = { |
|---|
| 269 | "nj", |
|---|
| 270 | "phylip", |
|---|
| 271 | "dist", |
|---|
| 272 | "nexus", |
|---|
| 273 | ""}; |
|---|
| 274 | |
|---|
| 275 | static char *outputsecstr_arg[] = { |
|---|
| 276 | "structure", |
|---|
| 277 | "mask", |
|---|
| 278 | "both", |
|---|
| 279 | "none", |
|---|
| 280 | ""}; |
|---|
| 281 | |
|---|
| 282 | /* |
|---|
| 283 | command line initialisation |
|---|
| 284 | |
|---|
| 285 | type = 0 no argument |
|---|
| 286 | type = 1 integer argument |
|---|
| 287 | type = 2 float argument |
|---|
| 288 | type = 3 string argument |
|---|
| 289 | type = 4 filename |
|---|
| 290 | type = 5 opts |
|---|
| 291 | */ |
|---|
| 292 | #define NOARG 0 |
|---|
| 293 | #define INTARG 1 |
|---|
| 294 | #define FLTARG 2 |
|---|
| 295 | #define STRARG 3 |
|---|
| 296 | #define FILARG 4 |
|---|
| 297 | #define OPTARG 5 |
|---|
| 298 | |
|---|
| 299 | |
|---|
| 300 | /* command line switches for DATA **************************/ |
|---|
| 301 | cmd_line_data cmd_line_file[] = { |
|---|
| 302 | "infile", &setinfile, FILARG, NULL, |
|---|
| 303 | "profile1", &setprofile1, FILARG, NULL, |
|---|
| 304 | "profile2", &setprofile2, FILARG, NULL, |
|---|
| 305 | "", NULL, -1}; |
|---|
| 306 | /* command line switches for VERBS **************************/ |
|---|
| 307 | cmd_line_data cmd_line_verb[] = { |
|---|
| 308 | "help", &sethelp, NOARG, NULL, |
|---|
| 309 | "check", &sethelp, NOARG, NULL, |
|---|
| 310 | "options", &setoptions, NOARG, NULL, |
|---|
| 311 | "align", &setalign, NOARG, NULL, |
|---|
| 312 | "newtree", &setnewtree, FILARG, NULL, |
|---|
| 313 | "usetree", &setusetree, FILARG, NULL, |
|---|
| 314 | "newtree1", &setnewtree1, FILARG, NULL, |
|---|
| 315 | "usetree1", &setusetree1, FILARG, NULL, |
|---|
| 316 | "newtree2", &setnewtree2, FILARG, NULL, |
|---|
| 317 | "usetree2", &setusetree2, FILARG, NULL, |
|---|
| 318 | "bootstrap", &setbootstrap, NOARG, NULL, |
|---|
| 319 | "tree", &settree, NOARG, NULL, |
|---|
| 320 | "quicktree", &setquicktree, NOARG, NULL, |
|---|
| 321 | "convert", &setconvert, NOARG, NULL, |
|---|
| 322 | "interactive", &setinteractive, NOARG, NULL, |
|---|
| 323 | "batch", &setbatch, NOARG, NULL, |
|---|
| 324 | "", NULL, -1}; |
|---|
| 325 | /* command line switches for PARAMETERS **************************/ |
|---|
| 326 | cmd_line_data cmd_line_para[] = { |
|---|
| 327 | "type", &settype, OPTARG, type_arg, |
|---|
| 328 | "profile", &setprofile, NOARG, NULL, |
|---|
| 329 | "sequences", &setsequences, NOARG, NULL, |
|---|
| 330 | "matrix", &setmatrix, FILARG, NULL, |
|---|
| 331 | "dnamatrix", &setdnamatrix, FILARG, NULL, |
|---|
| 332 | "negative", &setnegative, NOARG, NULL, |
|---|
| 333 | "noweights", &setnoweights, NOARG, NULL, |
|---|
| 334 | "gapopen", &setgapopen, FLTARG, NULL, |
|---|
| 335 | "gapext", &setgapext, FLTARG, NULL, |
|---|
| 336 | "endgaps", &setuseendgaps, NOARG, NULL, |
|---|
| 337 | "nopgap", &setnopgap, NOARG, NULL, |
|---|
| 338 | "nohgap", &setnohgap, NOARG, NULL, |
|---|
| 339 | "novgap", &setnovgap, NOARG, NULL, |
|---|
| 340 | "hgapresidues", &sethgapres, STRARG, NULL, |
|---|
| 341 | "maxdiv", &setmaxdiv, INTARG, NULL, |
|---|
| 342 | |
|---|
| 343 | "gapdist", &setgapdist, INTARG, NULL, |
|---|
| 344 | "pwmatrix", &setpwmatrix, FILARG, NULL, |
|---|
| 345 | "pwdnamatrix", &setpwdnamatrix, FILARG, NULL, |
|---|
| 346 | "pwgapopen", &setpwgapopen, FLTARG, NULL, |
|---|
| 347 | "pwgapext", &setpwgapext, FLTARG, NULL, |
|---|
| 348 | "ktuple", &setktuple, INTARG, NULL, |
|---|
| 349 | "window", &setwindow, INTARG, NULL, |
|---|
| 350 | "pairgap", &setpairgap, INTARG, NULL, |
|---|
| 351 | "topdiags", &settopdiags, INTARG, NULL, |
|---|
| 352 | "score", &setscore, OPTARG, score_arg, |
|---|
| 353 | "transweight", &settransweight, FLTARG, NULL, |
|---|
| 354 | "seed", &setseed, INTARG, NULL, |
|---|
| 355 | "kimura", &setkimura, NOARG, NULL, |
|---|
| 356 | "tossgaps", &settossgaps, NOARG, NULL, |
|---|
| 357 | "bootlabels", &setbootlabels, OPTARG, bootlabels_arg, |
|---|
| 358 | "debug", &setdebug, INTARG, NULL, |
|---|
| 359 | "output", &setoutput, OPTARG, output_arg, |
|---|
| 360 | "outputtree", &setoutputtree, OPTARG, outputtree_arg, |
|---|
| 361 | "outfile", &setoutfile, FILARG, NULL, |
|---|
| 362 | "outorder", &setoutorder, OPTARG, outorder_arg, |
|---|
| 363 | "case", &setcase, OPTARG, case_arg, |
|---|
| 364 | "seqnos", &setseqno, OPTARG, seqno_arg, |
|---|
| 365 | |
|---|
| 366 | "seqno_range", &setseqno_range, OPTARG, seqno_range_arg, /* this one should be on/off and */ |
|---|
| 367 | "range", &setrange, STRARG, NULL, /* this one should be like 10:20 , messy option settings */ |
|---|
| 368 | |
|---|
| 369 | "nosecstr1", &setsecstr1, NOARG, NULL, |
|---|
| 370 | "nosecstr2", &setsecstr2, NOARG, NULL, |
|---|
| 371 | "secstrout", &setsecstroutput, OPTARG, outputsecstr_arg, |
|---|
| 372 | "helixgap", &sethelixgap, INTARG, NULL, |
|---|
| 373 | "strandgap", &setstrandgap, INTARG, NULL, |
|---|
| 374 | "loopgap", &setloopgap, INTARG, NULL, |
|---|
| 375 | "terminalgap", &setterminalgap, INTARG, NULL, |
|---|
| 376 | "helixendin", &sethelixendin, INTARG, NULL, |
|---|
| 377 | "helixendout", &sethelixendout, INTARG, NULL, |
|---|
| 378 | "strandendin", &setstrandendin, INTARG, NULL, |
|---|
| 379 | "strandendout",&setstrandendout, INTARG, NULL, |
|---|
| 380 | |
|---|
| 381 | "", NULL, -1}; |
|---|
| 382 | |
|---|
| 383 | |
|---|