Hi,

I'm trying to use PDBReader class to access a ligand in this PDB file (B12 molecule in 1IWB.pdb file). However I'm not being able to get to this molecule (I only get objects that show the protein sequence). Currently I'm opening a PDBReader from the file mentioned and the rest goes as follows:

DefaultChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
PDBReader pdbR = new PDBReader(new FileReader(input));
ChemFile cof = (ChemFile) builder.newChemFile();;
PDBPolymer pol = new PDBPolymer();

try {
        cof = (ChemFile) pdbR.read(builder.newChemFile());
        for(IChemSequence chemSeq : cof.chemSequences()) {
                for(IChemModel model : chemSeq.chemModels() ) {
                        IMoleculeSet molSet = model.getMoleculeSet();
System.out.println("Number of molecules is: "+molSet.getAtomContainerCount()+" "+molSet.getMoleculeCount());

                        for(IAtomContainer aCont : 
model.getMoleculeSet().molecules()) {
                                PDBPolymer test = (PDBPolymer) aCont;
                                Iterable<IPDBStructure> colStruc = 
test.getStructures();
                                for(IPDBStructure struct : colStruc) {
System.out.println("I'm a "+struct.getStructureType()+" structure.");
                                }
// none of the objects so far provides a method to access that molecule.
                                for(String m : 
test.getMonomerNamesInSequentialOrder() ) {
                                        System.out.println("I'm "+m+"!!");
                                }
                        }
                }
        }
} catch (CDKException) {
        e.printStackTrace();
}
                        

Any help would be welcomed. I think I'm not understanding fully how the PDBReader or other classes nearby are supposed to be used. I'm I missing the use of some listener object or something like that? Does the PDBReader class actually able to read those other molecules (ligands)? From the code it seems to me it should (HETATM parsing). I'm using CDK 1.2.1.

Thanks,
Pablo 
------------------------------------------------------------------------------
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to