From hase at umbc.edu Mon Aug 1 23:25:50 2005 From: hase at umbc.edu (HASE) Date: Mon Aug 1 23:35:02 2005 Subject: [Biojava-dev] Bioinformatics Software Development Survey Message-ID: <2006.68.49.173.177.1122953150.squirrel@68.49.173.177> Hello, As part of our research at UMBC, we are studying the characteristics of software development in the bioinformatics domain. We believe that this study should be guided by the people who are actively involved in bioinformatics. This research is our first step towards enabling the production of high quality bioinformatics software with less time and effort. Therefore, your feedback is very important to us. We seek your input in the form of a survey questionnaire that will take around 15 minutes of your time. We solicit general demographic information, information about the products that you have developed, your work practices, and your software development process. So, if you are a bioinformatics professional doing software development or a software developer working in the bioinformatics domain, please provide us with your valuable input. We assure you that this information will be used only for academic purposes and will be completely confidential. Please follow the link below to start the survey: http://www.is.umbc.edu/bio-survey/ We appreciate your participation in advance. Regards, HASE (Human Aspects of Software Engineering) 1000 Hilltop Circle Department of Information Systems University of Maryland Baltimore County Baltimore, MD, 21250 hase@umbc.edu From hvdspek at liacs.nl Wed Aug 3 07:42:39 2005 From: hvdspek at liacs.nl (Harmen van der Spek) Date: Wed Aug 3 07:34:44 2005 Subject: [Biojava-dev] GFFParser URL parsing problem Message-ID: <1123069359.7866.13.camel@athene> Hello, I ran into a problem when using a GFF data source with Dazzle. It contains an attribute href: which results in a link on a DAS client, in our case Ensembl. The problem now is that attributes are separated by semicolons, and the URLs contain semicolons too. So the URL: http://localhost/cgi-bin/gbrowse/dial_extra?name=Chr1;source=dial_extra;width=800;version=100;label=CGH will be cut up in pieces and finally will not be rendered correctly. Quoting the URL doesn't help. Is this behaviour of parseAttribute in GFFParser.java intentional or should this be considered as a bug, as quoting could be potentially be used to distinguish between separators and URL semicolons. Best regards, Harmen From andreas.draeger at clever-telefonieren.de Sat Aug 13 05:29:56 2005 From: andreas.draeger at clever-telefonieren.de (=?ISO-8859-1?Q?Andreas_Dr=E4ger?=) Date: Sun Aug 14 17:02:04 2005 Subject: [Biojava-dev] Suggestions for the BioJava project Message-ID: <42FDBD94.30605@clever-telefonieren.de> Dear BioJava developers, I am and currently working with BioSQL and BioJava. Trying to insert the NCBI taxon hierachy and also different kinds of biosequences into the database I got to know that there are still some open problems in BioJava. Since I wrote some classes anyway, I would like to contribute them to the community. The first thing I am missing in BioJava is that there is no class that really helps to parse the information given by the NCBI names.dmp and nodes.dmp which can be downloaded at the NCBI ftp site and contain all the relevant information about the current taxon tree of know species. Constructing Taxon objects containing all the information and inserting them into the BioSQL database was very hard. Especially because the current TaxonSQL class only inserts the name, name_class, ncbi_taxon_id and parent_id into the database. The other information, which is already considered by the SQL scheme like genetic code, mitochondrial genetic code etc. will be lost, even if it is included in the Annotation of the Taxon instance. This can be seen by looking at the insert statemens in the class TaxonSQL. Additionally a Map data structure is used to access the EbiFormat.PROPERTY_TAXON_NAMES in class TaxonSQL. This only allows us to store exactly one synonym, one includes, one equvalent name and so on of one certain species. Some species have more than one synonym and so on. This information will be lost using just a Map structure. I would suggest to use a Map and every key should point to a Set which contains the other names. Except there is exactly one name (as it is supposed to be with scientific name). This could be realised by a simple case destinction. On the other hand, it might be usefull to retrive data about the taxa from the database not only by the NCBI-ID. For some purposes it might be sensefull to have a method to access the taxa by one of the names. This is why I would suggest to add the method: public static Taxon getTaxon(Connection conn, String name) throws BioRuntimeException to retrive the data by name. Attached to this mail you will find my extended version of TaxonSQL including these functions. I also added a function that gives an array of Strings where every entry is one scientific name. So you can easly see, which species are already inserted in the database. I modified the functions to put and retrieve taxa into the database so that they consider that the names Map could sometimes point to a Set of names instead of normal name Strings. In addition I considered the other information that can be inserted in the database like genetic code and so on. However, there are some methods in TaxonSQL.java that are defined to be private. If they were protected, an extension of this class could call them. But because they're private, I had to copy and paste them. To read the names.dmp and the nodes.dmp from the NCBI ftp site I wrote another parser, because there was no one. This class constructes a whole tree of all given species containing Taxon objects in a TaxonFactory instance with all the information mentioned above, which would normally not be included. The SQL scheme also has attributs called left value and right value. These are given by a depth first search through the taxon tree. Whenever the algorithm visits a node for the first time, the left value is set according to an incremental counter. Then all children will be visited. The right value is set when all children of the node are visited. This gives the property that all children of a node have left values and right values between the values of this node. The problem is that this function may cause a StackOverFlow. Maybe this should already be realised in the TaxonFactory containing all nodes. The other problem is that the children of a node don't have further children, except you use the search methtod of the TaxonFactory to find the child again. Then the children of the children may appear (if there are some). The same is valid for the parent of a node's parent. This is why we always have to call the search method again and again while traversing the taxon tree. I don't know if this is very efficient, because I didn't really look at the source code of the search method. It would be nice to find something more efficient to traverse a whole taxon tree to set the left value and the right value. The same problem also occurs, if one wants to add a whole subtree of taxa to the database. It might cause a StackOverFlow, if one does it with dfs. These are my suggestions to the BioJava-Project. I am looking forward to your response and comments. By the way, it would also be nice to tell the user of BioJava that the attribute 'synonym' in the table 'term_synonym' in the BioSQL scheme should be renamed to 'name'. I was woundering all the time to get an error message till I figured out that. Yours sincerely Andreas Dr?ger -------------- next part -------------- A non-text attachment was scrubbed... Name: NCBITaxonParser.java Type: text/x-java Size: 19410 bytes Desc: not available Url : http://portal.open-bio.org/pipermail/biojava-dev/attachments/20050813/2408f953/NCBITaxonParser-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: MyTaxonSQL.java Type: text/x-java Size: 17010 bytes Desc: not available Url : http://portal.open-bio.org/pipermail/biojava-dev/attachments/20050813/2408f953/MyTaxonSQL-0001.bin From len at reeltwo.com Sun Aug 14 18:22:54 2005 From: len at reeltwo.com (Len Trigg) Date: Sun Aug 14 18:15:19 2005 Subject: [Biojava-dev] Suggestions for the BioJava project In-Reply-To: <42FDBD94.30605@clever-telefonieren.de> References: <42FDBD94.30605@clever-telefonieren.de> Message-ID: Andreas Dr?ger wrote: > I am and currently working with BioSQL and BioJava. Trying to insert > the NCBI taxon hierachy and also different kinds of biosequences into > the database I got to know that there are still some open problems in > BioJava. Since I wrote some classes anyway, I would like to contribute > them to the community. Good stuff. The work that I did with the TaxonSQL classes was based on the fairly simple requirements of the project I was working on, which is why you found the current implementation a bit limited. (I don't have projects involving BioJava at the moment, so haven't been doing much other than following the mailing list.) > I modified the functions to put and retrieve taxa into the database so > that they consider that the names Map could sometimes point to a Set of > names instead of normal name Strings. > In addition I considered the other information that can be inserted in > the database like genetic code and so on. Excellent improvements. > However, there are some methods in TaxonSQL.java that are defined to be > private. If they were protected, an extension of this class could call them. > But because they're private, I had to copy and paste them. That class isn't really designed for extension, since it's plugged directly into calls from BioSQLSequenceAnnotation and BioSQLSequenceDB (you presumably had to change these to point to your MySQLTaxon) and there's no need for multiple implementations. I'd say that your changes should instead be folded directly as improvements to TaxonSQL itself so that everyone gets the improvements out of the box. Cheers, Len. From mark.schreiber at novartis.com Sun Aug 14 21:09:53 2005 From: mark.schreiber at novartis.com (mark.schreiber@novartis.com) Date: Sun Aug 14 20:59:46 2005 Subject: [Biojava-dev] Suggestions for the BioJava project Message-ID: It's probably premature to announce this but Richard Holland and I have been working on a new object model that will pesist very easily to BioSQL. It extends the core interfaces and miraculously doesn't break anything so you can still use the core stuff or you can use the new models if you want to. For example we have the RichSequence interface which closely follows biosql but also extends Sequence, so anywhere you can use Sequence you can happily use a RichSequence (or just a plain old Sequence). The really cool stuff is the work Richard has done with Hibernate. The whole of BioSQL can now be happily transported back and forth to biojava via hibernate. It's amazingly painless and seems to avoid many of the problems of our old SQL system. The model is also decoupled from hibernate completely so you can use the objects for your normal biojava stuff without ever having a database for persistence. We also have a NCBITaxon class to handle all the issues Andreas brought up. The whole thing is available from CVS under the org.biojavax.bio package. We chose the name biojavax to be analogous to the relationship between java and javax. The javax packages are extensions to the core java. They improve it, they sometimes deprecate it, they use it, but they don't replace it. The same is true for biojavax. It is not a replacement. It is an extension that gives better functionality but still gets a lot of milage out of biojava. Importantly, they are not seperate packages. There is also a genetic algorithm framework under org.biojavax.ga but that's an entirely different story : ) The biojavax packages should be considered highly unstable at the moment as we are still working out the kinks. More later. - Mark Mark Schreiber Principal Scientist (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com phone +65 6722 2973 fax +65 6722 2910 Len Trigg Sent by: biojava-dev-bounces@portal.open-bio.org 08/15/2005 06:22 AM To: Andreas Dr?ger cc: biojava-dev@biojava.org, (bcc: Mark Schreiber/GP/Novartis) Subject: Re: [Biojava-dev] Suggestions for the BioJava project Andreas Dr?ger wrote: > I am and currently working with BioSQL and BioJava. Trying to insert > the NCBI taxon hierachy and also different kinds of biosequences into > the database I got to know that there are still some open problems in > BioJava. Since I wrote some classes anyway, I would like to contribute > them to the community. Good stuff. The work that I did with the TaxonSQL classes was based on the fairly simple requirements of the project I was working on, which is why you found the current implementation a bit limited. (I don't have projects involving BioJava at the moment, so haven't been doing much other than following the mailing list.) > I modified the functions to put and retrieve taxa into the database so > that they consider that the names Map could sometimes point to a Set of > names instead of normal name Strings. > In addition I considered the other information that can be inserted in > the database like genetic code and so on. Excellent improvements. > However, there are some methods in TaxonSQL.java that are defined to be > private. If they were protected, an extension of this class could call them. > But because they're private, I had to copy and paste them. That class isn't really designed for extension, since it's plugged directly into calls from BioSQLSequenceAnnotation and BioSQLSequenceDB (you presumably had to change these to point to your MySQLTaxon) and there's no need for multiple implementations. I'd say that your changes should instead be folded directly as improvements to TaxonSQL itself so that everyone gets the improvements out of the box. Cheers, Len. _______________________________________________ biojava-dev mailing list biojava-dev@biojava.org http://biojava.org/mailman/listinfo/biojava-dev From heuermh at acm.org Tue Aug 16 15:01:19 2005 From: heuermh at acm.org (Michael Heuer) Date: Tue Aug 16 14:49:56 2005 Subject: [Biojava-dev] Suggestions for the BioJava project In-Reply-To: Message-ID: Hello Mark, Richard This is very cool. I took a quick look and noticed a few consistency problems and several different styles of javadoc comments, but nothing major. I'll wait until development slows down a bit before submitting any style-related patches. Unfortunately it's a little bit late, now that you already have something that works, but I committed a source code generation library and shell interface to the biojava subversion repository, at > http://www.derkholm.net/svn/repos/biojava-expr/trunk/codegen/ > http://www.derkholm.net/svn/repos/biojava-expr/trunk/codegen-shell/ to save myself a lot of typing, particularly in javadoc comments. You do a little of this $ java -jar codegen-shell.jar % InterfaceDescription foo = new InterfaceDescription("Foo"); % foo.attribute(..., Cardinality.ZeroToOne); % foo.associate(..., Cardinality.OneToMany); % ClassDescription simpleFoo = new ClassDescription("SimpleFoo"); % simpleFoo.realizes(foo); % generateSource(foo); % generateSource(simpleFoo, Style.RichlyMutable); and you get something like (sorry if the formatting doesn't work out) --- Foo.java import java.util.Set; import java.util.List; import java.util.SortedSet; /** * foo * * @author codegen * @version $Revision$ $Date$ */ public interface Foo { /** * Return the foo id for this foo. * The foo id will not be null. * * @return the foo id for this foo */ Long getFooId(); /** * Return the name for this foo. * The name may be null. * * @return the name for this foo */ String getName(); /** * Return an unmodifiable set of synonyms * for this foo. The returned set may be * empty but will not be null. * * @return an unmodifiable set of synonyms * for this foo */ Set getSynonyms(); /** * Return an unmodifiable list of positions * for this foo. The returned list will * not be null and will contain at least one position. * * @return an unmodifiable list of positions * for this foo */ List getPositions(); /** * Return the optional bar for this foo. * The optional bar may be null. * * @return the optional bar for this foo */ Bar getOptionalBar(); /** * Return the required bar for this foo. * The required bar will not be null. * * @return the required bar for this foo */ Bar getRequiredBar(); /** * Return an unmodifiable list of additional bars * for this foo. The returned list may be * empty but will not be null. * * @return an unmodifiable list of additional bars * for this foo */ List getAdditionalBars(); /** * Return an unmodifiable sorted set of other bars * for this foo. The returned sorted set will * not be null and will contain at least one other bar. * * @return an unmodifiable sorted set of other bars * for this foo */ SortedSet getOtherBars(); } --- SimpleFoo.java: import java.util.Set; import java.util.HashSet; import java.util.Collections; import java.util.List; import java.util.ArrayList; import java.util.SortedSet; import java.util.TreeSet; /** * simple foo. * * @author codegen * @version $Revision$ $Date$ */ public class SimpleFoo implements Foo { /** The foo id for this simple foo. */ private Long fooId; /** The name for this simple foo. */ private String name; /** The set of synonyms for this simple foo. */ private final Set synonyms; /** The list of positions for this simple foo. */ private final List positions; /** The optional bar for this simple foo. */ private Bar optionalBar; /** The required bar for this simple foo. */ private Bar requiredBar; /** The list of additional bars for this simple foo. */ private final List additionalBars; /** The sorted set of other bars for this simple foo. */ private final SortedSet otherBars; /** * Create a new simple foo from the specified required parameters. * *

