Skip to content

Commit a6e15ce

Browse files
committed
Removing DSSPParser.fetch after RCSB deprecation
1 parent 633021b commit a6e15ce

File tree

4 files changed

+3
-51
lines changed

4 files changed

+3
-51
lines changed

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import org.biojava.nbio.structure.StructureException;
2828
import org.biojava.nbio.structure.align.util.AtomCache;
2929
import org.biojava.nbio.structure.io.FileParsingParameters;
30-
import org.biojava.nbio.structure.secstruc.DSSPParser;
3130
import org.biojava.nbio.structure.secstruc.SecStrucCalc;
3231
import org.biojava.nbio.structure.secstruc.SecStrucInfo;
3332
import org.biojava.nbio.structure.secstruc.SecStrucTools;
@@ -64,13 +63,6 @@ public static void main(String[] args) throws IOException,
6463
System.out.println("Author's assignment: ");
6564
printSecStruc(s);
6665

67-
// If the more detailed DSSP prediction is required call this
68-
DSSPParser.fetch(pdbID, s, true);
69-
70-
// Print the assignment residue by residue
71-
System.out.println("DSSP assignment: ");
72-
printSecStruc(s);
73-
7466
// finally use BioJava's built in DSSP-like secondary structure assigner
7567
SecStrucCalc secStrucCalc = new SecStrucCalc();
7668

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,7 @@ public static void calculateDsspSecondaryStructure(Structure bioJavaStruct) {
164164
ssp.calculate(bioJavaStruct, true);
165165
}
166166
catch(StructureException e) {
167-
LOGGER.warn("Could not calculate secondary structure (error {}). Will try to get a DSSP file from the RCSB web server instead.", e.getMessage());
168-
169-
try {
170-
DSSPParser.fetch(bioJavaStruct.getPDBCode(), bioJavaStruct, true); //download from PDB the DSSP result
171-
} catch(Exception bige){
172-
LOGGER.warn("Could not get a DSSP file from RCSB web server. There will not be secondary structure assignment for this structure ({}). Error: {}", bioJavaStruct.getPDBCode(), bige.getMessage());
173-
}
167+
LOGGER.warn("Could not calculate secondary structure (error {}). Secondary structure annotation will be missing.", e.getMessage());
174168
}
175169
}
176170

biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/DSSPParser.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@
2828
import java.io.InputStreamReader;
2929
import java.io.Reader;
3030
import java.io.StringReader;
31-
import java.net.URL;
3231
import java.util.ArrayList;
3332
import java.util.List;
34-
import java.util.zip.GZIPInputStream;
3533

3634
import org.biojava.nbio.structure.Group;
3735
import org.biojava.nbio.structure.ResidueNumber;
@@ -99,32 +97,6 @@ public static List<SecStrucState> parseFile(String dsspPath,
9997
return generalParse(reader, structure, assign);
10098
}
10199

102-
/**
103-
* Fetch and parse the DSSP file of the specified pdb code
104-
* from the PDB web server and return the secondary structure
105-
* annotation as a List of {@link SecStrucState} objects.
106-
*
107-
* @param pdb path to the DSSP file to parse
108-
* @param structure Structure object associated to the dssp
109-
* @param assign assigns the SS to the structure if true
110-
* @return a List of SS annotation objects
111-
* @throws StructureException
112-
* @throws IOException
113-
*/
114-
public static List<SecStrucState> fetch(String pdb,
115-
Structure structure, boolean assign)
116-
throws IOException, StructureException {
117-
118-
URL url = new URL("http://files.rcsb.org/dssp/" +
119-
pdb.toLowerCase().substring(1, 3) + "/" +
120-
pdb.toLowerCase() + "/" +
121-
pdb.toLowerCase() + ".dssp.gz");
122-
InputStream in = new GZIPInputStream(url.openStream());
123-
Reader read = new InputStreamReader(in);
124-
BufferedReader reader = new BufferedReader(read);
125-
return generalParse(reader, structure, assign);
126-
}
127-
128100
/**
129101
* Parse a DSSP format String and return the secondary structure
130102
* annotation as a List of {@link SecStrucState} objects.

biojava-structure/src/test/java/org/biojava/nbio/structure/secstruc/TestDSSPParser.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,7 @@ public void testDSSPParser() throws IOException, StructureException {
5656
List<SecStrucState> file = DSSPParser.parseInputStream(new GZIPInputStream(
5757
this.getClass().getResourceAsStream("/org/biojava/nbio/structure/secstruc/"+name+".dssp.gz")), s, false);
5858

59-
// Test fetching from PDB
60-
List<SecStrucState> pdb = DSSPParser.fetch(name, s, false);
61-
62-
// Test predicting, writting and parsing back
59+
// Test predicting, writing and parsing back
6360
SecStrucCalc sec = new SecStrucCalc();
6461
List<SecStrucState> pred = sec.calculate(s, false);
6562

@@ -68,13 +65,10 @@ public void testDSSPParser() throws IOException, StructureException {
6865

6966
assertTrue(
7067
"SS assignment lengths do not match",
71-
file.size() == pdb.size()
72-
&& pred.size() == parseBack.size()
68+
pred.size() == parseBack.size()
7369
&& pred.size() == file.size());
7470

7571
for (int i = 0; i < file.size(); i++) {
76-
assertEquals("SS assignment position " + (i + 1)
77-
+ " does not match", file.get(i), pdb.get(i));
7872
assertEquals("SS assignment position " + (i + 1)
7973
+ " does not match", pred.get(i), parseBack.get(i));
8074
assertEquals("SS assignment position " + (i + 1)

0 commit comments

Comments
 (0)