Bioinformatics - Need to get the ATOMS sequence
I search a method in BioJava to get the Atom sequence from a PDB file. I watched the BioJava API but for the getAtomSequence() 开发者_StackOverflow社区it catches the amino acids. I tried with several other method in BioJava but nothing worked as I want.
Can anybody help me here ?
Thanks
I resolved it ... Solution for the interested :
try{
PDBFileReader read=new PDBFileReader();
Structure pdb=read.getStructure(filename);
System.out.println("PDB code :"+pdb.getPDBCode());
List chains=Collections.synchronizedList(new ArrayList());
chains=pdb.getChains();
for(Iterator iter=chains.iterator();iter.hasNext();){
Chain c=(Chain)(iter.next());
System.out.println("Chain :"+c.getName()+"\n"+"Seq aa :"+c.getAtomSequence());
for(int j=0;j<c.getAtomLength();j++){
for (int k=0; k < c.getAtomGroup(j).size(); k++ ){
Atom a=c.getAtomGroup(j).getAtom(k);
System.out.println("Name : "+a.getName()+" X : "+a.getX()+" Y : "+a.getY()+" Z : "+a.getZ());
}
}
精彩评论