Package org.biojava.nbio.structure.rcsb
Class RCSBDescriptionFactory
- java.lang.Object
-
- org.biojava.nbio.structure.rcsb.RCSBDescriptionFactory
-
public class RCSBDescriptionFactory extends Object
Fetches information from RCSB's RESTful Web Service Interface. A factory forRCSBDescriptions
fromdescribeMol
XML files. The factory methods will return null if the data was not found (rather than throwing an exception); client code should test for this. This is for consistency: if the factory could not read some part (corresponding to a field in a class inrcsb.descriptions
) of the XML file, either because it was blank or contained an error that could not be safely ignored, that field will simply be null. This holds even for numerical values. On some parse errors, the error will additionally be printed to standard error. Example usage:RCSBDescription description = RCSBDescriptionFactory.get("1w0p"); RCSBLigand firstLigand = ligands.getLigands().get(0); System.out.println(description.getPdbId()); // prints "1w0p"
- Since:
- 3.0.6
- Author:
- dmyerstu
- See Also:
- RCSB RESTful TODO: Handle queries with more than 1 PDB Id.
-
-
Constructor Summary
Constructors Constructor Description RCSBDescriptionFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RCSBDescription
get(InputStream stream)
static RCSBDescription
get(String pdbId)
-
-
-
Constructor Detail
-
RCSBDescriptionFactory
public RCSBDescriptionFactory()
-
-
Method Detail
-
get
public static RCSBDescription get(InputStream stream)
- Returns:
- An
RCSBDescription
from the XML file loaded asstream
. Prefer callingget(String)
if you want data directly from RCSB's RESTful service. - See Also:
get(String)
-
get
public static RCSBDescription get(String pdbId)
- Returns:
- An
RCSBDescription
from the XML file at"http://www.pdb.org/pdb/rest/describeMol?structureId=pdbId"
. This is the preferred factory method, unless a different URL or input source is required. - See Also:
get(InputStream)
-
-