Question: difference between imports in biojava
0
gravatar for Moses
5.3 years ago by
Moses120
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: http://biojava.org/wiki/BioJava:CookBook:PDB:read3.0

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");
			System.out.println(s);
		}  catch (Exception e) {
 
			e.printStackTrace();
		}

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.biojava.bio.structure.*;

    import org.biojava3.structure.StructureIO;

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

 

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
1

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: http://mvnrepository.com/artifact/org.biojava/biojava-structure/4.0.0 and http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.biojava%22 . You can also clone a specific tag (say 4.0.0) from this github repo: https://github.com/biojava/biojava .

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
2
gravatar for andreas.prlic
5.3 years ago by
andreas.prlic290
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

https://github.com/biojava/biojava-tutorial

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

Help
Access

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