Question: Generating Sequence From Pdb File Using Biojava
1
gravatar for potassiumiodide0990
6.5 years ago by
United States
potassiumiodide099080 wrote:
import java.util.Map;
import org.biojava.bio.structure.*;
import org.biojava.bio.structure.io.PDBFileReader;
import org.biojava3.core.sequence.ProteinSequence;
import org.biojava.bio.structure.io.StructureSequenceMatcher;
public class sequence {
   PDBFileReader pdbreader = new PDBFileReader();
   StructureSequenceMatcher sqm = new StructureSequenceMatcher();
   Structure structure = null;
   Map<Integer,Group> map= null;
    public sequence()throws Exception
    {
      structure = pdbreader.getStructure("2K25.pdb");
      System.out.println(sqm.getProteinSequenceForStructure(structure, map));

    }

    public static void main(String args[])throws Exception
    {

        new sequence();
    }
}

Error:

Exception in thread "main" java.lang.NoSuchMethodError:       org.biojava.bio.structure.io.SeqRes2AtomAligner.getFullAtomSequence(Ljava/util/List;Ljava/util/Map;)Ljava/lang/String;
at org.biojava.bio.structure.io.StructureSequenceMatcher.getProteinSequenceForStructure(StructureSequenceMatcher.java:64)
at sequence.<init>(sequence.java:15)
at sequence.main(sequence.java:22)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

Hi! I am a newbie to biojava. I was trying my hand at retrieving the protein sequence from the pdb file using structure object. In one of my earlier post, it was suggested to me that all that would be required for this process is, the structure object and an empty map. I tried as instructed, but to no avail. Please help!

pdb biojava sequence • 2.8k views
ADD COMMENTlink modified 6.4 years ago by andreas.prlic290 • written 6.5 years ago by potassiumiodide099080

how did you run the main method ? how was "java" invoked ? (or show us the build.xml if any)

ADD REPLYlink written 6.5 years ago by Pierre Lindenbaum121k

it is just an exception your code looks fine to me.

ADD REPLYlink written 6.5 years ago by Medhat8.4k

so how do i exactly get the code working?

ADD REPLYlink written 6.5 years ago by potassiumiodide099080

IMHO, It's a CLASSPATH or a version problem....

ADD REPLYlink written 6.5 years ago by Pierre Lindenbaum121k
1
gravatar for andreas.prlic
6.4 years ago by
andreas.prlic290
San Diego
andreas.prlic290 wrote:

I would do it like this:

import org.biojava.bio.structure.Chain;
import org.biojava.bio.structure.Structure;
import org.biojava3.structure.StructureIO;

public class DemoLoadSecStruc {
    public static void main(String[] args){

        try {

            Structure s = StructureIO.getStructure("4hhb");

            for ( Chain c : s.getChains()) {

                // only the observed residues
                System.out.println(c.getAtomSequence());

                // print biological sequence
                System.out.println(c.getSeqResSequence());
            }

        } catch (Exception e) {

            e.printStackTrace();
        }        
    }
}

ADD COMMENTlink modified 6.4 years ago • written 6.4 years ago by andreas.prlic290
Please log in to add an answer.

Help
Access

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