The specified list of positions must contain at least one position. * The positions in positions are copied defensively * into this class.

* *

The specified sorted set of other bars must contain at least one other bar. * The other bars in otherBars are copied defensively * into this class.

* * @param fooId foo id for this simple foo, must not be null * @param positions list of integers, must not be null and must * contain at least one integer * @param requiredBar required bar for this simple foo, must not be null * @param otherBars sorted set of bars, must not be null and must * contain at least one bar * * @throws IllegalArgumentException if positions.size() < 1 * * @throws IllegalArgumentException if otherBars.size() < 1 */ public SimpleFoo( final Long fooId, final List positions, final Bar requiredBar, final SortedSet otherBars) { if (fooId == null) { throw new IllegalArgumentException("fooId must not be null"); } if (positions == null) { throw new IllegalArgumentException("positions must not be null"); } if (positions.size() < 1) { throw new IllegalArgumentException("positions must contain at least one position"); } if (requiredBar == null) { throw new IllegalArgumentException("requiredBar must not be null"); } if (otherBars == null) { throw new IllegalArgumentException("otherBars must not be null"); } if (otherBars.size() < 1) { throw new IllegalArgumentException("otherBars must contain at least one other bar"); } setFooId(fooId); setName(null); this.synonyms = new HashSet(); this.positions = new ArrayList(positions)); setOptionalBar(null); setRequiredBar(requiredBar); this.additionalBars = new ArrayList(); this.otherBars = new TreeSet(otherBars); } /** * Create a new simple foo from the specified parameters. * *

The synonyms in synonyms are copied defensively * into this class.

* *

The specified list of positions must contain at least one position. * The positions in positions are copied defensively * into this class.

* *

The additional bars in additionalBars are copied defensively * into this class.

* *

The specified sorted set of other bars must contain at least one other bar. * The other bars in otherBars are copied defensively * into this class.

* * @param fooId foo id for this simple foo, must not be null * @param name name for this simple foo * @param synonyms set of synonyms, must not be null * @param positions list of integers, must not be null and must * contain at least one integer * @param optionalBar optional bar for this simple foo * @param requiredBar required bar for this simple foo, must not be null * @param additionalBars list of additional bars, must not be null * @param otherBars sorted set of bars, must not be null and must * contain at least one bar * * @throws IllegalArgumentException if positions.size() < 1 * * @throws IllegalArgumentException if otherBars.size() < 1 */ public SimpleFoo( final Long fooId, final String name, final Set synonyms, final List positions, final Bar optionalBar, final Bar requiredBar, final List additionalBars, final SortedSet otherBars) { if (fooId == null) { throw new IllegalArgumentException("fooId must not be null"); } if (synonyms == null) { throw new IllegalArgumentException("synonyms must not be null"); } if (positions == null) { throw new IllegalArgumentException("positions must not be null"); } if (positions.size() < 1) { throw new IllegalArgumentException("positions must contain at least one position"); } if (requiredBar == null) { throw new IllegalArgumentException("requiredBar must not be null"); } if (additionalBars == null) { throw new IllegalArgumentException("additionalBars must not be null"); } if (otherBars == null) { throw new IllegalArgumentException("otherBars must not be null"); } if (otherBars.size() < 1) { throw new IllegalArgumentException("otherBars must contain at least one other bar"); } setFooId(fooId); setName(name); this.synonyms = new HashSet(synonyms); this.positions = new ArrayList(positions); setOptionalBar(optionalBar); setRequiredBar(requiredBar); this.additionalBars = new ArrayList(additionalBars); this.otherBars = new TreeSet(otherBars); } /** * Return the foo id for this simple foo. * The foo id will not be null. * * @return the foo id for this simple foo */ public final Long getFooId() { return fooId; } /** * Set the foo id for this simple foo to fooId. * * @param fooId foo id for this simple foo, must not be null */ public final void setFooId(final Long fooId) { if (fooId == null) { throw new IllegalArgumentException("fooId must not be null"); } this.fooId = fooId; } /** * Return the name for this simple foo. * The name may be null. * * @return the name for this simple foo */ public final String getName() { return name; } /** * Set the name for this simple foo to name. * * @param name name for this simple foo */ public final void setName(final String name) { this.name = name; } /** * Return an unmodifiable set of synonyms * for this simple foo. The returned set may be * empty but will not be null. * * @return an unmodifiable set of synonyms * for this simple foo */ public final Set getSynonyms() { return Collections.unmodifiableSet(synonyms); } /** * Add the specified synonym to the set of * synonyms for this simple foo. An exception * may be thrown if the underlying set prevents * synonym from being added. * * @param synonym synonym to add */ public final void addSynonym(final String synonym) { synonyms.add(synonym); } /** * Add all of the synonyms in the specified collection of synonyms * to the set of synonyms for this simple foo. * An exception may be thrown if the underlying * set prevents any of the synonyms in * synonyms from being added. * * @param synonyms collection of synonyms to add */ public final void addAllSynonyms(final Collection synonyms) { this.synonyms.addAll(synonyms); } /** * Remove the specified synonym from the set of * synonyms for this simple foo. An exception * may be thrown if the underlying set prevents * synonym from being removed. * * @param synonym synonym to remove */ public final void removeSynonym(final String synonym) { synonyms.remove(synonym); } /** * Remove all of the synonyms in the set of * synonyms for this simple foo that are also contained in the * specified collection of synonyms. An exception * may be thrown if the underlying set prevents any * of the synonyms in synonyms from being removed. * * @param synonyms collection of synonyms to remove */ public final void removeAllSynonyms(final Collection synonyms) { this.synonyms.removeAll(synonyms); } /** * Retain only the synonyms in the set of * synonyms for this simple foo that are contained in the specified * collection of synonyms. An exception may be thrown * if the underlying set prevents any of the synonyms * not in synonyms from being removed. * * @param synonyms collection of synonyms to retain */ public final void retainAllSynonyms(final Collection synonyms) { this.synonyms.retainAll(synonyms); } /** * Remove all of the synonyms in the set of * synonyms for this simple foo. An exception may * be thrown if the underlying set prevents any of the * synonyms from being removed. */ public final void clearSynonyms() { synonyms.clear(); } /** * Return an unmodifiable list of positions * for this simple foo. The returned list will * not be null and will contain at least one position. * * @return an unmodifiable list of positions * for this simple foo */ public final List getPositions() { return Collections.unmodifiableList(positions); } /** * Add the specified position to the list of * positions for this simple foo. An exception * may be thrown if the underlying list prevents * position from being added. * * @param position position to add */ public final void addPosition(final Integer position) { positions.add(position); } /** * Add all of the positions in the specified collection of positions * to the list of positions for this simple foo. * An exception may be thrown if the underlying * list prevents any of the positions in * positions from being added. * * @param positions collection of positions to add */ public final void addAllPositions(final Collection positions) { this.positions.addAll(positions); } /** * Remove the specified position from the list of * positions for this simple foo. An exception * may be thrown if the underlying list prevents * position from being removed. * * @param position position to remove */ public final void removePosition(final Integer position) { positions.remove(position); } /** * Remove all of the positions in the list of * positions for this simple foo that are also contained in the * specified collection of positions. An exception * may be thrown if the underlying list prevents any * of the positions in positions from being removed. * * @param positions collection of positions to remove */ public final void removeAllPositions(final Collection positions) { this.positions.removeAll(positions); } /** * Retain only the positions in the list of * positions for this simple foo that are contained in the specified * collection of positions. An exception may be thrown * if the underlying list prevents any of the positions * not in positions from being removed. * * @param positions collection of positions to retain */ public final void retainAllPositions(final Collection positions) { this.positions.retainAll(positions); } /** * Remove all of the positions in the list of * positions for this simple foo. An exception may * be thrown if the underlying list prevents any of the * positions from being removed. */ public final void clearPositions() { positions.clear(); } /** * Return the optional bar for this simple foo. * The optional bar may be null. * * @return the optional bar for this simple foo */ public final Bar getOptionalBar() { return optionalBar; } /** * Set the optional bar for this simple foo to optionalBar. * * @param optionalBar optional bar for this simple foo */ public final void setOptionalBar(final Bar optionalBar) { this.optionalBar = optionalBar; } /** * Return the required bar for this simple foo. * The required bar will not be null. * * @return the required bar for this simple foo */ public final Bar getRequiredBar() { return requiredBar; } /** * Set the required bar for this simple foo to requiredBar. * * @param requiredBar required bar for this simple foo, must not be null */ public final void setRequiredBar(final Bar requiredBar) { if (requiredBar == null) { throw new IllegalArgumentException("requiredBar must not be null"); } this.requiredBar = requiredBar; } /** * Return an unmodifiable list of additional bars * for this simple foo. The returned list may be * empty but will not be null. * * @return an unmodifiable list of additional bars * for this simple foo */ public final List getAdditionalBars() { return Collections.unmodifiableList(additionalBars); } /** * Add the specified additional bar to the list of * additional bars for this simple foo. An exception * may be thrown if the underlying list prevents * additionalBar from being added. * * @param additionalBar additional bar to add */ public final void addAdditionalBar(final Bar additionalBar) { additionalBars.add(additionalBar); } /** * Add all of the additional bars in the specified collection of additional bars * to the list of additional bars for this simple foo. * An exception may be thrown if the underlying * list prevents any of the additional bars in * additionalBars from being added. * * @param additionalBars collection of additional bars to add */ public final void addAllAdditionalBars(final Collection additionalBars) { this.additionalBars.addAll(additionalBars); } /** * Remove the specified additional bar from the list of * additional bars for this simple foo. An exception * may be thrown if the underlying list prevents * additionalBar from being removed. * * @param additionalBar additional bar to remove */ public final void removeAdditionalBar(final Bar additionalBar) { additionalBars.remove(additionalBar); } /** * Remove all of the additional bars in the list of * additional bars for this simple foo that are also contained in the * specified collection of additional bars. An exception * may be thrown if the underlying list prevents any * of the additional bars in additionalBars from being removed. * * @param additionalBars collection of additional bars to remove */ public final void removeAllAdditionalBars(final Collection additionalBars) { this.additionalBars.removeAll(additionalBars); } /** * Retain only the additional bars in the list of * additional bars for this simple foo that are contained in the specified * collection of additional bars. An exception may be thrown * if the underlying list prevents any of the additional bars * not in additionalBars from being removed. * * @param additionalBars collection of additional bars to retain */ public final void retainAllAdditionalBars(final Collection additionalBars) { this.additionalBars.retainAll(additionalBars); } /** * Remove all of the additional bars in the list of * additional bars for this simple foo. An exception may * be thrown if the underlying list prevents any of the * additional bars from being removed. */ public final void clearAdditionalBars() { additionalBars.clear(); } /** * Return an unmodifiable sorted set of other bars * for this simple foo. The returned sorted set will * not be null and will contain at least one other bar. * * @return an unmodifiable sorted set of other bars * for this simple foo */ public final SortedSet getOtherBars() { return Collections.unmodifiableSortedSet(otherBars); } /** * Add the specified other bar to the sorted set of * other bars for this simple foo. An exception * may be thrown if the underlying sorted set prevents * otherBar from being added. * * @param otherBar other bar to add */ public final void addOtherBar(final Bar otherBar) { otherBars.add(otherBar); } /** * Add all of the other bars in the specified collection of other bars * to the sorted set of other bars for this simple foo. * An exception may be thrown if the underlying * sorted set prevents any of the other bars in * otherBars from being added. * * @param otherBars collection of other bars to add */ public final void addAllOtherBars(final Collection otherBars) { this.otherBars.addAll(otherBars); } /** * Remove the specified other bar from the sorted set of * other bars for this simple foo. An exception * may be thrown if the underlying sorted set prevents * otherBar from being removed. * * @param otherBar other bar to remove */ public final void removeOtherBar(final Bar otherBar) { otherBars.remove(otherBar); } /** * Remove all of the other bars in the sorted set of * other bars for this simple foo that are also contained in the * specified collection of other bars. An exception * may be thrown if the underlying sorted set prevents any * of the other bars in otherBars from being removed. * * @param otherBars collection of other bars to remove */ public final void removeAllOtherBars(final Collection otherBars) { this.otherBars.removeAll(otherBars); } /** * Retain only the other bars in the sorted set of * other bars for this simple foo that are contained in the specified * collection of other bars. An exception may be thrown * if the underlying sorted set prevents any of the other bars * not in otherBars from being removed. * * @param otherBars collection of other bars to retain */ public final void retainAllOtherBars(final Collection otherBars) { this.otherBars.retainAll(otherBars); } /** * Remove all of the other bars in the sorted set of * other bars for this simple foo. An exception may * be thrown if the underlying sorted set prevents any of the * other bars from being removed. */ public final void clearOtherBars() { otherBars.clear(); } /** @see Object */ public final boolean equals(final Object o) { if (o == this) { return true; } if (!(o instanceof SimpleFoo)) { return false; } SimpleFoo simpleFoo = (SimpleFoo) o; return (true && (fooId.equals(simpleFoo.getFooId())) && ((name == null) ? (simpleFoo.getName() == null) : name.equals(simpleFoo.getName())) && (synonyms.equals(simpleFoo.getSynonyms())) && (positions.equals(simpleFoo.getPositions())) && ((optionalBar == null) ? (simpleFoo.getOptionalBar() == null) : optionalBar.equals(simpleFoo.getOptionalBar())) && (requiredBar.equals(simpleFoo.getRequiredBar())) && (additionalBars.equals(simpleFoo.getAdditionalBars())) && (otherBars.equals(simpleFoo.getOtherBars())) ); } /** @see Object */ public final int hashCode() { int result = 17; result = 37 * result + ((fooId == null) ? 0 : fooId.hashCode()); result = 37 * result + ((name == null) ? 0 : name.hashCode()); result = 37 * result + synonyms.hashCode(); result = 37 * result + positions.hashCode(); result = 37 * result + ((optionalBar == null) ? 0 : optionalBar.hashCode()); result = 37 * result + ((requiredBar == null) ? 0 : requiredBar.hashCode()); result = 37 * result + additionalBars.hashCode(); result = 37 * result + otherBars.hashCode(); return result; } } --- Whew, now that's a lot of typing saved. michael On Mon, 15 Aug 2005 mark.schreiber@novartis.com wrote: > It's probably premature to announce this but Richard Holland and I have > been working on a new object model that will pesist very easily to BioSQL. > It extends the core interfaces and miraculously doesn't break anything so > you can still use the core stuff or you can use the new models if you want > to. > > For example we have the RichSequence interface which closely follows > biosql but also extends Sequence, so anywhere you can use Sequence you can > happily use a RichSequence (or just a plain old Sequence). The really cool > stuff is the work Richard has done with Hibernate. The whole of BioSQL can > now be happily transported back and forth to biojava via hibernate. It's > amazingly painless and seems to avoid many of the problems of our old SQL > system. The model is also decoupled from hibernate completely so you can > use the objects for your normal biojava stuff without ever having a > database for persistence. > > We also have a NCBITaxon class to handle all the issues Andreas brought > up. > > The whole thing is available from CVS under the org.biojavax.bio package. > We chose the name biojavax to be analogous to the relationship between > java and javax. The javax packages are extensions to the core java. They > improve it, they sometimes deprecate it, they use it, but they don't > replace it. The same is true for biojavax. It is not a replacement. It is > an extension that gives better functionality but still gets a lot of > milage out of biojava. Importantly, they are not seperate packages. There > is also a genetic algorithm framework under org.biojavax.ga but that's an > entirely different story : ) > > The biojavax packages should be considered highly unstable at the moment > as we are still working out the kinks. More later. > > - Mark > > Mark Schreiber > Principal Scientist (Bioinformatics) > > Novartis Institute for Tropical Diseases (NITD) > 10 Biopolis Road > #05-01 Chromos > Singapore 138670 > www.nitd.novartis.com > > phone +65 6722 2973 > fax +65 6722 2910 > > > > > > Len Trigg > Sent by: biojava-dev-bounces@portal.open-bio.org > 08/15/2005 06:22 AM > > > To: Andreas Dräger > cc: biojava-dev@biojava.org, (bcc: Mark Schreiber/GP/Novartis) > Subject: Re: [Biojava-dev] Suggestions for the BioJava project > > > > Andreas Dräger wrote: > > I am and currently working with BioSQL and BioJava. Trying to insert > > the NCBI taxon hierachy and also different kinds of biosequences into > > the database I got to know that there are still some open problems in > > BioJava. Since I wrote some classes anyway, I would like to contribute > > them to the community. > > Good stuff. The work that I did with the TaxonSQL classes was based > on the fairly simple requirements of the project I was working on, > which is why you found the current implementation a bit limited. (I > don't have projects involving BioJava at the moment, so haven't been > doing much other than following the mailing list.) > > > > I modified the functions to put and retrieve taxa into the database so > > that they consider that the names Map could sometimes point to a Set of > > names instead of normal name Strings. > > In addition I considered the other information that can be inserted in > > the database like genetic code and so on. > > Excellent improvements. > > > > However, there are some methods in TaxonSQL.java that are defined to be > > private. If they were protected, an extension of this class could call > them. > > But because they're private, I had to copy and paste them. > > That class isn't really designed for extension, since it's plugged > directly into calls from BioSQLSequenceAnnotation and BioSQLSequenceDB > (you presumably had to change these to point to your MySQLTaxon) and > there's no need for multiple implementations. I'd say that your > changes should instead be folded directly as improvements to TaxonSQL > itself so that everyone gets the improvements out of the box. > > > Cheers, > Len. > > _______________________________________________ > biojava-dev mailing list > biojava-dev@biojava.org > http://biojava.org/mailman/listinfo/biojava-dev > > > > > _______________________________________________ > biojava-dev mailing list > biojava-dev@biojava.org > http://biojava.org/mailman/listinfo/biojava-dev > From mark.schreiber at novartis.com Tue Aug 16 21:18:51 2005 From: mark.schreiber at novartis.com (mark.schreiber@novartis.com) Date: Tue Aug 16 21:09:34 2005 Subject: [Biojava-dev] Suggestions for the BioJava project Message-ID: Now that is tres cool! Surely this should be in source-forge or similar? It seems useful way beyond biojava. Biojava is not yet using generics or 1.5 language features but this will be cool when it does. - Mark Michael Heuer Sent by: biojava-dev-bounces@portal.open-bio.org 08/17/2005 03:01 AM To: Mark Schreiber/GP/Novartis@PH cc: Len Trigg , hollandr@gis.a-star.edu.sg, biojava-dev@biojava.org, Andreas Dr?ger Subject: Re: [Biojava-dev] Suggestions for the BioJava project Hello Mark, Richard This is very cool. I took a quick look and noticed a few consistency problems and several different styles of javadoc comments, but nothing major. I'll wait until development slows down a bit before submitting any style-related patches. Unfortunately it's a little bit late, now that you already have something that works, but I committed a source code generation library and shell interface to the biojava subversion repository, at > http://www.derkholm.net/svn/repos/biojava-expr/trunk/codegen/ > http://www.derkholm.net/svn/repos/biojava-expr/trunk/codegen-shell/ to save myself a lot of typing, particularly in javadoc comments. You do a little of this $ java -jar codegen-shell.jar % InterfaceDescription foo = new InterfaceDescription("Foo"); % foo.attribute(..., Cardinality.ZeroToOne); % foo.associate(..., Cardinality.OneToMany); % ClassDescription simpleFoo = new ClassDescription("SimpleFoo"); % simpleFoo.realizes(foo); % generateSource(foo); % generateSource(simpleFoo, Style.RichlyMutable); and you get something like (sorry if the formatting doesn't work out) --- Foo.java import java.util.Set; import java.util.List; import java.util.SortedSet; /** * foo * * @author codegen * @version $Revision$ $Date$ */ public interface Foo { /** * Return the foo id for this foo. * The foo id will not be null. * * @return the foo id for this foo */ Long getFooId(); /** * Return the name for this foo. * The name may be null. * * @return the name for this foo */ String getName(); /** * Return an unmodifiable set of synonyms * for this foo. The returned set may be * empty but will not be null. * * @return an unmodifiable set of synonyms * for this foo */ Set getSynonyms(); /** * Return an unmodifiable list of positions * for this foo. The returned list will * not be null and will contain at least one position. * * @return an unmodifiable list of positions * for this foo */ List getPositions(); /** * Return the optional bar for this foo. * The optional bar may be null. * * @return the optional bar for this foo */ Bar getOptionalBar(); /** * Return the required bar for this foo. * The required bar will not be null. * * @return the required bar for this foo */ Bar getRequiredBar(); /** * Return an unmodifiable list of additional bars * for this foo. The returned list may be * empty but will not be null. * * @return an unmodifiable list of additional bars * for this foo */ List getAdditionalBars(); /** * Return an unmodifiable sorted set of other bars * for this foo. The returned sorted set will * not be null and will contain at least one other bar. * * @return an unmodifiable sorted set of other bars * for this foo */ SortedSet getOtherBars(); } --- SimpleFoo.java: import java.util.Set; import java.util.HashSet; import java.util.Collections; import java.util.List; import java.util.ArrayList; import java.util.SortedSet; import java.util.TreeSet; /** * simple foo. * * @author codegen * @version $Revision$ $Date$ */ public class SimpleFoo implements Foo { /** The foo id for this simple foo. */ private Long fooId; /** The name for this simple foo. */ private String name; /** The set of synonyms for this simple foo. */ private final Set synonyms; /** The list of positions for this simple foo. */ private final List positions; /** The optional bar for this simple foo. */ private Bar optionalBar; /** The required bar for this simple foo. */ private Bar requiredBar; /** The list of additional bars for this simple foo. */ private final List additionalBars; /** The sorted set of other bars for this simple foo. */ private final SortedSet otherBars; /** * Create a new simple foo from the specified required parameters. * *

