[Biojava-l] biojava API - is it current?

Schreiber, Mark mark.schreiber at agresearch.co.nz
Mon Apr 21 15:29:35 EDT 2003


Hi Haibo -
 
Unfortunately the API docs on the webpage have become seriously out of date. I think Thomas is going to fix this but he may have gotten busy :)
 
- Mark
 

	-----Original Message----- 
	From: hz5 at njit.edu [mailto:hz5 at njit.edu] 
	Sent: Sat 19/04/2003 3:48 a.m. 
	To: biojava-l at biojava.org 
	Cc: 
	Subject: [Biojava-l] biojava API - is it current?
	
	

	I got this code from Biojava in Anger(to create a customized Alphabets):
	****************************************************************
	import org.biojava.bio.symbol.*;
	import org.biojava.bio.*;
	import java.util.*;
	public class Binary {
	  public static void main(String[] args) {
	    //make the "zero" Symbol with no annotation
	    Symbol zero =
	        AlphabetManager.createSymbol("A", Annotation.EMPTY_ANNOTATION);
	
	    //make the "one" Symbol
	    Symbol one =
	        AlphabetManager.createSymbol("B", Annotation.EMPTY_ANNOTATION);
	    //System.out.println(one.getToken());
	
	    //collect the Symbols in a Set
	    Set symbols = new HashSet();
	    symbols.add(zero); symbols.add(one);
	
	    //make the Binary Alphabet
	    FiniteAlphabet binary = new SimpleAlphabet(symbols, "Binary");
	
	    //iterate through the symbols to show everything works
	    for (Iterator i = binary.iterator(); i.hasNext(); ) {
	      Symbol sym = (Symbol)i.next();
	      System.out.println(sym.getName());
	    }
	
	    //it is usual to register newly creates Alphabets with the AlphabetManager
	    AlphabetManager.registerAlphabet(binary.getName(), binary);
	
	    /*
	     * The newly created Alphabet will have been registered with the
	     * AlphabetManager under the name "Binary". If you retreive an instance
	     * of it using this name it should be canonical with the previous instance
	     */
	    Alphabet alpha = AlphabetManager.alphabetForName("Binary");
	
	    //check canonical status
	    System.out.println(alpha == binary);
	  }
	}
	****************************************************************
	on line 6-8:
	    //make the "zero" Symbol with no annotation
	    Symbol zero =
	        AlphabetManager.createSymbol("A", Annotation.EMPTY_ANNOTATION);
	
	however, by looking at the api at http://www.biojava.org/docs/api/, I can only
	see 3 createSymbol methods in AlphabetManager class, none of them taking 2
	arguments:
	---static Symbol createSymbol(char token, Annotation annotation, java.util.List
	symList, Alphabet alpha)
	---static Symbol createSymbol(char token, Annotation annotation, java.util.Set
	symSet, Alphabet alpha)
	---static AtomicSymbol createSymbol(char token, java.lang.String name,
	Annotation annotation)
	
	The wierd thing is that the program can compile, I am using:
	biojava-1.3pre1.jar     13-Jan-2003 18:23   2.2M 
	bytecode-0.91.jar       01-Sep-2002 09:37    59k 
	jakarta-regexp.jar      02-Jul-2001 05:30    29k 
	xerces.jar              14-Aug-2001 12:02   1.7M
	
	
	Then I change the code and let it take 3 arguments as stated in the api:
	---static AtomicSymbol createSymbol(char token, java.lang.String name,
	Annotation annotation)
	
	    //make the "zero" Symbol with no annotation
	    AtomicSymbol zero =
	        AlphabetManager.createSymbol('c', "A", Annotation.EMPTY_ANNOTATION);
	
	It won't compile, says:
	Note: D:\projects\Normalization Normenclature of Peptide Ligand\Binary.java
	uses or overrides a deprecated API.
	Note: Recompile with -deprecation for details.
	
	No idea why is this, does this mean that the api currently on the web is not
	for the versiion of biojave I am using, if so, how can I get a copy of biojava
	that go with the current api at http://www.biojava.org/docs/api/?
	
	Thanks!
	Haibo
	
	
	
	
	
	=========================================================
	Haibo Zhang, PhD student
	Computational Biology, NJIT & Rutgers University
	Center for Applied Genomics, PHRI
	http://afs13.njit.edu/~hz5
	_______________________________________________
	Biojava-l mailing list  -  Biojava-l at biojava.org
	http://biojava.org/mailman/listinfo/biojava-l
	


=======================================================================
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.
=======================================================================



More information about the Biojava-l mailing list