Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -95,8 +96,11 @@ public static List<SecStrucState> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -84,15 +84,15 @@ 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 {
nChain = s1.getChainByPDB("N");
} catch (StructureException e){
// this is expected here, since there is no chain N
}
assertNotNull(nChain);
assertNull(nChain);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down