The specified list of positions must contain at least one position. * The positions in positions are copied defensively * into this class.

* *

The specified sorted set of other bars must contain at least one other bar. * The other bars in otherBars are copied defensively * into this class.

* * @param fooId foo id for this simple foo, must not be null * @param positions list of integers, must not be null and must * contain at least one integer * @param requiredBar required bar for this simple foo, must not be null * @param otherBars sorted set of bars, must not be null and must * contain at least one bar * * @throws IllegalArgumentException if positions.size() < 1 * * @throws IllegalArgumentException if otherBars.size() < 1 */ public SimpleFoo( final Long fooId, final List positions, final Bar requiredBar, final SortedSet otherBars) { if (fooId == null) { throw new IllegalArgumentException("fooId must not be null"); } if (positions == null) { throw new IllegalArgumentException("positions must not be null"); } if (positions.size() < 1) { throw new IllegalArgumentException("positions must contain at least one position"); } if (requiredBar == null) { throw new IllegalArgumentException("requiredBar must not be null"); } if (otherBars == null) { throw new IllegalArgumentException("otherBars must not be null"); } if (otherBars.size() < 1) { throw new IllegalArgumentException("otherBars must contain at least one other bar"); } setFooId(fooId); setName(null); this.synonyms = new HashSet(); this.positions = new ArrayList(positions)); setOptionalBar(null); setRequiredBar(requiredBar); this.additionalBars = new ArrayList(); this.otherBars = new TreeSet(otherBars); } /** * Create a new simple foo from the specified parameters. * *

The synonyms in synonyms are copied defensively * into this class.

* *

The specified list of positions must contain at least one position. * The positions in positions are copied defensively * into this class.

* *

The additional bars in additionalBars are copied defensively * into this class.

* *

The specified sorted set of other bars must contain at least one other bar. * The other bars in otherBars are copied defensively * into this class.

* * @param fooId foo id for this simple foo, must not be null * @param name name for this simple foo * @param synonyms set of synonyms, must not be null * @param positions list of integers, must not be null and must * contain at least one integer * @param optionalBar optional bar for this simple foo * @param requiredBar required bar for this simple foo, must not be null * @param additionalBars list of additional bars, must not be null * @param otherBars sorted set of bars, must not be null and must * contain at least one bar * * @throws IllegalArgumentException if positions.size() < 1 * * @throws IllegalArgumentException if otherBars.size() < 1 */ public SimpleFoo( final Long fooId, final String name, final Set synonyms, final List positions, final Bar optionalBar, final Bar requiredBar, final List additionalBars, final SortedSet otherBars) { if (fooId == null) { throw new IllegalArgumentException("fooId must not be null"); } if (synonyms == null) { throw new IllegalArgumentException("synonyms must not be null"); } if (positions == null) { throw new IllegalArgumentException("positions must not be null"); } if (positions.size() < 1) { throw new IllegalArgumentException("positions must contain at least one position"); } if (requiredBar == null) { throw new IllegalArgumentException("requiredBar must not be null"); } if (additionalBars == null) { throw new IllegalArgumentException("additionalBars must not be null"); } if (otherBars == null) { throw new IllegalArgumentException("otherBars must not be null"); } if (otherBars.size() < 1) { throw new IllegalArgumentException("otherBars must contain at least one other bar"); } setFooId(fooId); setName(name); this.synonyms = new HashSet(synonyms); this.positions = new ArrayList(positions); setOptionalBar(optionalBar); setRequiredBar(requiredBar); this.additionalBars = new ArrayList(additionalBars); this.otherBars = new TreeSet(otherBars); } /** * Return the foo id for this simple foo. * The foo id will not be null. * * @return the foo id for this simple foo */ public final Long getFooId() { return fooId; } /** * Set the foo id for this simple foo to fooId. * * @param fooId foo id for this simple foo, must not be null */ public final void setFooId(final Long fooId) { if (fooId == null) { throw new IllegalArgumentException("fooId must not be null"); } this.fooId = fooId; } /** * Return the name for this simple foo. * The name may be null. * * @return the name for this simple foo */ public final String getName() { return name; } /** * Set the name for this simple foo to name. * * @param name name for this simple foo */ public final void setName(final String name) { this.name = name; } /** * Return an unmodifiable set of synonyms * for this simple foo. The returned set may be * empty but will not be null. * * @return an unmodifiable set of synonyms * for this simple foo */ public final Set getSynonyms() { return Collections.unmodifiableSet(synonyms); } /** * Add the specified synonym to the set of * synonyms for this simple foo. An exception * may be thrown if the underlying set prevents * synonym from being added. * * @param synonym synonym to add */ public final void addSynonym(final String synonym) { synonyms.add(synonym); } /** * Add all of the synonyms in the specified collection of synonyms * to the set of synonyms for this simple foo. * An exception may be thrown if the underlying * set prevents any of the synonyms in * synonyms from being added. * * @param synonyms collection of synonyms to add */ public final void addAllSynonyms(final Collection synonyms) { this.synonyms.addAll(synonyms); } /** * Remove the specified synonym from the set of * synonyms for this simple foo. An exception * may be thrown if the underlying set prevents * synonym from being removed. * * @param synonym synonym to remove */ public final void removeSynonym(final String synonym) { synonyms.remove(synonym); } /** * Remove all of the synonyms in the set of * synonyms for this simple foo that are also contained in the * specified collection of synonyms. An exception * may be thrown if the underlying set prevents any * of the synonyms in synonyms from being removed. * * @param synonyms collection of synonyms to remove */ public final void removeAllSynonyms(final Collection synonyms) { this.synonyms.removeAll(synonyms); } /** * Retain only the synonyms in the set of * synonyms for this simple foo that are contained in the specified * collection of synonyms. An exception may be thrown * if the underlying set prevents any of the synonyms * not in synonyms from being removed. * * @param synonyms collection of synonyms to retain */ public final void retainAllSynonyms(final Collection synonyms) { this.synonyms.retainAll(synonyms); } /** * Remove all of the synonyms in the set of * synonyms for this simple foo. An exception may * be thrown if the underlying set prevents any of the * synonyms from being removed. */ public final void clearSynonyms() { synonyms.clear(); } /** * Return an unmodifiable list of positions * for this simple foo. The returned list will * not be null and will contain at least one position. * * @return an unmodifiable list of positions * for this simple foo */ public final List getPositions() { return Collections.unmodifiableList(positions); } /** * Add the specified position to the list of * positions for this simple foo. An exception * may be thrown if the underlying list prevents * position from being added. * * @param position position to add */ public final void addPosition(final Integer position) { positions.add(position); } /** * Add all of the positions in the specified collection of positions * to the list of positions for this simple foo. * An exception may be thrown if the underlying * list prevents any of the positions in * positions from being added. * * @param positions collection of positions to add */ public final void addAllPositions(final Collection positions) { this.positions.addAll(positions); } /** * Remove the specified position from the list of * positions for this simple foo. An exception * may be thrown if the underlying list prevents * position from being removed. * * @param position position to remove */ public final void removePosition(final Integer position) { positions.remove(position); } /** * Remove all of the positions in the list of * positions for this simple foo that are also contained in the * specified collection of positions. An exception * may be thrown if the underlying list prevents any * of the positions in positions from being removed. * * @param positions collection of positions to remove */ public final void removeAllPositions(final Collection positions) { this.positions.removeAll(positions); } /** * Retain only the positions in the list of * positions for this simple foo that are contained in the specified * collection of positions. An exception may be thrown * if the underlying list prevents any of the positions * not in positions from being removed. * * @param positions collection of positions to retain */ public final void retainAllPositions(final Collection positions) { this.positions.retainAll(positions); } /** * Remove all of the positions in the list of * positions for this simple foo. An exception may * be thrown if the underlying list prevents any of the * positions from being removed. */ public final void clearPositions() { positions.clear(); } /** * Return the optional bar for this simple foo. * The optional bar may be null. * * @return the optional bar for this simple foo */ public final Bar getOptionalBar() { return optionalBar; } /** * Set the optional bar for this simple foo to optionalBar. * * @param optionalBar optional bar for this simple foo */ public final void setOptionalBar(final Bar optionalBar) { this.optionalBar = optionalBar; } /** * Return the required bar for this simple foo. * The required bar will not be null. * * @return the required bar for this simple foo */ public final Bar getRequiredBar() { return requiredBar; } /** * Set the required bar for this simple foo to requiredBar. * * @param requiredBar required bar for this simple foo, must not be null */ public final void setRequiredBar(final Bar requiredBar) { if (requiredBar == null) { throw new IllegalArgumentException("requiredBar must not be null"); } this.requiredBar = requiredBar; } /** * Return an unmodifiable list of additional bars * for this simple foo. The returned list may be * empty but will not be null. * * @return an unmodifiable list of additional bars * for this simple foo */ public final List getAdditionalBars() { return Collections.unmodifiableList(additionalBars); } /** * Add the specified additional bar to the list of * additional bars for this simple foo. An exception * may be thrown if the underlying list prevents * additionalBar from being added. * * @param additionalBar additional bar to add */ public final void addAdditionalBar(final Bar additionalBar) { additionalBars.add(additionalBar); } /** * Add all of the additional bars in the specified collection of additional bars * to the list of additional bars for this simple foo. * An exception may be thrown if the underlying * list prevents any of the additional bars in * additionalBars from being added. * * @param additionalBars collection of additional bars to add */ public final void addAllAdditionalBars(final Collection additionalBars) { this.additionalBars.addAll(additionalBars); } /** * Remove the specified additional bar from the list of * additional bars for this simple foo. An exception * may be thrown if the underlying list prevents * additionalBar from being removed. * * @param additionalBar additional bar to remove */ public final void removeAdditionalBar(final Bar additionalBar) { additionalBars.remove(additionalBar); } /** * Remove all of the additional bars in the list of * additional bars for this simple foo that are also contained in the * specified collection of additional bars. An exception * may be thrown if the underlying list prevents any * of the additional bars in additionalBars from being removed. * * @param additionalBars collection of additional bars to remove */ public final void removeAllAdditionalBars(final Collection additionalBars) { this.additionalBars.removeAll(additionalBars); } /** * Retain only the additional bars in the list of * additional bars for this simple foo that are contained in the specified * collection of additional bars. An exception may be thrown * if the underlying list prevents any of the additional bars * not in additionalBars from being removed. * * @param additionalBars collection of additional bars to retain */ public final void retainAllAdditionalBars(final Collection additionalBars) { this.additionalBars.retainAll(additionalBars); } /** * Remove all of the additional bars in the list of * additional bars for this simple foo. An exception may * be thrown if the underlying list prevents any of the * additional bars from being removed. */ public final void clearAdditionalBars() { additionalBars.clear(); } /** * Return an unmodifiable sorted set of other bars * for this simple foo. The returned sorted set will * not be null and will contain at least one other bar. * * @return an unmodifiable sorted set of other bars * for this simple foo */ public final SortedSet getOtherBars() { return Collections.unmodifiableSortedSet(otherBars); } /** * Add the specified other bar to the sorted set of * other bars for this simple foo. An exception * may be thrown if the underlying sorted set prevents * otherBar from being added. * * @param otherBar other bar to add */ public final void addOtherBar(final Bar otherBar) { otherBars.add(otherBar); } /** * Add all of the other bars in the specified collection of other bars * to the sorted set of other bars for this simple foo. * An exception may be thrown if the underlying * sorted set prevents any of the other bars in * otherBars from being added. * * @param otherBars collection of other bars to add */ public final void addAllOtherBars(final Collection otherBars) { this.otherBars.addAll(otherBars); } /** * Remove the specified other bar from the sorted set of * other bars for this simple foo. An exception * may be thrown if the underlying sorted set prevents * otherBar from being removed. * * @param otherBar other bar to remove */ public final void removeOtherBar(final Bar otherBar) { otherBars.remove(otherBar); } /** * Remove all of the other bars in the sorted set of * other bars for this simple foo that are also contained in the * specified collection of other bars. An exception * may be thrown if the underlying sorted set prevents any * of the other bars in otherBars from being removed. * * @param otherBars collection of other bars to remove */ public final void removeAllOtherBars(final Collection otherBars) { this.otherBars.removeAll(otherBars); } /** * Retain only the other bars in the sorted set of * other bars for this simple foo that are contained in the specified * collection of other bars. An exception may be thrown * if the underlying sorted set prevents any of the other bars * not in otherBars from being removed. * * @param otherBars collection of other bars to retain */ public final void retainAllOtherBars(final Collection otherBars) { this.otherBars.retainAll(otherBars); } /** * Remove all of the other bars in the sorted set of * other bars for this simple foo. An exception may * be thrown if the underlying sorted set prevents any of the * other bars from being removed. */ public final void clearOtherBars() { otherBars.clear(); } /** @see Object */ public final boolean equals(final Object o) { if (o == this) { return true; } if (!(o instanceof SimpleFoo)) { return false; } SimpleFoo simpleFoo = (SimpleFoo) o; return (true && (fooId.equals(simpleFoo.getFooId())) && ((name == null) ? (simpleFoo.getName() == null) : name.equals(simpleFoo.getName())) && (synonyms.equals(simpleFoo.getSynonyms())) && (positions.equals(simpleFoo.getPositions())) && ((optionalBar == null) ? (simpleFoo.getOptionalBar() == null) : optionalBar.equals(simpleFoo.getOptionalBar())) && (requiredBar.equals(simpleFoo.getRequiredBar())) && (additionalBars.equals(simpleFoo.getAdditionalBars())) && (otherBars.equals(simpleFoo.getOtherBars())) ); } /** @see Object */ public final int hashCode() { int result = 17; result = 37 * result + ((fooId == null) ? 0 : fooId.hashCode()); result = 37 * result + ((name == null) ? 0 : name.hashCode()); result = 37 * result + synonyms.hashCode(); result = 37 * result + positions.hashCode(); result = 37 * result + ((optionalBar == null) ? 0 : optionalBar.hashCode()); result = 37 * result + ((requiredBar == null) ? 0 : requiredBar.hashCode()); result = 37 * result + additionalBars.hashCode(); result = 37 * result + otherBars.hashCode(); return result; } } --- Whew, now that's a lot of typing saved. michael On Mon, 15 Aug 2005 mark.schreiber@novartis.com wrote: > It's probably premature to announce this but Richard Holland and I have > been working on a new object model that will pesist very easily to BioSQL. > It extends the core interfaces and miraculously doesn't break anything so > you can still use the core stuff or you can use the new models if you want > to. > > For example we have the RichSequence interface which closely follows > biosql but also extends Sequence, so anywhere you can use Sequence you can > happily use a RichSequence (or just a plain old Sequence). The really cool > stuff is the work Richard has done with Hibernate. The whole of BioSQL can > now be happily transported back and forth to biojava via hibernate. It's > amazingly painless and seems to avoid many of the problems of our old SQL > system. The model is also decoupled from hibernate completely so you can > use the objects for your normal biojava stuff without ever having a > database for persistence. > > We also have a NCBITaxon class to handle all the issues Andreas brought > up. > > The whole thing is available from CVS under the org.biojavax.bio package. > We chose the name biojavax to be analogous to the relationship between > java and javax. The javax packages are extensions to the core java. They > improve it, they sometimes deprecate it, they use it, but they don't > replace it. The same is true for biojavax. It is not a replacement. It is > an extension that gives better functionality but still gets a lot of > milage out of biojava. Importantly, they are not seperate packages. There > is also a genetic algorithm framework under org.biojavax.ga but that's an > entirely different story : ) > > The biojavax packages should be considered highly unstable at the moment > as we are still working out the kinks. More later. > > - Mark > > Mark Schreiber > Principal Scientist (Bioinformatics) > > Novartis Institute for Tropical Diseases (NITD) > 10 Biopolis Road > #05-01 Chromos > Singapore 138670 > www.nitd.novartis.com > > phone +65 6722 2973 > fax +65 6722 2910 > > > > > > Len Trigg > Sent by: biojava-dev-bounces@portal.open-bio.org > 08/15/2005 06:22 AM > > > To: Andreas Dr?ger > cc: biojava-dev@biojava.org, (bcc: Mark Schreiber/GP/Novartis) > Subject: Re: [Biojava-dev] Suggestions for the BioJava project > > > > Andreas Dr?ger wrote: > > I am and currently working with BioSQL and BioJava. Trying to insert > > the NCBI taxon hierachy and also different kinds of biosequences into > > the database I got to know that there are still some open problems in > > BioJava. Since I wrote some classes anyway, I would like to contribute > > them to the community. > > Good stuff. The work that I did with the TaxonSQL classes was based > on the fairly simple requirements of the project I was working on, > which is why you found the current implementation a bit limited. (I > don't have projects involving BioJava at the moment, so haven't been > doing much other than following the mailing list.) > > > > I modified the functions to put and retrieve taxa into the database so > > that they consider that the names Map could sometimes point to a Set of > > names instead of normal name Strings. > > In addition I considered the other information that can be inserted in > > the database like genetic code and so on. > > Excellent improvements. > > > > However, there are some methods in TaxonSQL.java that are defined to be > > private. If they were protected, an extension of this class could call > them. > > But because they're private, I had to copy and paste them. > > That class isn't really designed for extension, since it's plugged > directly into calls from BioSQLSequenceAnnotation and BioSQLSequenceDB > (you presumably had to change these to point to your MySQLTaxon) and > there's no need for multiple implementations. I'd say that your > changes should instead be folded directly as improvements to TaxonSQL > itself so that everyone gets the improvements out of the box. > > > Cheers, > Len. > > _______________________________________________ > biojava-dev mailing list > biojava-dev@biojava.org > http://biojava.org/mailman/listinfo/biojava-dev > > > > > _______________________________________________ > biojava-dev mailing list > biojava-dev@biojava.org > http://biojava.org/mailman/listinfo/biojava-dev > _______________________________________________ biojava-dev mailing list biojava-dev@biojava.org http://biojava.org/mailman/listinfo/biojava-dev From heuermh at acm.org Wed Aug 17 11:53:45 2005 From: heuermh at acm.org (Michael Heuer) Date: Wed Aug 17 11:44:03 2005 Subject: [Biojava-dev] Suggestions for the BioJava project In-Reply-To: Message-ID: > Surely this should be in source-forge or similar? It seems useful way > beyond biojava. Biojava is not yet using generics or 1.5 language features > but this will be cool when it does. You're right, it should probably be moved to source-forge. But I'm afraid that without a second or third set of eyes it'll probably just languish there. Like I said in my talk at BOSC, there are a lot of wicked smart java developers on this list, and it's a great place to feel out new ideas. As for the 1.5 language features, the key mechanism in this library is to use different Velocity (http://jakarta.apache.org/velocity) templates to generate different source code styles. Thus with a little knowledge of VTL it would be possible to create non-generic (or Hibernate-compatible, etc.) styles. See > http://tinyurl.com/amx55 (derkholm.net/svn/repos/.../Style.java) > http://tinyurl.com/dluuc (derkholm.net/svn/repos/.../resources/...) and > http://shore.net/~heuermh/codegen-shell.jar (executable jar file) > http://shore.net/~heuermh/codegen-apidocs.tar.gz (javadocs) michael From heuermh at acm.org Wed Aug 17 12:03:36 2005 From: heuermh at acm.org (Michael Heuer) Date: Wed Aug 17 11:51:58 2005 Subject: [Biojava-dev] Suggestions for the BioJava project In-Reply-To: <6D9E9B9DF347EF4385F6271C64FB8D5601FE4EA2@BIONIC.biopolis.one-north.com> Message-ID: Richard HOLLAND wrote: > Thanks for that, it looks very interesting. About a month too late but ah well.... :) :) Sorry, it's been up for almost a year but I hadn't done anything to promote it. Guess we need cvs/svn commit messages sent to the list. Wasn't someone looking into migrating the open-bio repositories from cvs to subversion? Oh yeah, that was me. I do have a pretty good plan for the repository architecture and directory structure and so on, with help from the guys at Apache who did their cvs --> svn conversion, but am not so good at the configuring and installing part, specifically with regards to security issues, so if anyone else with those kind of skills is interested in helping, I can forward you the open-bio help ticket we've been using to track progress. michael From hollandr at gis.a-star.edu.sg Tue Aug 16 21:13:47 2005 From: hollandr at gis.a-star.edu.sg (Richard HOLLAND) Date: Tue Aug 23 09:52:38 2005 Subject: [Biojava-dev] Suggestions for the BioJava project Message-ID: <6D9E9B9DF347EF4385F6271C64FB8D5601FE4EA2@BIONIC.biopolis.one-north.com> Thanks for that, it looks very interesting. About a month too late but ah well.... :) :) Yeah I know the code we have written is a bit messy, I have a very bad habit of writing code that works first and looks good later. Mark and I will go through tidying up a bit and adding JavaDocs over the next few weeks. Richard Holland Bioinformatics Specialist GIS extension 8199 --------------------------------------------- This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it for any purpose, or disclose its content to any other person. Thank you. --------------------------------------------- > -----Original Message----- > From: Michael Heuer [mailto:heuermh@shell3.shore.net] On > Behalf Of Michael Heuer > Sent: Wednesday, August 17, 2005 3:01 AM > To: mark.schreiber@novartis.com > Cc: Len Trigg; Andreas Dr?ger; Richard HOLLAND; > biojava-dev@biojava.org > Subject: Re: [Biojava-dev] Suggestions for the BioJava project > > > Hello Mark, Richard > > This is very cool. I took a quick look and noticed a few consistency > problems and several different styles of javadoc comments, but nothing > major. I'll wait until development slows down a bit before submitting > any style-related patches. > > Unfortunately it's a little bit late, now that you already > have something > that works, but I committed a source code generation library and shell > interface to the biojava subversion repository, at > > > http://www.derkholm.net/svn/repos/biojava-expr/trunk/codegen/ > > http://www.derkholm.net/svn/repos/biojava-expr/trunk/codegen-shell/ > > to save myself a lot of typing, particularly in javadoc comments. > > > You do a little of this > > $ java -jar codegen-shell.jar > > % InterfaceDescription foo = new InterfaceDescription("Foo"); > % foo.attribute(..., Cardinality.ZeroToOne); > % foo.associate(..., Cardinality.OneToMany); > > % ClassDescription simpleFoo = new ClassDescription("SimpleFoo"); > % simpleFoo.realizes(foo); > > % generateSource(foo); > % generateSource(simpleFoo, Style.RichlyMutable); > > > and you get something like > > (sorry if the formatting doesn't work out) > > --- Foo.java > > import java.util.Set; > import java.util.List; > import java.util.SortedSet; > > /** > * foo > * > * @author codegen > * @version $Revision$ $Date$ > */ > public interface Foo > { > > /** > * Return the foo id for this foo. > * The foo id will not be null. > * > * @return the foo id for this foo > */ > Long getFooId(); > > /** > * Return the name for this foo. > * The name may be null. > * > * @return the name for this foo > */ > String getName(); > > /** > * Return an unmodifiable set of synonyms > * for this foo. The returned set may be > * empty but will not be null. > * > * @return an unmodifiable set of synonyms > * for this foo > */ > Set getSynonyms(); > > /** > * Return an unmodifiable list of positions > * for this foo. The returned list will > * not be null and will contain at least one position. > * > * @return an unmodifiable list of positions > * for this foo > */ > List getPositions(); > > /** > * Return the optional bar for this foo. > * The optional bar may be null. > * > * @return the optional bar for this foo > */ > Bar getOptionalBar(); > > /** > * Return the required bar for this foo. > * The required bar will not be null. > * > * @return the required bar for this foo > */ > Bar getRequiredBar(); > > /** > * Return an unmodifiable list of additional bars > * for this foo. The returned list may be > * empty but will not be null. > * > * @return an unmodifiable list of additional bars > * for this foo > */ > List getAdditionalBars(); > > /** > * Return an unmodifiable sorted set of other bars > * for this foo. The returned sorted set will > * not be null and will contain at least one other bar. > * > * @return an unmodifiable sorted set of other bars > * for this foo > */ > SortedSet getOtherBars(); > } > > --- SimpleFoo.java: > > import java.util.Set; > import java.util.HashSet; > import java.util.Collections; > import java.util.List; > import java.util.ArrayList; > import java.util.SortedSet; > import java.util.TreeSet; > > /** > * simple foo. > * > * @author codegen > * @version $Revision$ $Date$ > */ > public class SimpleFoo > implements Foo > { > /** The foo id for this simple foo. */ > private Long fooId; > > /** The name for this simple foo. */ > private String name; > > /** The set of synonyms for this simple foo. */ > private final Set synonyms; > > /** The list of positions for this simple foo. */ > private final List positions; > > /** The optional bar for this simple foo. */ > private Bar optionalBar; > > /** The required bar for this simple foo. */ > private Bar requiredBar; > > /** The list of additional bars for this simple foo. */ > private final List additionalBars; > > /** The sorted set of other bars for this simple foo. */ > private final SortedSet otherBars; > > > /** > * Create a new simple foo from the specified required parameters. > * > *

