Question: difference between imports in biojava
gravatar for Moses
5.3 years ago by
united states/ Bloomingtion/ Indiana University Bloomington
Moses120 wrote:

I'm using biojava classes and modules over Eclipse IDE. while going over the cookbook provided by the wiki page I reached the following point:

trying to implement the following example:


// by default PDB files will be stored in a temporary directory
		// there are two ways of configuring a directory, that can get re-used               multiple times:
		// A) set the environment variable PDB_DIR
		// B) call cache.setPath(path) 
		AtomCache cache = new AtomCache();
		try {
			// alternative: try d4hhba_ 4hhb.A 4hhb.A:1-100
			Structure s = cache.getStructure("4hhb");
		}  catch (Exception e) {

while running this piece of code I used two different set of imports: 

First set:

    import org.biojava.nbio.structure.Structure;  

    import org.biojava.nbio.structure.StructureIO;

    import org.biojava.nbio.structure.align.util.AtomCache;


second set is:


    import org.biojava3.structure.StructureIO;



now with the different set of imports the execution of the code is giving different results. my question is what's the exact difference between these imports, and why are they giving different results for the same piece of code? and which one should I use. Thank you.

eclipse java biojava • 1.5k views
ADD COMMENTlink modified 5.3 years ago by andreas.prlic290 • written 5.3 years ago by Moses120

Looks like the differences are because of some mess with versions, to get more details you need to check the version of biojava and the source code of imported classes. I suggest you can manage biojava dependencies via Maven to resolve those inconsistencies, check out these links: and . You can also clone a specific tag (say 4.0.0) from this github repo: .

ADD REPLYlink written 5.3 years ago by mikhail.shugay3.4k

Thank you, I'll give that a go. Also is there any proper documentation for Biojava? the cookbook on the wiki page is just giving some chunks of code from here and there and is barely commenting on what the scripts are about, in biopython for instance the cookbook is much more in details, well written and explains in details all the functions and methods that the library has to offer.

ADD REPLYlink written 5.3 years ago by Moses120
gravatar for andreas.prlic
5.3 years ago by
San Diego
andreas.prlic290 wrote:

The difference in imports is due to the package name change in Biojava version 4. Now all packages are starting with org.biojava.nbio. There is a biojava tutorial at

ADD COMMENTlink written 5.3 years ago by andreas.prlic290
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1105 users visited in the last hour