diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java index d41e116971..fac2a86cbb 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java @@ -67,7 +67,7 @@ public class DownloadChemCompProvider implements ChemCompProvider { public static final String CHEM_COMP_CACHE_DIRECTORY = "chemcomp"; - public static final String SERVER_LOCATION = "http://www.rcsb.org/pdb/files/ligand/"; + public static final String SERVER_LOCATION = "http://files.rcsb.org/ligands/download/"; private static File path; diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/DSSPParser.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/DSSPParser.java index aa5de5a35a..eb762b9f25 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/DSSPParser.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/DSSPParser.java @@ -31,6 +31,7 @@ import java.net.URL; import java.util.ArrayList; import java.util.List; +import java.util.zip.GZIPInputStream; import org.biojava.nbio.structure.Group; import org.biojava.nbio.structure.ResidueNumber; @@ -95,8 +96,11 @@ public static List fetch(String pdb, Structure structure, boolean assign) throws IOException, StructureException { - InputStream in = new URL("http://www.rcsb.org/pdb/files/"+ - pdb+".dssp").openStream(); + URL url = new URL("http://files.rcsb.org/dssp/" + + pdb.toLowerCase().substring(1, 3) + "/" + + pdb.toLowerCase() + "/" + + pdb + ".dssp.gz"); + InputStream in = new GZIPInputStream(url.openStream()); Reader read = new InputStreamReader(in); BufferedReader reader = new BufferedReader(read); return generalParse(reader, structure, assign); diff --git a/biojava-structure/src/test/java/org/biojava/nbio/structure/Test2JA5.java b/biojava-structure/src/test/java/org/biojava/nbio/structure/Test2JA5.java index 2dbdda4c93..4835800e70 100644 --- a/biojava-structure/src/test/java/org/biojava/nbio/structure/Test2JA5.java +++ b/biojava-structure/src/test/java/org/biojava/nbio/structure/Test2JA5.java @@ -20,9 +20,9 @@ */ package org.biojava.nbio.structure; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertEquals; import java.io.IOException; @@ -55,7 +55,7 @@ public void test2JA5() throws IOException, StructureException { // assertTrue(StructureTools.getNrAtoms(s1) == 0); // SeqRes contains 15 chains, but since we cannot align Chain N to AtomGroups => 14. - assertTrue(s1.getChains().size() == 14); + assertEquals(14, s1.getChains().size()); Chain nChain = null; try { @@ -84,8 +84,8 @@ public void test2JA5noHeader() throws IOException, StructureException { // This is not applicable anymore, we need to parse atoms to have chains to match. assertTrue(StructureTools.getNrAtoms(s1) == 0); - // All 15 seqres chains will be store. - assertTrue(s1.getChains().size() == 15); + // 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) + assertEquals(14, s1.getChains().size()); Chain nChain = null; try { @@ -93,6 +93,6 @@ public void test2JA5noHeader() throws IOException, StructureException { } catch (StructureException e){ // this is expected here, since there is no chain N } - assertNotNull(nChain); + assertNull(nChain); } } diff --git a/biojava-structure/src/test/java/org/biojava/nbio/structure/TestURLIdentifier.java b/biojava-structure/src/test/java/org/biojava/nbio/structure/TestURLIdentifier.java index 141cb9e034..3d55a3e286 100644 --- a/biojava-structure/src/test/java/org/biojava/nbio/structure/TestURLIdentifier.java +++ b/biojava-structure/src/test/java/org/biojava/nbio/structure/TestURLIdentifier.java @@ -101,7 +101,7 @@ public void testURLParameters() throws StructureException, IOException { assertEquals("wrong length for chainId=A", 94, StructureTools.getRepresentativeAtomArray(reduced).length); try { - url = new URL("http://www.rcsb.org/pdb/files/1B8G.pdb.gz"); + url = new URL("http://files.rcsb.org/download/1B8G.pdb.gz"); id = new URLIdentifier(url); full = id.loadStructure(cache);