Question: 3D Protein Translation Using Java
gravatar for Hazelin
8.3 years ago by
Hazelin100 wrote:

Hi all,

I need to do a translation using 2D arrays for my Superposition algorithm.


I plan to use the CA as my invariant point which is usually the 2nd line in the pdb.txt file. So how go about doing that? Must I use an orthogonal matrix? Or can I just subtract the coordinates of file1 from file 2 for X, Y & Z to get the rest of the ATOMS to move by that difference? You help is greatly appreciated! :) This program is in JAVA.

while ((text1 = br1.readLine()) != null)   {  //Read File Line By Line

    if(text1.trim().startsWith("ATOM")) {
        StringTokenizer s1 = new StringTokenizer(text1," ");

         int counter1=0;
          String line1="";

          while(s1.hasMoreTokens()) {

            String ss1 = s1.nextToken();

            if(counter1 == 3){
                line1 += ss1;
                arrayM1[i] = ss1;

        coordinates1[i][0]= Double.parseDouble(text1.substring(30,38));//X
        coordinates1[i][1]= Double.parseDouble(text1.substring(38,46));//Y
        coordinates1[i][2]= Double.parseDouble(text1.substring(46,56));//Z

    }//end of if

} //end of while.
java translation algorithm • 1.3k views
ADD COMMENTlink written 8.3 years ago by Hazelin100
gravatar for Egon Willighagen
8.3 years ago by
Egon Willighagen5.2k wrote:

I suggest using an existing PDB parser. The PDB format is quite complex, and doing one from scratch takes a considerable amount of effort. Just parsing ATOM lines will generally not do in the general case, though it might for your case. Existing PDB parser for Java include the one in Jmol and, of course, the one in BioJava.

ADD COMMENTlink written 8.3 years ago by Egon Willighagen5.2k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1069 users visited in the last hour