Skip to content

Biojava structutre object not creating ligand bonds #377

Closed

Description

@abradle

Hi all,

The below code prints out empty lists. It doesn't appear to be making bonds for the Ligand ZYB. I don't believe this problem is specific to 4CUP. Am I doing something wrong? Any help would be appreciated.

package org.trial.debug;

import java.io.IOException;

import org.biojava.nbio.structure.Atom;
import org.biojava.nbio.structure.Chain;
import org.biojava.nbio.structure.Group;
import org.biojava.nbio.structure.Structure;
import org.biojava.nbio.structure.StructureException;
import org.biojava.nbio.structure.StructureIO;
import org.biojava.nbio.structure.align.util.AtomCache;
import org.biojava.nbio.structure.io.FileParsingParameters;

public class DebugBioJava {
    public static void main(String[] args) throws IOException, StructureException{
        String pdbId = "4CUP";
        AtomCache cache = new AtomCache();
        cache.setUseMmCif(false);
        FileParsingParameters params = cache.getFileParsingParams();
        params.setLoadChemCompInfo(true);
        params.setCreateAtomBonds(true);
        cache.setFileParsingParams(params);
        StructureIO.setAtomCache(cache);
        Structure s = StructureIO.getStructure(pdbId);
        //Load structure without any SS assignment
        //
        for(Chain c: s.getChains()){
            for(Group g: c.getAtomGroups()){
                if(g.getPDBName().equals("ZYB")){
                    for(Atom a: g.getAtoms()){
                        System.out.println(a.getBonds());
                    }
                }
            }
        }
    }
}

OUTPUT:

[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]

Activity

  1. added this to the BioJava 4.2.0 milestone on Jan 20, 2016
  2. josemduarte commented on Jan 21, 2016

    @josemduarte
    Contributor

    So this turned out to be an issue with the default chemical component provider.

    To solve it one just needs to set the DownloadChemCompProvider before calling AtomCache

    ChemCompGroupFactory.setChemCompProvider(new DownloadChemCompProvider());

    After that, all bonds are correctly populated.

    This points out an important issue discussed already in #313, #314 and #315. In my opinion we should set DownloadChemCompProvider as default. If we don't do that at least a warning should be logged to prevent confusing things like what happened above (empty bonds list).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions