-1

Hei, I am trying to use an already existing code to convert a protein PDB file into a GIT vector. I am trying to run it, but it doesn't seem to work. I believe I am just doing it wrong. What I am trying to do is to get the script running so that it can access a folder of pdb files and calculate the GIT vectors.

The preexisting code I want to get running is given here: http://www2.mat.dtu.dk/people/Peter.Roegen/Gauss_Integrals_Tuned.html and the instructions on how to compile and run the code seem fairly simple:

Compile: GIT is compiled entering >gcc GIT.c -lm -O3 -o GIT

Run: To run GIT enter >GIT /path/to/pdb_file_directory/ Averge-gauss_integral_file output.file error.file

I have not really worked with C before and all my attempts of getting it to run failed. I use a Mac and normally code in python. I downloaded the Command line tools for Xcode and made sure gcc was installed. From what I understand this is enough to compile the c file. I got the Git.c from the above website but running it lead to a bunch of errors:


(base) Jennifers-MBP:Binf jenniferan$ gcc Git.c -lm -O3 -o GIT 
Git.c:1808:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main(int argc, char *argv[])
^
Git.c:1823:7: error: non-void function 'main' should return a value [-Wreturn-type]
      return;
      ^
Git.c:1831:7: error: non-void function 'main' should return a value [-Wreturn-type]
      return;
      ^
Git.c:1837:7: error: non-void function 'main' should return a value [-Wreturn-type]
      return;
      ^
Git.c:1844:7: error: non-void function 'main' should return a value [-Wreturn-type]
      return;
      ^
Git.c:1850:143: warning: format specifies type 'long *' but the argument has type 'int *' [-Wformat]
      sscanf(line,"%li %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf\n",&nres,&inv[0],&inv[1]...
                   ~~~                                                                                                                        ^~~~~
                   %i
Git.c:1858:11: error: non-void function 'main' should return a value [-Wreturn-type]
          return;
          ^
Git.c:1867:7: error: non-void function 'main' should return a value [-Wreturn-type]
      return ;
      ^
2 warnings and 6 errors generated.

After that I just tried the next step, which also didn't work:

(base) Jennifers-MBP:Binf jenniferan$ >GIT /Users/jenniferan/Desktop/Binf/ Averge-gauss_integral_file output.file error.file
bash: /Users/jenniferan/Desktop/Binf/: is a directory
(base) Jennifers-MBP:Binf jenniferan$ 

("Binf" is the fold my .pdb files is located in).

Maybe it is a mistake to do this in the terminal, maybe it's something else. I just have no clue at all how I can successfully run this script.

Do you guys have any advice?

Jennan
  • 89
  • 11
  • 1
    What is a "C script"? – Klaus D. Dec 19 '19 at 01:48
  • The compilation step failed. The code is not written properly (at least not to modern C standards). Edit the source code to make `main` return an `int` and then wherever you see `return` in that function change it to `return 0` (that's probably not the right value to return in all cases but should do for now). – kaylum Dec 19 '19 at 01:51

1 Answers1

0

line 1850: change that first '%li' to '%d';

Git.c:1850:143: warning: format specifies type 'long *' but the argument has type 'int *' [-Wformat]
      sscanf(line,"%li %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf\n",&nres,&inv[0],&inv[1]...

change line 1858 to

int main(int argc, char *argv[])

change the very last line from:

}

to

return 0;
}

They try compiling it again

Hakachukai
  • 90
  • 6