Skip to content

Commit cfe334b

Browse files
committed
using java syntax highlighting
1 parent 7115db2 commit cfe334b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

structure/mmcif.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ BioJava provides you with both a mmCIF parser and a data model that reads PDB an
1919

2020
The simplest way to load a PDB file is by using the [StructureIO](http://www.biojava.org/docs/api/org/biojava3/structure/StructureIO.html) class.
2121

22-
<pre>
22+
```java
2323
Structure structure = StructureIO.getStructure("4HHB");
2424
// and let's print out how many atoms are in this structure
2525
System.out.println(StructureTools.getNrAtoms(structure));
26-
</pre>
26+
```
2727

2828

2929

@@ -42,7 +42,7 @@ If you already have a local PDB installation, you can configure where BioJava sh
4242

4343
By default BioJava is using the PDB file format for parsing data. In order to switch it to use mmCIF, we can take control over the underlying [AtomCache](http://www.biojava.org/docs/api/org/biojava/bio/structure/align/util/AtomCache.html) which manages your PDB (and btw. also SCOP, CATH) installations.
4444

45-
<pre>
45+
```java
4646
AtomCache cache = new AtomCache();
4747

4848
cache.setUseMmCif(true);
@@ -57,15 +57,15 @@ By default BioJava is using the PDB file format for parsing data. In order to sw
5757

5858
// and let's count how many chains are in this structure.
5959
System.out.println(structure.getChains().size());
60-
</pre>
60+
```
6161

6262
As you can see, the AtomCache will again download the missing mmCIF file for 4HHB in the background.
6363

6464
## Low level access
6565

6666
If you want to learn how to use the BioJava mmCIF parser to populate your own data structure, let's first take a look this lower-level code:
6767

68-
<pre>
68+
```java
6969
InputStream inStream = new FileInputStream(fileName);
7070

7171
MMcifParser parser = new SimpleMMcifParser();
@@ -84,7 +84,7 @@ If you want to learn how to use the BioJava mmCIF parser to populate your own da
8484

8585
// now get the protein structure.
8686
Structure cifStructure = consumer.getStructure();
87-
</pre>
87+
```
8888

8989
The parser operates similar to a XML parser by triggering "events". The [SimpleMMcifConsumer](http://www.biojava.org/docs/api/org/biojava/bio/structure/io/mmcif/SimpleMMcifConsumer.html) listens to new categories being read from the file and then builds up the BioJava data model.
9090

0 commit comments

Comments
 (0)