Improvements to the code
[jabaws.git] / binaries / src / iupred / iupred.c
index 2d8b274..c5e25a2 100644 (file)
@@ -85,9 +85,10 @@ int main(int argc, char **argv)
   if (argc<2) {
     printf(" Usage: %s seqfile type \n",argv[0]);
     printf("      where type stands for one of the options of \n");
-    printf("      \"long\", \"short\", \"glob\" or \"all\"\n");
+    printf("      \"long\", \"short\", \"glob\". If no type is provided the program assumes all types\n");
     exit(1);
   }
+
   if ((path=getenv("IUPred_PATH"))==NULL) {
     fprintf(stderr,"IUPred_PATH environment variable is not set\n");
     path="./";
@@ -105,8 +106,10 @@ int main(int argc, char **argv)
   printf("#\n");
   printf("#\n");
 
-
-  if ((strncmp(argv[2],"long",4))==0) {
+  if(argv[2]==NULL) {
+    type=3;
+  }
+  else if ((strncmp(argv[2],"long",4))==0) {
     type=0;   
   }
   else if ((strncmp(argv[2],"short",5))==0) {
@@ -115,22 +118,23 @@ int main(int argc, char **argv)
   else if ((strncmp(argv[2],"glob",4))==0) {
     type=2;   
   }
-  else if ((strncmp(argv[2],"all",3))==0) {
-    type=3;   
-  }
   else {
-    printf("No disorder type is given assuming long\n");
+    printf("Cannot recognise disorder type assuming long\n");
     type=0;
   }
 
+  FILE *fasta; 
+
+  if ((fasta=fopen(argv[1],"r"))==NULL) {
+    printf("Could not open %s\n",argv[1]),exit(1);
+  }
+
 /* Creating output files depending on the type */  
   createOutputFiles(type);
 
-
 /* Read input file sequence by sequence */
-   FILE *fasta; 
+
    SEQS *fastaseq; 
-   fasta = fopen(argv[1], "r");
 
    do {