Skip to content

Commit 9291fab

Browse files
authored
Merge pull request #683 from josemduarte/bugfixes-4.2
Updating to latest RCSB URLs for 4.2.x
2 parents 714649c + a38c8c8 commit 9291fab

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class DownloadChemCompProvider implements ChemCompProvider {
6767

6868
public static final String CHEM_COMP_CACHE_DIRECTORY = "chemcomp";
6969

70-
public static final String SERVER_LOCATION = "http://www.rcsb.org/pdb/files/ligand/";
70+
public static final String SERVER_LOCATION = "http://files.rcsb.org/ligands/download/";
7171

7272

7373
private static File path;

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.net.URL;
3232
import java.util.ArrayList;
3333
import java.util.List;
34+
import java.util.zip.GZIPInputStream;
3435

3536
import org.biojava.nbio.structure.Group;
3637
import org.biojava.nbio.structure.ResidueNumber;
@@ -95,8 +96,11 @@ public static List<SecStrucState> fetch(String pdb,
9596
Structure structure, boolean assign)
9697
throws IOException, StructureException {
9798

98-
InputStream in = new URL("http://www.rcsb.org/pdb/files/"+
99-
pdb+".dssp").openStream();
99+
URL url = new URL("http://files.rcsb.org/dssp/" +
100+
pdb.toLowerCase().substring(1, 3) + "/" +
101+
pdb.toLowerCase() + "/" +
102+
pdb + ".dssp.gz");
103+
InputStream in = new GZIPInputStream(url.openStream());
100104
Reader read = new InputStreamReader(in);
101105
BufferedReader reader = new BufferedReader(read);
102106
return generalParse(reader, structure, assign);

biojava-structure/src/test/java/org/biojava/nbio/structure/Test2JA5.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
*/
2121
package org.biojava.nbio.structure;
2222

23-
import static org.junit.Assert.assertNotNull;
2423
import static org.junit.Assert.assertNull;
2524
import static org.junit.Assert.assertTrue;
25+
import static org.junit.Assert.assertEquals;
2626

2727
import java.io.IOException;
2828

@@ -55,7 +55,7 @@ public void test2JA5() throws IOException, StructureException {
5555
// assertTrue(StructureTools.getNrAtoms(s1) == 0);
5656

5757
// SeqRes contains 15 chains, but since we cannot align Chain N to AtomGroups => 14.
58-
assertTrue(s1.getChains().size() == 14);
58+
assertEquals(14, s1.getChains().size());
5959

6060
Chain nChain = null;
6161
try {
@@ -84,15 +84,15 @@ public void test2JA5noHeader() throws IOException, StructureException {
8484
// This is not applicable anymore, we need to parse atoms to have chains to match.
8585
assertTrue(StructureTools.getNrAtoms(s1) == 0);
8686

87-
// All 15 seqres chains will be store.
88-
assertTrue(s1.getChains().size() == 15);
87+
// 2ja5 has been remediated on March 2017, now it has 14 chains in seqres matching the 14 chains in atoms (chain N has been removed)
88+
assertEquals(14, s1.getChains().size());
8989

9090
Chain nChain = null;
9191
try {
9292
nChain = s1.getChainByPDB("N");
9393
} catch (StructureException e){
9494
// this is expected here, since there is no chain N
9595
}
96-
assertNotNull(nChain);
96+
assertNull(nChain);
9797
}
9898
}

biojava-structure/src/test/java/org/biojava/nbio/structure/TestURLIdentifier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public void testURLParameters() throws StructureException, IOException {
101101
assertEquals("wrong length for chainId=A", 94, StructureTools.getRepresentativeAtomArray(reduced).length);
102102

103103
try {
104-
url = new URL("http://www.rcsb.org/pdb/files/1B8G.pdb.gz");
104+
url = new URL("http://files.rcsb.org/download/1B8G.pdb.gz");
105105
id = new URLIdentifier(url);
106106

107107
full = id.loadStructure(cache);

0 commit comments

Comments
 (0)