|
1 | 1 | The Chemical Component Dictionary |
2 | 2 | ================================= |
3 | 3 |
|
4 | | -The [Chemical Component Dictionary](http://www.wwpdb.org/ccd.html) is an external reference file describing all residue and small molecule components found in PDB entries. This dictionary contains detailed chemical descriptions for standard and modified amino acids/nucleotides, small molecule ligands, and solvent molecules. |
| 4 | +The [Chemical Component Dictionary](http://www.wwpdb.org/ccd.html) is an external reference file describing all residue and small molecule components found in PDB entries. This dictionary contains detailed chemical descriptions for standard and modified amino acids/nucleotides, small molecule ligands, and solvent molecules. |
5 | 5 |
|
6 | 6 | ### How Does BioJava Decide what Groups Are Amino Acids? |
7 | 7 |
|
@@ -52,36 +52,23 @@ As you can see, although MSE is flaged as HETATM in the PDB file, BioJava still |
52 | 52 |
|
53 | 53 | ### How to Access Chemical Component Definitions |
54 | 54 |
|
55 | | -By default BioJava ships with a minimal representation of standard amino acids, which is useful when you just want to work with atoms and a basic data representation. However if you want to work with a correct representation (e.g. distinguish ligands from the polypeptide chain, correctly resolve chemically modified residues), it is good to tell the library to either |
| 55 | +By default BioJava will retrieve the full chemical component definitions provided by the Protein Data Bank (see http://www.wwpdb.org/data/ccd). That way BioJava makes sure that the user gets a correct representation e.g. distinguish ligands from the polypeptide chain, correctly resolve chemically modified residues, etc. |
56 | 56 |
|
57 | | -1. Fetch missing **Chemical Component Definitions** on the fly (small download and parsing delays every time a new chemical compound is found), or |
58 | | -2. Load all **Chemical Component Definitions** at startup (slow startup, but then no further delays later on, requires more memory) |
59 | | - |
60 | | -You can enable the first behaviour by doing using the [FileParsingParameters](http://www.biojava.org/docs/api/org/biojava/nbio/structure/io/FileParsingParameters.html) class: |
| 57 | +The behaviour is configurable by setting a property in the `ChemCompGroupFactory` singleton: |
61 | 58 |
|
| 59 | +1. Use a minimal built-in set of **Chemical Component Definitions**. Will only deal with most frequent cases of chemical components. Does not guarantee a correct representation, but it is fast and does not require network access. |
62 | 60 | ```java |
63 | | - AtomCache cache = new AtomCache(); |
64 | | - |
65 | | - // by default all files are stored at a temporary location. |
66 | | - // you can set this either via at startup with -DPDB_DIR=/path/to/files/ |
67 | | - // or hard code it this way: |
68 | | - cache.setPath("/tmp/"); |
69 | | - |
70 | | - FileParsingParameters params = new FileParsingParameters(); |
71 | | - |
72 | | - params.setLoadChemCompInfo(true); |
73 | | - cache.setFileParsingParams(params); |
74 | | - |
75 | | - StructureIO.setAtomCache(cache); |
76 | | - |
77 | | - Structure structure = StructureIO.getStructure(...); |
| 61 | + ChemCompGroupFactory.setChemCompProvider(new ReducedChemCompProvider()); |
78 | 62 | ``` |
79 | | - |
80 | | -If you want to enable the second behaviour (slow loading of all chem comps at startup, but no further small delays later on) you can use the same code but change the behaviour by switching the [ChemCompProvider](http://www.biojava.org/docs/api/org/biojava/nbio/structure/io/mmcif/ChemCompProvider.html) implementation in the [ChemCompGroupFactory](http://www.biojava.org/docs/api/org/biojava/nbio/structure/io/mmcif/ChemCompGroupFactory.html) |
81 | | - |
| 63 | +2. Load all **Chemical Component Definitions** at startup (slow startup, but then no further delays later on, requires more memory) |
82 | 64 | ```java |
83 | 65 | ChemCompGroupFactory.setChemCompProvider(new AllChemCompProvider()); |
84 | 66 | ``` |
| 67 | +3. Fetch missing **Chemical Component Definitions** on the fly (small download and parsing delays every time a new chemical compound is found). Default behaviour since 4.2.0. |
| 68 | +```java |
| 69 | + ChemCompGroupFactory.setChemCompProvider(new DownloadChemCompProvider()); |
| 70 | +``` |
| 71 | + |
85 | 72 |
|
86 | 73 | <!--automatically generated footer--> |
87 | 74 |
|
|
0 commit comments