[Biojava-l] Re: Biojava-l Digest, Vol 4, Issue 14
Vivek Tyagi
abtuz at yahoo.com
Fri Apr 18 10:40:10 EDT 2003
Hi, The code is not compiling as some deprecated methods may be in use in the code but worry not just recompile with -deprecation and that should do it.
Vivek Tyagi
biojava-l-request at biojava.org wrote:Send Biojava-l mailing list submissions to
biojava-l at biojava.org
To subscribe or unsubscribe via the World Wide Web, visit
http://biojava.org/mailman/listinfo/biojava-l
or, via email, send a message with subject or body 'help' to
biojava-l-request at biojava.org
You can reach the person managing the list at
biojava-l-owner at biojava.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Biojava-l digest..."
Today's Topics:
1. biojava API - is it current? (hz5 at njit.edu)
----------------------------------------------------------------------
Message: 1
Date: Fri, 18 Apr 2003 11:48:53 -0400 (EDT)
From: hz5 at njit.edu
Subject: [Biojava-l] biojava API - is it current?
To: biojava-l at biojava.org
Message-ID: <1050680933.3ea01e653aa7c at webmail.njit.edu>
Content-Type: text/plain; charset=ISO-8859-1
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
End of Biojava-l Digest, Vol 4, Issue 14
****************************************
---------------------------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://open-bio.org/pipermail/biojava-l/attachments/20030418/1ad051d3/attachment.htm
More information about the Biojava-l
mailing list