Skip to content

Commit f1bcdb2

Browse files
committed
Removing utility method that shouldn't be here
1 parent 4d1cf58 commit f1bcdb2

4 files changed

Lines changed: 26 additions & 52 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ BioJava 6.0.0 (future release)
1717
* `org.biojava.nbio.structure.PDBStatus`: removed `getReplacement` and `getReplaces`
1818
* Removed `org.biojava.nbio.structure.io.mmcif` package
1919
* Removed functionality to write isolated CIF headers from `FileConvert`
20+
* Removed `org.biojava.nbio.structure.io.mmtf.MmtfUtils.setUpBioJava()`
2021

2122
### Breaking API changes
2223
* Extracted `StructureIO.StructureFiletype` enum to `org.biojava.nbio.structure.io.StructureFiletype` (supports `PDB`, `MMTF`, `CIF`, and `BCIF`)

biojava-structure/src/main/java/demo/DemoMmtfWriter.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@
2727
import org.biojava.nbio.structure.StructureException;
2828
import org.biojava.nbio.structure.StructureIO;
2929
import org.biojava.nbio.structure.io.mmtf.MmtfActions;
30-
import org.biojava.nbio.structure.io.mmtf.MmtfUtils;
3130

3231
public class DemoMmtfWriter {
3332

3433
public static void main(String[] args) throws IOException, StructureException {
35-
MmtfUtils.setUpBioJava();
3634
Structure structure = StructureIO.getStructure("4cup");
3735
MmtfActions.writeToFile(structure, Paths.get("/tmp/4cup.mmtf"));
3836
}

biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfUtils.java

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,9 @@
4545
import org.biojava.nbio.structure.PDBCrystallographicInfo;
4646
import org.biojava.nbio.structure.Structure;
4747
import org.biojava.nbio.structure.StructureException;
48-
import org.biojava.nbio.structure.io.StructureFiletype;
49-
import org.biojava.nbio.structure.StructureIO;
50-
import org.biojava.nbio.structure.align.util.AtomCache;
5148
import org.biojava.nbio.structure.chem.ChemComp;
5249
import org.biojava.nbio.structure.chem.ChemCompGroupFactory;
5350
import org.biojava.nbio.structure.chem.ChemCompTools;
54-
import org.biojava.nbio.structure.chem.DownloadChemCompProvider;
55-
import org.biojava.nbio.structure.io.FileParsingParameters;
5651
import org.biojava.nbio.structure.quaternary.BioAssemblyInfo;
5752
import org.biojava.nbio.structure.quaternary.BiologicalAssemblyTransformation;
5853
import org.biojava.nbio.structure.secstruc.SecStrucCalc;
@@ -74,49 +69,6 @@ public class MmtfUtils {
7469

7570
private static final Logger LOGGER = LoggerFactory.getLogger(MmtfUtils.class);
7671

77-
/**
78-
* Set up the configuration parameters for BioJava.
79-
*/
80-
public static AtomCache setUpBioJava() {
81-
// Set up the atom cache etc
82-
AtomCache cache = new AtomCache();
83-
cache.setFiletype(StructureFiletype.MMTF);
84-
FileParsingParameters params = cache.getFileParsingParams();
85-
params.setCreateAtomBonds(true);
86-
params.setAlignSeqRes(true);
87-
params.setParseBioAssembly(true);
88-
DownloadChemCompProvider cc = new DownloadChemCompProvider();
89-
ChemCompGroupFactory.setChemCompProvider(cc);
90-
cc.checkDoFirstInstall();
91-
cache.setFileParsingParams(params);
92-
StructureIO.setAtomCache(cache);
93-
return cache;
94-
}
95-
96-
/**
97-
* Set up the configuration parameters for BioJava.
98-
* @param extraUrl the string describing the URL (or file path) from which
99-
* to get missing CCD entries.
100-
*/
101-
public static AtomCache setUpBioJava(String extraUrl) {
102-
// Set up the atom cache etc
103-
AtomCache cache = new AtomCache();
104-
cache.setFiletype(StructureFiletype.MMTF);
105-
FileParsingParameters params = cache.getFileParsingParams();
106-
params.setCreateAtomBonds(true);
107-
params.setAlignSeqRes(true);
108-
params.setParseBioAssembly(true);
109-
DownloadChemCompProvider.serverBaseUrl = extraUrl;
110-
DownloadChemCompProvider.useDefaultUrlLayout = false;
111-
DownloadChemCompProvider cc = new DownloadChemCompProvider();
112-
ChemCompGroupFactory.setChemCompProvider(cc);
113-
cc.checkDoFirstInstall();
114-
cache.setFileParsingParams(params);
115-
StructureIO.setAtomCache(cache);
116-
return cache;
117-
}
118-
119-
12072
/**
12173
* This sets all microheterogeneous groups
12274
* (previously alternate location groups) as separate groups.

biojava-structure/src/test/java/org/biojava/nbio/structure/io/mmtf/TestMmtfUtils.java

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
*/
2121
package org.biojava.nbio.structure.io.mmtf;
2222

23+
import org.biojava.nbio.structure.align.util.AtomCache;
24+
import org.biojava.nbio.structure.chem.ChemCompGroupFactory;
25+
import org.biojava.nbio.structure.chem.DownloadChemCompProvider;
26+
import org.biojava.nbio.structure.io.FileParsingParameters;
27+
import org.biojava.nbio.structure.io.StructureFiletype;
2328
import org.junit.Test;
2429

2530
import static org.junit.Assert.*;
@@ -51,7 +56,6 @@
5156
import org.biojava.nbio.structure.StructureException;
5257
import org.biojava.nbio.structure.StructureIO;
5358
import org.biojava.nbio.structure.StructureImpl;
54-
import org.biojava.nbio.structure.io.mmtf.MmtfUtils;
5559
import org.biojava.nbio.structure.quaternary.BioAssemblyInfo;
5660
import org.biojava.nbio.structure.quaternary.BiologicalAssemblyTransformation;
5761
import org.biojava.nbio.structure.xtal.BravaisLattice;
@@ -66,6 +70,25 @@
6670
*/
6771
public class TestMmtfUtils {
6872

73+
/**
74+
* Set up the configuration parameters for BioJava.
75+
*/
76+
public static AtomCache setUpBioJava() {
77+
// Set up the atom cache etc
78+
AtomCache cache = new AtomCache();
79+
cache.setFiletype(StructureFiletype.CIF);
80+
FileParsingParameters params = cache.getFileParsingParams();
81+
params.setCreateAtomBonds(true);
82+
params.setAlignSeqRes(true);
83+
params.setParseBioAssembly(true);
84+
DownloadChemCompProvider cc = new DownloadChemCompProvider();
85+
ChemCompGroupFactory.setChemCompProvider(cc);
86+
cc.checkDoFirstInstall();
87+
cache.setFileParsingParams(params);
88+
StructureIO.setAtomCache(cache);
89+
return cache;
90+
}
91+
6992
/**
7093
* Integration test to see that the microheterogenity is being dealt with correctly.
7194
*
@@ -74,7 +97,7 @@ public class TestMmtfUtils {
7497
*/
7598
@Test
7699
public void microHeterogenity() throws IOException, StructureException {
77-
MmtfUtils.setUpBioJava();
100+
setUpBioJava();
78101
Structure inputStructure = StructureIO.getStructure("4ck4");
79102
// Count the number of groups
80103
Group before = inputStructure.getChains().get(0).getAtomGroup(17);

0 commit comments

Comments
 (0)