A Java wrapper for the RCSB PDB APIs. I wrote this module specifically for the Android application Palantir, so I've only implemented what was necessary. Contributions are extremely welcome!
try {
TextSearch textSearch = new TextSearch(queryString);
String[] results = textSearch.getPage(); // PDB IDs
for (String pdbId : results) {
Pdb pdb = new Pdb(pdbId);
pdb.load()
System.out.println(pdbId.getTitle());
}
} catch (IOException e) {
e.printStackTrace();
}
mvn test
runs the test.
To run a single test, use the -Dtest=ClassName#methodName
flag, e.g.
mvn test -Dtest=TextSearchTests#nextPageWorksOnline
In the event that several tests seem to fail with a SocketTimeoutException
, check if the RCSB search service is online by running this simple query listed on the RCSB "Search API Documentation" page.
You might see the warning:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
when building or testing the package. This is a documented bug. I expect (hope) that the fix will propagate soon (guice is not a direct dependency).