X Tutup
Skip to content

Commit 03c9355

Browse files
committed
Create caching.md
1 parent 9b36978 commit 03c9355

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

structure/caching.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Local PDB Installations
2+
=======================
3+
4+
BioJava can automatically download and install most of the data files required. Those downloads
5+
will happen only once. Future requests for the data file will re-use the local copy.
6+
7+
The main class that provides this functionality is the [AtomCache](http://www.biojava.org/docs/api/org/biojava/bio/structure/align/util/AtomCache.html).
8+
9+
It is hidden inside the StructureIO class, that we already encountered earlier.
10+
11+
<pre>
12+
Structure structure = StructureIO.getStructure("4hhb");
13+
</pre>
14+
15+
is the same as
16+
17+
<pre>
18+
AtomCache cache = new AtomCache();
19+
cache.getStructure("4hhb");
20+
</pre>
21+
22+
23+
## Where are the files getting written to?
24+
25+
By default the AtomCache writes all files into a temporary location (The system temp directory "java.io.tempdir").
26+
27+
If you already have a local PDB installation, or you want to use a more permanent location to store the files,
28+
you can configure the AtomCache by setting the PDB_DIR system property
29+
30+
<pre>
31+
-DPDB_DIR=/wherever/you/want/
32+
</pre>
33+
34+
An alternative is to hard-code the path in this way:
35+
36+
<pre>
37+
AtomCache cache = new AtomCache();
38+
39+
cache.setPath("/path/to/pdb/files/");
40+
</pre>
41+

0 commit comments

Comments
 (0)
X Tutup