-int u,rflag=0,cflag=0, bflag=0;
-char *filename;
-int numbers;
-double numb;
-extern char *optarg;
-extern int optind, optopt, opterr;
-
-while ((u = getopt(argc, argv, ":r:c:g:b:t:f:o:")) != -1) {
- switch(u) {
- case 'r':
- numbers = atoi(optarg);
- printf("The number of features/rows is %d.\n", numbers);
- row = numbers;
- rflag = 1;
- break;
- case 'c':
- numbers = atoi(optarg);
- printf("The number of samples/columns is %d.\n", numbers);
- col = numbers;
- cflag = 1;
- break;
- case 'g':
- numbers = atoi(optarg);
- printf("Your g-value is %d.\n", numbers);
- g = numbers;
- break;
- case 'b':
- numbers = atoi(optarg);
- printf("The number of permutations is %d\n", numbers);
- B = numbers;
- break;
- case 't':
- numb = atof(optarg);
- printf("Threshold is is %lf\n", numb);
- thresh = numb;
- break;
- case 'f':
- filename = optarg;
- printf("filename input is %s\n", filename);
- strcpy(location,filename);
- break;
- case 'o':
- filename = optarg;
- printf("filename output %s\n", filename);
- strcpy(output,filename);
- break;
- case ':':
- printf("-%c without filename\n", optopt);
- break;
- case '?':
- printf("unknown arg %c\n", optopt);
- break;
- }
-}
-
- FILE *jobj, *out;
- jobj=fopen(location,"r");
-
- if(jobj == NULL){
- printf("Please don't forget to save your matrix in the active");
- printf(" directory as \"%s\".\n",location);
- return 0;
- }
-
- // Gets the first line of samples names and checks for user error.
- fgets(arr,10000,jobj);
-
- for(i=0;i<10000;i++){
- if(isspace(arr[i])){
- counter++; }
- }
-
- if (cflag == 0) {
- printf("You didn't tell us how many subjects there are!\n");
- printf("But we'll still do the analysis as if there are %d subjects.\n\n",col=counter-1);
- }
- if (cflag == 1) {
- if (col != counter-1){
- printf("We would expect %d subjects, but you said %d.\n",counter-1,col);
- }
- }
-
- while((a = fgetc(jobj)) != EOF){
- if(a == '\n'){
- lines++; }
- }