The specified list of positions must contain at > least one position. > * The positions in positions are copied defensively > * into this class.

> * > *

The specified sorted set of other bars must contain > at least one other bar. > * The other bars in otherBars are copied defensively > * into this class.

> * > * @param fooId foo id for this simple foo, must not be null > * @param positions list of integers, must not be null and must > * contain at least one integer > * @param requiredBar required bar for this simple foo, > must not be null > * @param otherBars sorted set of bars, must not be null and must > * contain at least one bar > * > * @throws IllegalArgumentException if > positions.size() < 1 > * > * @throws IllegalArgumentException if > otherBars.size() < 1 > */ > public SimpleFoo( > final Long fooId, > final List positions, > final Bar requiredBar, > final SortedSet otherBars) > { > if (fooId == null) > { > throw new IllegalArgumentException("fooId must > not be null"); > } > if (positions == null) > { > throw new IllegalArgumentException("positions > must not be null"); > } > if (positions.size() < 1) > { > throw new IllegalArgumentException("positions > must contain at least one position"); > } > if (requiredBar == null) > { > throw new IllegalArgumentException("requiredBar > must not be null"); > } > if (otherBars == null) > { > throw new IllegalArgumentException("otherBars > must not be null"); > } > if (otherBars.size() < 1) > { > throw new IllegalArgumentException("otherBars > must contain at least one other bar"); > } > > setFooId(fooId); > setName(null); > this.synonyms = new HashSet(); > this.positions = new ArrayList(positions)); > setOptionalBar(null); > setRequiredBar(requiredBar); > this.additionalBars = new ArrayList(); > this.otherBars = new TreeSet(otherBars); > } > > /** > * Create a new simple foo from the specified parameters. > * > *

The synonyms in synonyms are copied defensively > * into this class.

> * > *

The specified list of positions must contain at > least one position. > * The positions in positions are copied defensively > * into this class.

> * > *

The additional bars in additionalBars > are copied defensively > * into this class.

> * > *

The specified sorted set of other bars must contain > at least one other bar. > * The other bars in otherBars are copied defensively > * into this class.

> * > * @param fooId foo id for this simple foo, must not be null > * @param name name for this simple foo > * @param synonyms set of synonyms, must not be null > * @param positions list of integers, must not be null and must > * contain at least one integer > * @param optionalBar optional bar for this simple foo > * @param requiredBar required bar for this simple foo, > must not be null > * @param additionalBars list of additional bars, must not be null > * @param otherBars sorted set of bars, must not be null and must > * contain at least one bar > * > * @throws IllegalArgumentException if > positions.size() < 1 > * > * @throws IllegalArgumentException if > otherBars.size() < 1 > */ > public SimpleFoo( > final Long fooId, > final String name, > final Set synonyms, > final List positions, > final Bar optionalBar, > final Bar requiredBar, > final List additionalBars, > final SortedSet otherBars) > { > if (fooId == null) > { > throw new IllegalArgumentException("fooId must > not be null"); > } > if (synonyms == null) > { > throw new IllegalArgumentException("synonyms must > not be null"); > } > if (positions == null) > { > throw new IllegalArgumentException("positions > must not be null"); > } > if (positions.size() < 1) > { > throw new IllegalArgumentException("positions > must contain at least one position"); > } > if (requiredBar == null) > { > throw new IllegalArgumentException("requiredBar > must not be null"); > } > if (additionalBars == null) > { > throw new > IllegalArgumentException("additionalBars must not be null"); > } > if (otherBars == null) > { > throw new IllegalArgumentException("otherBars > must not be null"); > } > if (otherBars.size() < 1) > { > throw new IllegalArgumentException("otherBars > must contain at least one other bar"); > } > > setFooId(fooId); > setName(name); > this.synonyms = new HashSet(synonyms); > this.positions = new ArrayList(positions); > setOptionalBar(optionalBar); > setRequiredBar(requiredBar); > this.additionalBars = new ArrayList(additionalBars); > this.otherBars = new TreeSet(otherBars); > } > > > /** > * Return the foo id for this simple foo. > * The foo id will not be null. > * > * @return the foo id for this simple foo > */ > public final Long getFooId() > { > return fooId; > } > > /** > * Set the foo id for this simple foo to fooId. > * > * @param fooId foo id for this simple foo, must not be null > */ > public final void setFooId(final Long fooId) > { > if (fooId == null) > { > throw new IllegalArgumentException("fooId must > not be null"); > } > > this.fooId = fooId; > } > > /** > * Return the name for this simple foo. > * The name may be null. > * > * @return the name for this simple foo > */ > public final String getName() > { > return name; > } > > /** > * Set the name for this simple foo to name. > * > * @param name name for this simple foo > */ > public final void setName(final String name) > { > this.name = name; > } > > /** > * Return an unmodifiable set of synonyms > * for this simple foo. The returned set may be > * empty but will not be null. > * > * @return an unmodifiable set of synonyms > * for this simple foo > */ > public final Set getSynonyms() > { > return Collections.unmodifiableSet(synonyms); > } > > /** > * Add the specified synonym to the set of > * synonyms for this simple foo. An exception > * may be thrown if the underlying set prevents > * synonym from being added. > * > * @param synonym synonym to add > */ > public final void addSynonym(final String synonym) > { > synonyms.add(synonym); > } > > /** > * Add all of the synonyms in the specified collection of synonyms > * to the set of synonyms for this simple foo. > * An exception may be thrown if the underlying > * set prevents any of the synonyms in > * synonyms from being added. > * > * @param synonyms collection of synonyms to add > */ > public final void addAllSynonyms(final Collection extends String> synonyms) > { > this.synonyms.addAll(synonyms); > } > > /** > * Remove the specified synonym from the set of > * synonyms for this simple foo. An exception > * may be thrown if the underlying set prevents > * synonym from being removed. > * > * @param synonym synonym to remove > */ > public final void removeSynonym(final String synonym) > { > synonyms.remove(synonym); > } > > /** > * Remove all of the synonyms in the set of > * synonyms for this simple foo that are also contained in the > * specified collection of synonyms. An exception > * may be thrown if the underlying set prevents any > * of the synonyms in synonyms from being removed. > * > * @param synonyms collection of synonyms to remove > */ > public final void removeAllSynonyms(final Collection extends String> synonyms) > { > this.synonyms.removeAll(synonyms); > } > > /** > * Retain only the synonyms in the set of > * synonyms for this simple foo that are contained in the > specified > * collection of synonyms. An exception may be thrown > * if the underlying set prevents any of the synonyms > * not in synonyms from being removed. > * > * @param synonyms collection of synonyms to retain > */ > public final void retainAllSynonyms(final Collection extends String> synonyms) > { > this.synonyms.retainAll(synonyms); > } > > /** > * Remove all of the synonyms in the set of > * synonyms for this simple foo. An exception may > * be thrown if the underlying set prevents any of the > * synonyms from being removed. > */ > public final void clearSynonyms() > { > synonyms.clear(); > } > > /** > * Return an unmodifiable list of positions > * for this simple foo. The returned list will > * not be null and will contain at least one position. > * > * @return an unmodifiable list of positions > * for this simple foo > */ > public final List getPositions() > { > return Collections.unmodifiableList(positions); > } > > /** > * Add the specified position to the list of > * positions for this simple foo. An exception > * may be thrown if the underlying list prevents > * position from being added. > * > * @param position position to add > */ > public final void addPosition(final Integer position) > { > positions.add(position); > } > > /** > * Add all of the positions in the specified collection > of positions > * to the list of positions for this simple foo. > * An exception may be thrown if the underlying > * list prevents any of the positions in > * positions from being added. > * > * @param positions collection of positions to add > */ > public final void addAllPositions(final Collection extends Integer> positions) > { > this.positions.addAll(positions); > } > > /** > * Remove the specified position from the list of > * positions for this simple foo. An exception > * may be thrown if the underlying list prevents > * position from being removed. > * > * @param position position to remove > */ > public final void removePosition(final Integer position) > { > positions.remove(position); > } > > /** > * Remove all of the positions in the list of > * positions for this simple foo that are also contained in the > * specified collection of positions. An exception > * may be thrown if the underlying list prevents any > * of the positions in positions from being removed. > * > * @param positions collection of positions to remove > */ > public final void removeAllPositions(final Collection extends Integer> positions) > { > this.positions.removeAll(positions); > } > > /** > * Retain only the positions in the list of > * positions for this simple foo that are contained in > the specified > * collection of positions. An exception may be thrown > * if the underlying list prevents any of the positions > * not in positions from being removed. > * > * @param positions collection of positions to retain > */ > public final void retainAllPositions(final Collection extends Integer> positions) > { > this.positions.retainAll(positions); > } > > /** > * Remove all of the positions in the list of > * positions for this simple foo. An exception may > * be thrown if the underlying list prevents any of the > * positions from being removed. > */ > public final void clearPositions() > { > positions.clear(); > } > > /** > * Return the optional bar for this simple foo. > * The optional bar may be null. > * > * @return the optional bar for this simple foo > */ > public final Bar getOptionalBar() > { > return optionalBar; > } > > /** > * Set the optional bar for this simple foo to > optionalBar. > * > * @param optionalBar optional bar for this simple foo > */ > public final void setOptionalBar(final Bar optionalBar) > { > this.optionalBar = optionalBar; > } > > /** > * Return the required bar for this simple foo. > * The required bar will not be null. > * > * @return the required bar for this simple foo > */ > public final Bar getRequiredBar() > { > return requiredBar; > } > > /** > * Set the required bar for this simple foo to > requiredBar. > * > * @param requiredBar required bar for this simple foo, > must not be null > */ > public final void setRequiredBar(final Bar requiredBar) > { > if (requiredBar == null) > { > throw new IllegalArgumentException("requiredBar > must not be null"); > } > > this.requiredBar = requiredBar; > } > > /** > * Return an unmodifiable list of additional bars > * for this simple foo. The returned list may be > * empty but will not be null. > * > * @return an unmodifiable list of additional bars > * for this simple foo > */ > public final List getAdditionalBars() > { > return Collections.unmodifiableList(additionalBars); > } > > /** > * Add the specified additional bar to the list of > * additional bars for this simple foo. An exception > * may be thrown if the underlying list prevents > * additionalBar from being added. > * > * @param additionalBar additional bar to add > */ > public final void addAdditionalBar(final Bar additionalBar) > { > additionalBars.add(additionalBar); > } > > /** > * Add all of the additional bars in the specified > collection of additional bars > * to the list of additional bars for this simple foo. > * An exception may be thrown if the underlying > * list prevents any of the additional bars in > * additionalBars from being added. > * > * @param additionalBars collection of additional bars to add > */ > public final void addAllAdditionalBars(final Collection extends Bar> additionalBars) > { > this.additionalBars.addAll(additionalBars); > } > > /** > * Remove the specified additional bar from the list of > * additional bars for this simple foo. An exception > * may be thrown if the underlying list prevents > * additionalBar from being removed. > * > * @param additionalBar additional bar to remove > */ > public final void removeAdditionalBar(final Bar additionalBar) > { > additionalBars.remove(additionalBar); > } > > /** > * Remove all of the additional bars in the list of > * additional bars for this simple foo that are also > contained in the > * specified collection of additional bars. An exception > * may be thrown if the underlying list prevents any > * of the additional bars in additionalBars > from being removed. > * > * @param additionalBars collection of additional bars to remove > */ > public final void removeAllAdditionalBars(final > Collection additionalBars) > { > this.additionalBars.removeAll(additionalBars); > } > > /** > * Retain only the additional bars in the list of > * additional bars for this simple foo that are contained > in the specified > * collection of additional bars. An exception may be thrown > * if the underlying list prevents any of the additional bars > * not in additionalBars from being removed. > * > * @param additionalBars collection of additional bars to retain > */ > public final void retainAllAdditionalBars(final > Collection additionalBars) > { > this.additionalBars.retainAll(additionalBars); > } > > /** > * Remove all of the additional bars in the list of > * additional bars for this simple foo. An exception may > * be thrown if the underlying list prevents any of the > * additional bars from being removed. > */ > public final void clearAdditionalBars() > { > additionalBars.clear(); > } > > /** > * Return an unmodifiable sorted set of other bars > * for this simple foo. The returned sorted set will > * not be null and will contain at least one other bar. > * > * @return an unmodifiable sorted set of other bars > * for this simple foo > */ > public final SortedSet getOtherBars() > { > return Collections.unmodifiableSortedSet(otherBars); > } > > /** > * Add the specified other bar to the sorted set of > * other bars for this simple foo. An exception > * may be thrown if the underlying sorted set prevents > * otherBar from being added. > * > * @param otherBar other bar to add > */ > public final void addOtherBar(final Bar otherBar) > { > otherBars.add(otherBar); > } > > /** > * Add all of the other bars in the specified collection > of other bars > * to the sorted set of other bars for this simple foo. > * An exception may be thrown if the underlying > * sorted set prevents any of the other bars in > * otherBars from being added. > * > * @param otherBars collection of other bars to add > */ > public final void addAllOtherBars(final Collection extends Bar> otherBars) > { > this.otherBars.addAll(otherBars); > } > > /** > * Remove the specified other bar from the sorted set of > * other bars for this simple foo. An exception > * may be thrown if the underlying sorted set prevents > * otherBar from being removed. > * > * @param otherBar other bar to remove > */ > public final void removeOtherBar(final Bar otherBar) > { > otherBars.remove(otherBar); > } > > /** > * Remove all of the other bars in the sorted set of > * other bars for this simple foo that are also contained in the > * specified collection of other bars. An exception > * may be thrown if the underlying sorted set prevents any > * of the other bars in otherBars from being removed. > * > * @param otherBars collection of other bars to remove > */ > public final void removeAllOtherBars(final Collection extends Bar> otherBars) > { > this.otherBars.removeAll(otherBars); > } > > /** > * Retain only the other bars in the sorted set of > * other bars for this simple foo that are contained in > the specified > * collection of other bars. An exception may be thrown > * if the underlying sorted set prevents any of the other bars > * not in otherBars from being removed. > * > * @param otherBars collection of other bars to retain > */ > public final void retainAllOtherBars(final Collection extends Bar> otherBars) > { > this.otherBars.retainAll(otherBars); > } > > /** > * Remove all of the other bars in the sorted set of > * other bars for this simple foo. An exception may > * be thrown if the underlying sorted set prevents any of the > * other bars from being removed. > */ > public final void clearOtherBars() > { > otherBars.clear(); > } > > /** @see Object */ > public final boolean equals(final Object o) > { > if (o == this) > { > return true; > } > if (!(o instanceof SimpleFoo)) > { > return false; > } > > SimpleFoo simpleFoo = (SimpleFoo) o; > > return (true > && (fooId.equals(simpleFoo.getFooId())) > && ((name == null) ? (simpleFoo.getName() == > null) : name.equals(simpleFoo.getName())) > && (synonyms.equals(simpleFoo.getSynonyms())) > && (positions.equals(simpleFoo.getPositions())) > && ((optionalBar == null) ? > (simpleFoo.getOptionalBar() == null) : > optionalBar.equals(simpleFoo.getOptionalBar())) > && (requiredBar.equals(simpleFoo.getRequiredBar())) > && (additionalBars.equals(simpleFoo.getAdditionalBars())) > && (otherBars.equals(simpleFoo.getOtherBars())) > ); > } > > /** @see Object */ > public final int hashCode() > { > int result = 17; > result = 37 * result + ((fooId == null) ? 0 : > fooId.hashCode()); > result = 37 * result + ((name == null) ? 0 : name.hashCode()); > result = 37 * result + synonyms.hashCode(); > result = 37 * result + positions.hashCode(); > result = 37 * result + ((optionalBar == null) ? 0 : > optionalBar.hashCode()); > result = 37 * result + ((requiredBar == null) ? 0 : > requiredBar.hashCode()); > result = 37 * result + additionalBars.hashCode(); > result = 37 * result + otherBars.hashCode(); > return result; > } > } > > --- > > Whew, now that's a lot of typing saved. > > michael > > > On Mon, 15 Aug 2005 mark.schreiber@novartis.com wrote: > > > It's probably premature to announce this but Richard > Holland and I have > > been working on a new object model that will pesist very > easily to BioSQL. > > It extends the core interfaces and miraculously doesn't > break anything so > > you can still use the core stuff or you can use the new > models if you want > > to. > > > > For example we have the RichSequence interface which closely follows > > biosql but also extends Sequence, so anywhere you can use > Sequence you can > > happily use a RichSequence (or just a plain old Sequence). > The really cool > > stuff is the work Richard has done with Hibernate. The > whole of BioSQL can > > now be happily transported back and forth to biojava via > hibernate. It's > > amazingly painless and seems to avoid many of the problems > of our old SQL > > system. The model is also decoupled from hibernate > completely so you can > > use the objects for your normal biojava stuff without ever having a > > database for persistence. > > > > We also have a NCBITaxon class to handle all the issues > Andreas brought > > up. > > > > The whole thing is available from CVS under the > org.biojavax.bio package. > > We chose the name biojavax to be analogous to the > relationship between > > java and javax. The javax packages are extensions to the > core java. They > > improve it, they sometimes deprecate it, they use it, but they don't > > replace it. The same is true for biojavax. It is not a > replacement. It is > > an extension that gives better functionality but still gets a lot of > > milage out of biojava. Importantly, they are not seperate > packages. There > > is also a genetic algorithm framework under org.biojavax.ga > but that's an > > entirely different story : ) > > > > The biojavax packages should be considered highly unstable > at the moment > > as we are still working out the kinks. More later. > > > > - Mark > > > > Mark Schreiber > > Principal Scientist (Bioinformatics) > > > > Novartis Institute for Tropical Diseases (NITD) > > 10 Biopolis Road > > #05-01 Chromos > > Singapore 138670 > > www.nitd.novartis.com > > > > phone +65 6722 2973 > > fax +65 6722 2910 > > > > > > > > > > > > Len Trigg > > Sent by: biojava-dev-bounces@portal.open-bio.org > > 08/15/2005 06:22 AM > > > > > > To: Andreas Dr?ger > > > cc: biojava-dev@biojava.org, (bcc: Mark > Schreiber/GP/Novartis) > > Subject: Re: [Biojava-dev] Suggestions for > the BioJava project > > > > > > > > Andreas Dr?ger wrote: > > > I am and currently working with BioSQL and BioJava. > Trying to insert > > > the NCBI taxon hierachy and also different kinds of > biosequences into > > > the database I got to know that there are still some open > problems in > > > BioJava. Since I wrote some classes anyway, I would like > to contribute > > > them to the community. > > > > Good stuff. The work that I did with the TaxonSQL classes was based > > on the fairly simple requirements of the project I was working on, > > which is why you found the current implementation a bit limited. (I > > don't have projects involving BioJava at the moment, so haven't been > > doing much other than following the mailing list.) > > > > > > > I modified the functions to put and retrieve taxa into > the database so > > > that they consider that the names Map could sometimes > point to a Set of > > > names instead of normal name Strings. > > > In addition I considered the other information that can > be inserted in > > > the database like genetic code and so on. > > > > Excellent improvements. > > > > > > > However, there are some methods in TaxonSQL.java that are > defined to be > > > private. If they were protected, an extension of this > class could call > > them. > > > But because they're private, I had to copy and paste them. > > > > That class isn't really designed for extension, since it's plugged > > directly into calls from BioSQLSequenceAnnotation and > BioSQLSequenceDB > > (you presumably had to change these to point to your MySQLTaxon) and > > there's no need for multiple implementations. I'd say that your > > changes should instead be folded directly as improvements > to TaxonSQL > > itself so that everyone gets the improvements out of the box. > > > > > > Cheers, > > Len. > > > > _______________________________________________ > > biojava-dev mailing list > > biojava-dev@biojava.org > > http://biojava.org/mailman/listinfo/biojava-dev > > > > > > > > > > _______________________________________________ > > biojava-dev mailing list > > biojava-dev@biojava.org > > http://biojava.org/mailman/listinfo/biojava-dev > > > > From lixinebo at yahoo.ca Tue Aug 30 16:37:59 2005 From: lixinebo at yahoo.ca (lixin shen) Date: Tue Aug 30 16:28:35 2005 Subject: [Biojava-dev] XML Schema generator commited Message-ID: <20050830203759.12925.qmail@web60412.mail.yahoo.com> Hi: The XML schema generator for Biomoby object has been committed in org/biomoby/shared/schema. Cheers leo __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com