Skip to content

Commit 592f1fe

Browse files
committed
Changing docs to solve issue biojava#27
1 parent ffc8f4b commit 592f1fe

File tree

1 file changed

+11
-24
lines changed

1 file changed

+11
-24
lines changed

structure/chemcomp.md

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The Chemical Component Dictionary
22
=================================
33

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.
55

66
### How Does BioJava Decide what Groups Are Amino Acids?
77

@@ -52,36 +52,23 @@ As you can see, although MSE is flaged as HETATM in the PDB file, BioJava still
5252

5353
### How to Access Chemical Component Definitions
5454

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.
5656

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:
6158

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.
6260
```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());
7862
```
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)
8264
```java
8365
ChemCompGroupFactory.setChemCompProvider(new AllChemCompProvider());
8466
```
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+
8572

8673
<!--automatically generated footer-->
8774

0 commit comments

Comments
 (0)