You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
(1) |
Apr
(14) |
May
(36) |
Jun
(148) |
Jul
(33) |
Aug
(2) |
Sep
(17) |
Oct
(42) |
Nov
(137) |
Dec
(88) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(89) |
Feb
(80) |
Mar
(217) |
Apr
(76) |
May
(5) |
Jun
(39) |
Jul
(35) |
Aug
(4) |
Sep
(7) |
Oct
(14) |
Nov
(12) |
Dec
(9) |
2011 |
Jan
(6) |
Feb
(4) |
Mar
(11) |
Apr
(55) |
May
(90) |
Jun
(39) |
Jul
(15) |
Aug
(15) |
Sep
(23) |
Oct
(12) |
Nov
(17) |
Dec
(20) |
2012 |
Jan
(22) |
Feb
(63) |
Mar
|
Apr
(1) |
May
(6) |
Jun
(3) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(3) |
Feb
(6) |
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <hs...@us...> - 2011-06-29 14:17:02
|
Revision: 925 http://treebase.svn.sourceforge.net/treebase/?rev=925&view=rev Author: hshyket Date: 2011-06-29 14:16:56 +0000 (Wed, 29 Jun 2011) Log Message: ----------- Fixing issue where TaxonLabelSet has a title of taxa. Added a numeral to the taxon label set title. Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadAStudyController.java Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadAStudyController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadAStudyController.java 2011-06-24 20:11:10 UTC (rev 924) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadAStudyController.java 2011-06-29 14:16:56 UTC (rev 925) @@ -48,8 +48,16 @@ // header: TreebaseUtil.attachStudyHeader(study, builder); - // taxa: + // taxa: + + //set a unique number for each block when the title is Taxa + Integer taxa = 1; for ( TaxonLabelSet tls : study.getTaxonLabelSets() ) { + if (tls.getTitle().equals("Taxa")) { + tls.setTitle(tls.getTitle() + taxa.toString()); + taxa++; + } + // one taxon label per line, no line number. tls.buildNexusBlockTaxa(builder, true, false); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-06-24 20:11:16
|
Revision: 924 http://treebase.svn.sourceforge.net/treebase/?rev=924&view=rev Author: rvos Date: 2011-06-24 20:11:10 +0000 (Fri, 24 Jun 2011) Log Message: ----------- Removed unused import Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java 2011-06-24 17:02:00 UTC (rev 923) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java 2011-06-24 20:11:10 UTC (rev 924) @@ -5,8 +5,6 @@ import java.util.List; import java.util.Set; -import junit.framework.Assert; - import org.cipres.treebase.Constants; import org.cipres.treebase.dao.jdbc.ContinuousMatrixElementJDBC; import org.cipres.treebase.dao.jdbc.ContinuousMatrixJDBC; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lol...@us...> - 2011-06-24 17:02:06
|
Revision: 923 http://treebase.svn.sourceforge.net/treebase/?rev=923&view=rev Author: loloyohe Date: 2011-06-24 17:02:00 +0000 (Fri, 24 Jun 2011) Log Message: ----------- Modified NexmlMatrixConverter() fromTreeBaseToXml() methods so that they have charset functionality based on the logic from the unit tests in NexmlMatrixConverterTest. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java 2011-06-17 15:30:21 UTC (rev 922) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java 2011-06-24 17:02:00 UTC (rev 923) @@ -1,16 +1,21 @@ package org.cipres.treebase.domain.nexus.nexml; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import java.util.Set; +import junit.framework.Assert; + import org.cipres.treebase.Constants; import org.cipres.treebase.dao.jdbc.ContinuousMatrixElementJDBC; import org.cipres.treebase.dao.jdbc.ContinuousMatrixJDBC; import org.cipres.treebase.dao.jdbc.DiscreteMatrixElementJDBC; import org.cipres.treebase.dao.jdbc.DiscreteMatrixJDBC; import org.cipres.treebase.dao.jdbc.MatrixColumnJDBC; +import org.cipres.treebase.domain.matrix.CharSet; import org.cipres.treebase.domain.matrix.CharacterMatrix; +import org.cipres.treebase.domain.matrix.ColumnRange; import org.cipres.treebase.domain.matrix.ContinuousChar; import org.cipres.treebase.domain.matrix.ContinuousMatrix; import org.cipres.treebase.domain.matrix.ContinuousMatrixElement; @@ -38,6 +43,7 @@ import org.nexml.model.MolecularMatrix; import org.nexml.model.OTUs; import org.nexml.model.OTU; +import org.nexml.model.Subset; public class NexmlMatrixConverter extends NexmlObjectConverter { @@ -224,6 +230,9 @@ for ( MatrixColumn tbColumn : tbMatrix.getColumnsReadOnly() ) { org.nexml.model.Character xmlCharacter = xmlMatrix.createCharacter(xmlStateSet); PhyloChar tbCharacter = tbColumn.getCharacter(); + if ( null != tbCharacter.getDescription() ) { + xmlCharacter.setLabel(tbCharacter.getDescription()); + } if ( null != tbCharacter.getDescription() && ! tbCharacter.getDescription().equals(tbDataType) ) { ((Annotatable)xmlCharacter).addAnnotationValue("dcterms:description", Constants.DCTermsURI, tbCharacter.getDescription()); } @@ -249,10 +258,41 @@ org.nexml.model.Character xmlCharacter = xmlMatrix.createCharacter(); PhyloChar tbCharacter = tbColumn.getCharacter(); if ( null != tbCharacter.getDescription() ) { + xmlCharacter.setLabel(tbCharacter.getDescription()); ((Annotatable)xmlCharacter).addAnnotationValue("dcterms:description", Constants.DCTermsURI, tbCharacter.getDescription()); } - attachTreeBaseID((Annotatable)xmlCharacter,tbCharacter,PhyloChar.class); - } + attachTreeBaseID((Annotatable)xmlCharacter,tbCharacter,PhyloChar.class); + + //coerce the tbMatrix into a character matrix to get its character sets + CharacterMatrix tbCharacterMatrix = (CharacterMatrix)tbMatrix; + Set<CharSet> tbCharSets = tbCharacterMatrix.getCharSets(); + for ( CharSet tbCharSet : tbCharSets ) { + Collection<ColumnRange> tbColumnRanges = tbCharSet.getColumns(tbCharacterMatrix); + + for ( ColumnRange tbColumnRange : tbColumnRanges ) { + + // these are the beginning and end of the range + int tbStart = tbColumnRange.getStartColIndex(); + int tbStop = tbColumnRange.getEndColIndex(); + + // increment from beginning to end. This number is probably either null, for a + // contiguous range, or perhaps 3 for codon positions + int tbInc = 1; + // create the equivalent nexml character set + Subset nexSubset = xmlMatrix.createSubset(tbCharSet.getLabel()); + + // assign character objects to the subset. Here we get the full list + List<org.nexml.model.Character> nexCharacters = xmlMatrix.getCharacters(); + + // now we iterate over the coordinates and assign the nexml characters to the set + for ( int i = tbStart; i <= tbStop; i += tbInc ) { + nexSubset.addThing(nexCharacters.get(i)); + } + } + } + + } + return xmlMatrix; } @@ -283,6 +323,32 @@ if ( null != tb1MatrixID ) { ((Annotatable)xmlMatrix).addAnnotationValue("tb:identifier.matrix.tb1", Constants.TBTermsURI, tb1MatrixID); } + Set<CharSet> tbCharSets = tbMatrix.getCharSets(); + for ( CharSet tbCharSet : tbCharSets ) { + Collection<ColumnRange> tbColumnRanges = tbCharSet.getColumns(tbMatrix); + + for ( ColumnRange tbColumnRange : tbColumnRanges ) { + + // these are the beginning and end of the range + int tbStart = tbColumnRange.getStartColIndex(); + int tbStop = tbColumnRange.getEndColIndex(); + + // increment from beginning to end. This number is probably either null, for a + // contiguous range, or perhaps 3 for codon positions + int tbInc = 1; + // create the equivalent nexml character set + Subset nexSubset = xmlMatrix.createSubset(tbCharSet.getLabel()); + + // assign character objects to the subset. Here we get the full list + List<org.nexml.model.Character> nexCharacters = xmlMatrix.getCharacters(); + + // now we iterate over the coordinates and assign the nexml characters to the set + for ( int i = tbStart; i <= tbStop; i += tbInc ) { + nexSubset.addThing(nexCharacters.get(i)); + } + } + } + return xmlMatrix; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-06-17 15:30:27
|
Revision: 922 http://treebase.svn.sourceforge.net/treebase/?rev=922&view=rev Author: rvos Date: 2011-06-17 15:30:21 +0000 (Fri, 17 Jun 2011) Log Message: ----------- Slight re-ordering. Modified Paths: -------------- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java 2011-06-17 14:00:40 UTC (rev 921) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java 2011-06-17 15:30:21 UTC (rev 922) @@ -188,6 +188,13 @@ Subset nexSubset = nexMatrix.getSubset(tbCharSet.getLabel()); Assert.assertNotNull("If NexmlMatrixConverter works correctly, a Subset is returned", nexSubset); + //get names of TreeBASE and NeXML character set + String tbCharSetName = tbCharSet.getLabel(); + String nexCharSetName = nexSubset.getLabel(); + + //verify that the names are the same + Assert.assertEquals("The NeXML character set must have copied the label of the TreeBASE character set",tbCharSetName,nexCharSetName); + // the coordinates of the character set are defined by a collection of column ranges that we iterate over Collection<ColumnRange> tbColumnRanges = tbCharSet.getColumns(tbCharacterMatrix); @@ -208,14 +215,7 @@ } // The NexmlMatrixConverter should have created a Subset for each tbCharSet - if ( null != nexSubset ) { - - //get names of TreeBASE and NeXML character set - String tbCharSetName = tbCharSet.getLabel(); - String nexCharSetName = nexSubset.getLabel(); - - //verify that the names are the same - Assert.assertTrue("The NeXML character set must have copied the label of the TreeBASE character set",tbCharSetName.equals(nexCharSetName)); + if ( null != nexSubset ) { // now we iterate over the coordinates in this column range //and verify whether correct character objects are returned This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-06-17 14:00:51
|
Revision: 921 http://treebase.svn.sourceforge.net/treebase/?rev=921&view=rev Author: rvos Date: 2011-06-17 14:00:40 +0000 (Fri, 17 Jun 2011) Log Message: ----------- If the NexmlMatrixConverter (so NOT this test class) functions correctly, it must have now implemented the logic from testNexmlMatrixConverter so that the tests in testNexmlMatrixCharSets. Modified Paths: -------------- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java 2011-06-17 02:28:54 UTC (rev 920) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java 2011-06-17 14:00:40 UTC (rev 921) @@ -10,6 +10,7 @@ import org.cipres.treebase.domain.matrix.CharSet; import org.cipres.treebase.domain.matrix.CharacterMatrix; import org.cipres.treebase.domain.matrix.ColumnRange; +import org.cipres.treebase.domain.matrix.PhyloChar; import org.cipres.treebase.domain.nexus.nexml.NexmlDocumentConverter; import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.taxon.TaxonLabelHome; @@ -135,7 +136,7 @@ if (logger.isInfoEnabled()) { logger.info("Running Test: " + testName); } - long studyId = 1787; + long studyId = 794; // this is the full study as it is stored by the database Study tbStudy = (Study)loadObject(Study.class, studyId); @@ -174,9 +175,18 @@ // we have to coerce the tbMatrix into a character matrix to get its character sets CharacterMatrix tbCharacterMatrix = (CharacterMatrix)tbMatrix; Set<CharSet> tbCharSets = tbCharacterMatrix.getCharSets(); + + // NexmlMatrixConverter must have assigned character objects to zero or more subsets. Here we get the full list of characters + List<org.nexml.model.Character> nexCharacters = nexMatrix.getCharacters(); + Assert.assertEquals("The number of characters in the NeXML matrix must match that of the TreeBASE matrix", (Integer)tbMatrix.getnChar(), (Integer)nexCharacters.size()); + if (tbCharSets.isEmpty() != true) { // a treebase matrix has zero or more character sets, we must iterate over them for ( CharSet tbCharSet : tbCharSets ) { + + // this is how we fetch the equivalent nexml character set + Subset nexSubset = nexMatrix.getSubset(tbCharSet.getLabel()); + Assert.assertNotNull("If NexmlMatrixConverter works correctly, a Subset is returned", nexSubset); // the coordinates of the character set are defined by a collection of column ranges that we iterate over Collection<ColumnRange> tbColumnRanges = tbCharSet.getColumns(tbCharacterMatrix); @@ -196,30 +206,35 @@ tbInc = tbColumnRange.getRepeatInterval(); } - // this is how we create the equivalent nexml character set - Subset nexSubset = nexMatrix.createSubset(tbCharSet.getLabel()); + + // The NexmlMatrixConverter should have created a Subset for each tbCharSet + if ( null != nexSubset ) { - //get names of TreeBASE and NeXML character set - String tbCharSetName = tbCharSet.getLabel(); - String nexCharSetName = nexSubset.getLabel(); - - //verify that the names are the same - Assert.assertTrue(tbCharSetName.equals(nexCharSetName)); - - // we have to assign character objects to the subset. Here we get the full list - List<org.nexml.model.Character> nexCharacters = nexMatrix.getCharacters(); - - // now we iterate over the coordinates and assign the nexml characters to the set - //and verify coordinates of TreeBASE characterset and nexml characterset - //are the same - for ( int i = tbStart; i <= tbStop; i += tbInc ) { - nexSubset.addThing(nexCharacters.get(i)); - - //declare coordinate index - int nexCharSetCoordinate = nexCharacters.indexOf(nexCharacters.get(i)); - int tbCharSetCoordinate = i; - Assert.assertTrue( nexCharSetCoordinate == tbCharSetCoordinate ); + //get names of TreeBASE and NeXML character set + String tbCharSetName = tbCharSet.getLabel(); + String nexCharSetName = nexSubset.getLabel(); + + //verify that the names are the same + Assert.assertTrue("The NeXML character set must have copied the label of the TreeBASE character set",tbCharSetName.equals(nexCharSetName)); + + // now we iterate over the coordinates in this column range + //and verify whether correct character objects are returned + for ( int i = tbStart; i <= tbStop; i += tbInc ) { + + // get the nexml character that should have been created + org.nexml.model.Character nexCharacter = nexCharacters.get(i); + Assert.assertNotNull("The NeXML Character should not be null if there as an index into it in this set", nexCharacter); + Assert.assertTrue("The Subset should contain the character at index i", nexSubset.containsThing(nexCharacter)); + + //get the treebase character for the index in this column range + PhyloChar tbCharacter = tbCharacterMatrix.getCharacter(i); + Assert.assertNotNull("The TreeBASE PhyloChar should not be null if there as an index into it in this set", tbCharacter); + Assert.assertEquals("If the TreeBASE character has a label, then the NeXML character's label should match it", tbCharacter.getLabel(), nexCharacter.getLabel()); + } } + else { + System.out.println("NexmlMatrixConverter failed to create a Subset"); + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sfr...@us...> - 2011-06-17 02:29:01
|
Revision: 920 http://treebase.svn.sourceforge.net/treebase/?rev=920&view=rev Author: sfrgpiel Date: 2011-06-17 02:28:54 +0000 (Fri, 17 Jun 2011) Log Message: ----------- Separating out the submission tutorial instructions along with some youtube videos Modified Paths: -------------- trunk/treebase-web/src/main/resources/ApplicationResources.properties trunk/treebase-web/src/main/webapp/WEB-INF/decorators.xml trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml trunk/treebase-web/src/main/webapp/common/sidebarLeft.jsp trunk/treebase-web/src/main/webapp/login.jsp Added Paths: ----------- trunk/treebase-web/src/main/webapp/WEB-INF/pages/submitTutorial.jsp Modified: trunk/treebase-web/src/main/resources/ApplicationResources.properties =================================================================== --- trunk/treebase-web/src/main/resources/ApplicationResources.properties 2011-06-16 20:52:22 UTC (rev 919) +++ trunk/treebase-web/src/main/resources/ApplicationResources.properties 2011-06-17 02:28:54 UTC (rev 920) @@ -78,6 +78,7 @@ nav.contact=Contact nav.search=Search nav.search.treebase=Search TreeBASE +nav.submittutorial=Submission Tutorial nav.submit=Submit nav.dataman=NSF Data Management nav.stats=Stats Modified: trunk/treebase-web/src/main/webapp/WEB-INF/decorators.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/decorators.xml 2011-06-16 20:52:22 UTC (rev 919) +++ trunk/treebase-web/src/main/webapp/WEB-INF/decorators.xml 2011-06-17 02:28:54 UTC (rev 920) @@ -8,6 +8,7 @@ <decorator name="main" page="mainTemplate.jsp"> <pattern>/home.html</pattern> <pattern>/dataMan.html</pattern> + <pattern>/submitTutorial.html</pattern> <pattern>/about.html</pattern> <pattern>/urlAPI.html</pattern> <pattern>/people.html</pattern> Added: trunk/treebase-web/src/main/webapp/WEB-INF/pages/submitTutorial.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/submitTutorial.jsp (rev 0) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/submitTutorial.jsp 2011-06-17 02:28:54 UTC (rev 920) @@ -0,0 +1,96 @@ +<%@page import="org.cipres.treebase.TreebaseUtil"%> +<% String purlBase = TreebaseUtil.getPurlBase(); %> + +<div class="gutter"> + +<h2>The Submission Process</h2> + +<p>Typically an author submits a paper to a journal for review + and initiates a TreeBASE submission. At this stage, the + submission is classified as "in progress." A submission + number is issued and the submitter is given a special URL + that can be mailed to the journal editor so that referees + or reviewers can inspect (but not change) the uploaded data. +</p> + +<p>When the journal editor says that the paper is "accepted" or + "accepted with minor revision," the submitter can return to the + submission and change its status from "in progress" to "ready." + At that point, the submitter can cite a URI in his or her paper + that serves as an accession number and as a permanent, resolvable + URL to the data. TreeBASE staff will verify that the submission + is complete, and if so, the data are made public. +</p> + +<h2>General Requirements</h2> + +<ul> + <li>The paper must be published in a peer-reviewed journal or book. Data for manuscripts that are "accepted with minor revision," "accepted," or "in press" can be published in TreeBASE. Data for manuscripts that are "submitted" or "in preparation" must not move beyond the initial "in progress" stage of TreeBASE submission.</li> + + <li>The names of all authors listed with the paper must be included.</li> + + <li>At least one data matrix must be included.</li> + + <li>At least one tree must result from an analysis of one or more data matrices. TreeBASE does not accept matrices that were not analyzed to produce a tree or trees for which the matrices used to produce them are not available.</li> + + <li>Normally the trees should be limited to those that were published as figures in the manuscript. However, a set of trees that were used to produce a published consensus tree is also acceptable.</li> + + <li>Only matrices and trees listed with an analysis will ultimately become available to the public. In other words, matrices or trees must not be orphaned but instead must be either the inputs or outputs of explicit analyses.</li> +</ul> + +<h2>Preparation of NEXUS files</h2> + +<p>Data are uploaded to TreeBASE in the NEXUS format, which is used by many popular phylogenetics software packages (e.g., MacClade and Mesquite: Maddison and Maddison, 1992; PAUP: Swofford, 1993). These programs allow other file formats (e.g. Hennig86, PHYLIP, etc.) to be converted into NEXUS. TreeBASE uses <a href="http://mesquiteproject.org/" title="Mesquite" target="_blank">Mesquite</a> to parse incoming data: <strong>if your data cannot be parsed by Mesquite then they will not be parsed by TreeBASE</strong>, so it's always a good idea to save your data in Mesquite prior to uploading. For example: </p> +<ul> +<li> Launch <a href="http://mesquiteproject.org/" title="Mesquite" target="_blank">Mesquite</a> </li> +<li>Under the <em>File Menu</em> select <em>Open File</em> and choose your character matrix</li> +<li>If your tree(s) are stored in a separate file, under the <em>File Menu</em> select + <em>Include File...</em> and choose your tree file </li> +<li>By clicking on "Taxa," "Character Matrix," or "Trees from treefile.tre" from the project margin on the left, you can rename + them: these names will be carried through into TreeBASE, so it's useful to give them informative names. For example, you could name your matrix "Hymenopteran COI Alignment" +or your tree block "Set of 5 MP Trees from COI Analysis"</li> +<li>By clicking on the <em>Tree</em> icon from the project margin on the left, you can examine your trees. + <ul> + <li>Use the <em>Reroot at Branch</em> tool to reorient the tree the way it appears in the figures of your paper</li> + <li>Under the<em> Drawing Menu</em>, + you can view the relative branch lengths in your tree by selecting <em>Branches Proportional to Lengths</em></li> + </ul> +</li> + + <li>To rename your trees, click the <em>List & Manage Trees</em> icon from the project margin on the left. Renaming your trees makes it easy to identify them after uploading to TreeBASE.</li> + <li>To view or edit the taxon labels, click the <em>Taxa</em> icon from the project margin on the left. Verify that the taxon labels comply with TreeBASE's requirements (see below) and edit as needed</li> + <li>If all looks good, select <em>Save File</em> from the <em>File</em> menu. + Your NEXUS file is now ready to upload to TreeBASE </li> + </ul> +<p>The most frequent error in submitting data to TreeBASE is when taxon labels in the matrices do not match with taxon labels in the trees. Using the above procedure with Mesquite, however, will avoid the problem. </p> + +<h3>Instructional Video on Preparing NEXUS Data in Mesquite</h3> + +<p> +<object width="480" height="385"><param name="movie" value="http://www.youtube.com/p/3F38DFE2626A5234?hl=en_US&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/p/3F38DFE2626A5234?hl=en_US&fs=1" type="application/x-shockwave-flash" width="480" height="385" allowscriptaccess="always" allowfullscreen="true"></embed></object> +</p> + +<h3>Preparation of taxon labels</h3> + +<ul> + <li>Do not abbreviate taxon names (e.g. write "Homo sapiens", not "H. sapiens")</li> + + <li>The NEXUS file should use underscores ("_") to represent spaces (but when using the Mesquite GUI, use spaces: it will correctly save them as underscores in the NEXUS)</li> + + <li>Avoid using quotation marks, brackets, parentheses, commas, colons, and semicolons.</li> + + <li>Avoid using codes for non-redundant names (e.g. write "Drosophila melanogaster", not "DMelan45GRX"). However, it is acceptable two write "Drosophila melanogaster 45GRX".</li> + + <li>Separate the name of parasites and hosts with "ex.," e.g. "Wolbachia sp. ex. Drosophila melanogaster"</li> + +</ul> + +<h2>Instructional Video on Submitting to TreeBASE</h2> + +<p>If you are sufficiently caffeinated, please consider watching this video to understand the process of submitting data to TreeBASE. The video is also available in high-definition if you view in "Full screen"</p> + +<p> +<object width="480" height="385"><param name="movie" value="http://www.youtube.com/p/9AD9904B8782D600?hl=en_US&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/p/9AD9904B8782D600?hl=en_US&fs=1" type="application/x-shockwave-flash" width="480" height="385" allowscriptaccess="always" allowfullscreen="true"></embed></object> +</p> + +</div> \ No newline at end of file Modified: trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-06-16 20:52:22 UTC (rev 919) +++ trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-06-17 02:28:54 UTC (rev 920) @@ -932,7 +932,8 @@ <prop key="/phylows/matrix/**">phyloWSMatrixController</prop> <prop key="/about.html">filenameController</prop> <prop key="/dataMan.html">filenameController</prop> - <prop key="/home.html">filenameController</prop> + <prop key="/home.html">filenameController</prop> + <prop key="/submitTutorial.html">filenameController</prop> <prop key="/login.html">filenameController</prop> <prop key="/urlAPI.html">filenameController</prop> <prop key="/people.html">filenameController</prop> Modified: trunk/treebase-web/src/main/webapp/common/sidebarLeft.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/common/sidebarLeft.jsp 2011-06-16 20:52:22 UTC (rev 919) +++ trunk/treebase-web/src/main/webapp/common/sidebarLeft.jsp 2011-06-17 02:28:54 UTC (rev 920) @@ -4,6 +4,7 @@ <div id="navcontainer"> <ul id="navlist"> <li><a href="<c:url value="/search/studySearch.html"/>"><fmt:message key="nav.search.treebase"/></a></li> + <li><a href="<c:url value="/submitTutorial.html"/>"><fmt:message key="nav.submittutorial"/></a></li> <li><a href="<c:url value="/user/processUser.html"/>"><fmt:message key="nav.submit"/></a></li> <li><span class="navlistHeading"><fmt:message key="nav.about"/></span> <ul id="innerNavlist"> Modified: trunk/treebase-web/src/main/webapp/login.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/login.jsp 2011-06-16 20:52:22 UTC (rev 919) +++ trunk/treebase-web/src/main/webapp/login.jsp 2011-06-17 02:28:54 UTC (rev 920) @@ -17,83 +17,6 @@ </tr> </table> -<h2>The Submission Process</h2> - -<p>Typically an author submits a paper to a journal for review - and initiates a TreeBASE submission. At this stage, the - submission is classified as "in progress." A submission - number is issued and the submitter is given a special URL - that can be mailed to the journal editor so that referees - or reviewers can inspect (but not change) the uploaded data. -</p> - -<p>When the journal editor says that the paper is "accepted" or - "accepted with minor revision," the submitter can return to the - submission and change its status from "in progress" to "ready." - At that point, the submitter can cite a URI in his or her paper - that serves as an accession number and as a permanent, resolvable - URL to the data. TreeBASE staff will verify that the submission - is complete, and if so, the data are made public. -</p> - -<h2>General Requirements</h2> - -<ul> - <li>The paper must be published in a peer-reviewed journal or book. Data for manuscripts that are "accepted with minor revision," "accepted," or "in press" can be published in TreeBASE. Data for manuscripts that are "submitted" or "in preparation" must not move beyond the initial "in progress" stage of TreeBASE submission.</li> - - <li>The names of all authors listed with the paper must be included.</li> - - <li>At least one data matrix must be included.</li> - - <li>At least one tree must result from an analysis of one or more data matrices. TreeBASE does not accept matrices that were not analyzed to produce a tree or trees for which the matrices used to produce them are not available.</li> - - <li>Normally the trees should be limited to those that were published as figures in the manuscript. However, a set of trees that were used to produce a published consensus tree is also acceptable.</li> - - <li>Only matrices and trees listed with an analysis will ultimately become available to the public. In other words, matrices or trees must not be orphaned but instead must be either the inputs or outputs of explicit analyses.</li> -</ul> - -<h2>Preparation of NEXUS files</h2> - -<p>Data are uploaded to TreeBASE in the NEXUS format, which is used by many popular phylogenetics software packages (e.g., MacClade and Mesquite: Maddison and Maddison, 1992; PAUP: Swofford, 1993). These programs allow other file formats (e.g. Hennig86, PHYLIP, etc.) to be converted into NEXUS. TreeBASE uses <a href="http://mesquiteproject.org/" title="Mesquite" target="_blank">Mesquite</a> to parse incoming data: <strong>if your data cannot be parsed by Mesquite then they will not be parsed by TreeBASE</strong>, so it's always a good idea to save your data in Mesquite prior to uploading. For example: </p> -<ul> -<li> Launch <a href="http://mesquiteproject.org/" title="Mesquite" target="_blank">Mesquite</a> </li> -<li>Under the <em>File Menu</em> select <em>Open File</em> and choose your character matrix</li> -<li>If your tree(s) are stored in a separate file, under the <em>File Menu</em> select - <em>Include File...</em> and choose your tree file </li> -<li>By clicking on "Taxa," "Character Matrix," or "Trees from treefile.tre" from the project margin on the left, you can rename - them: these names will be carried through into TreeBASE, so it's useful to give them informative names. For example, you could name your matrix "Hymenopteran COI Alignment" -or your tree block "Set of 5 MP Trees from COI Analysis"</li> -<li>By clicking on the <em>Tree</em> icon from the project margin on the left, you can examine your trees. - <ul> - <li>Use the <em>Reroot at Branch</em> tool to reorient the tree the way it appears in the figures of your paper</li> - <li>Under the<em> Drawing Menu</em>, - you can view the relative branch lengths in your tree by selecting <em>Branches Proportional to Lengths</em></li> - </ul> -</li> - - <li>To rename your trees, click the <em>List & Manage Trees</em> icon from the project margin on the left. Renaming your trees makes it easy to identify them after uploading to TreeBASE.</li> - <li>To view or edit the taxon labels, click the <em>Taxa</em> icon from the project margin on the left. Verify that the taxon labels comply with TreeBASE's requirements (see below) and edit as needed</li> - <li>If all looks good, select <em>Save File</em> from the <em>File</em> menu. - Your NEXUS file is now ready to upload to TreeBASE </li> - </ul> -<p>The most frequent error in submitting data to TreeBASE is when taxon labels in the matrices do not match with taxon labels in the trees. Using the above procedure with Mesquite, however, will avoid the problem. </p> - - -<h3>Preparation of taxon labels</h3> - -<ul> - <li>Do not abbreviate taxon names (e.g. write "Homo sapiens", not "H. sapiens")</li> - - <li>The NEXUS file should use underscores ("_") to represent spaces (but when using the Mesquite GUI, use spaces: it will correctly save them as underscores in the NEXUS)</li> - - <li>Avoid using quotation marks, brackets, parentheses, commas, colons, and semicolons.</li> - - <li>Avoid using codes for non-redundant names (e.g. write "Drosophila melanogaster", not "DMelan45GRX"). However, it is acceptable two write "Drosophila melanogaster 45GRX".</li> - - <li>Separate the name of parasites and hosts with "ex.," e.g. "Wolbachia sp. ex. Drosophila melanogaster"</li> - -</ul> - <hr/> <p>Please fill in following information to login<br/> <span class="required">* Required Fields</span></p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lol...@us...> - 2011-06-16 20:52:29
|
Revision: 919 http://treebase.svn.sourceforge.net/treebase/?rev=919&view=rev Author: loloyohe Date: 2011-06-16 20:52:22 +0000 (Thu, 16 Jun 2011) Log Message: ----------- NexmlMatrixConverterTest ensures that if there character sets are associated with the study of interest. The previous commit only checked if matrices were associated with the study. This is tested with a study that has matrices but not associated character sets. Modified Paths: -------------- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java 2011-06-16 02:13:46 UTC (rev 918) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java 2011-06-16 20:52:22 UTC (rev 919) @@ -135,48 +135,46 @@ if (logger.isInfoEnabled()) { logger.info("Running Test: " + testName); } - long studyId = 794; + long studyId = 1787; // this is the full study as it is stored by the database Study tbStudy = (Study)loadObject(Study.class, studyId); - //check if study has character state matrices exist - if (tbStudy.getMatrices() != null) { - // these are the character state matrices that are part of the study - Set<org.cipres.treebase.domain.matrix.Matrix> tbMatrices = tbStudy.getMatrices(); + // these are the character state matrices that are part of the study + Set<org.cipres.treebase.domain.matrix.Matrix> tbMatrices = tbStudy.getMatrices(); - // this is an object representation of a NeXML document - Document nexDoc = DocumentFactory.safeCreateDocument(); + // this is an object representation of a NeXML document + Document nexDoc = DocumentFactory.safeCreateDocument(); - // the converter populates the NeXML document with the contents of the treebase study - NexmlDocumentConverter ndc = new NexmlDocumentConverter(tbStudy,getTaxonLabelHome(),nexDoc); - ndc.fromTreeBaseToXml(tbStudy); // here is where the conversion happens + // the converter populates the NeXML document with the contents of the treebase study + NexmlDocumentConverter ndc = new NexmlDocumentConverter(tbStudy,getTaxonLabelHome(),nexDoc); + ndc.fromTreeBaseToXml(tbStudy); // here is where the conversion happens - // these are the NeXML matrices that were created from the study - List<Matrix<?>> nexMatrices = nexDoc.getMatrices(); + // these are the NeXML matrices that were created from the study + List<Matrix<?>> nexMatrices = nexDoc.getMatrices(); - // there most be more than zero matrices because every treebase study has at least one matrix - Assert.assertTrue(nexMatrices.size() != 0 ); + // there most be more than zero matrices because every treebase study has at least one matrix + Assert.assertTrue(nexMatrices.size() != 0 ); - // now we're going to match up the NeXML matrices with their equivalent treebase ones - for ( Matrix<?> nexMatrix : nexMatrices ) { + // now we're going to match up the NeXML matrices with their equivalent treebase ones + for ( Matrix<?> nexMatrix : nexMatrices ) { - // the xml id is the same as the primary key of the equivalent matrix stored by treebase - String nexId = nexMatrix.getId(); + // the xml id is the same as the primary key of the equivalent matrix stored by treebase + String nexId = nexMatrix.getId(); - // iterate over all treebase matrices for the study - for ( org.cipres.treebase.domain.matrix.Matrix tbMatrix : tbMatrices ) { - String tbId = "M" + tbMatrix.getId(); + // iterate over all treebase matrices for the study + for ( org.cipres.treebase.domain.matrix.Matrix tbMatrix : tbMatrices ) { + String tbId = "M" + tbMatrix.getId(); - // if true, the matrices are equivalent - if ( nexId.equals(tbId) ) { - Assert.assertTrue("NeXML matrix "+nexId+ " is one of the known subclasses", - nexMatrix instanceof CategoricalMatrix || nexMatrix instanceof MolecularMatrix || nexMatrix instanceof ContinuousMatrix); + // if true, the matrices are equivalent + if ( nexId.equals(tbId) ) { + Assert.assertTrue("NeXML matrix "+nexId+ " is one of the known subclasses", + nexMatrix instanceof CategoricalMatrix || nexMatrix instanceof MolecularMatrix || nexMatrix instanceof ContinuousMatrix); - // we have to coerce the tbMatrix into a character matrix to get its character sets - CharacterMatrix tbCharacterMatrix = (CharacterMatrix)tbMatrix; - Set<CharSet> tbCharSets = tbCharacterMatrix.getCharSets(); - + // we have to coerce the tbMatrix into a character matrix to get its character sets + CharacterMatrix tbCharacterMatrix = (CharacterMatrix)tbMatrix; + Set<CharSet> tbCharSets = tbCharacterMatrix.getCharSets(); + if (tbCharSets.isEmpty() != true) { // a treebase matrix has zero or more character sets, we must iterate over them for ( CharSet tbCharSet : tbCharSets ) { @@ -225,12 +223,13 @@ } } } + else { + System.out.println("This study has no associated character sets!"); + } } } } - else { - System.out.println("This study has no associated character sets!"); - } + } /** * Return the TaxonLabelHome field. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2011-06-16 17:32:17
|
Bugs item #3317415, was opened at 2011-06-16 17:32 Message generated for change (Tracker Item Submitted) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=3317415&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: APIs Group: None Status: Open Priority: 5 Private: No Submitted By: https://www.google.com/accounts () Assigned to: Nobody/Anonymous (nobody) Summary: logical "and" in search queries is treated as "or" Initial Comment: I see the wiki mentions that logicals are supported on the phylo-ws queries, i.e. http://purl.org/phylo/treebase/dev/phylows/study/find?query=dcterms.contributor=Ronquist%20and%20dcterms.contributor=Hulesenbeck&format=rss1&recordSchema=tree http://purl.org/phylo/treebase/dev/phylows/study/find?query=dcterms.contributor=Ronquist%20or%20dcterms.contributor=Hulesenbeck&format=rss1&recordSchema=tree http://purl.org/phylo/treebase/dev/phylows/taxon/find?query=tb.title.taxon==%22Homo%20sapiens%22%20AND%20%22Pan%20troglodytes%22&format=rss1&recordSchema=tree This works, except that it seems that "and" is always treated as "or". ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=3317415&group_id=248804 |
From: <lol...@us...> - 2011-06-16 02:13:52
|
Revision: 918 http://treebase.svn.sourceforge.net/treebase/?rev=918&view=rev Author: loloyohe Date: 2011-06-16 02:13:46 +0000 (Thu, 16 Jun 2011) Log Message: ----------- Ensures coordinates in Nexml matrix and treebase matrix are equal. Checks if there are cases in which there are studies with no character sets. Still need to test with studies that have no associated char sets though. Modified Paths: -------------- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java 2011-06-14 19:14:38 UTC (rev 917) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java 2011-06-16 02:13:46 UTC (rev 918) @@ -135,54 +135,56 @@ if (logger.isInfoEnabled()) { logger.info("Running Test: " + testName); } - long studyId = 2000; + long studyId = 794; // this is the full study as it is stored by the database Study tbStudy = (Study)loadObject(Study.class, studyId); - // these are the character state matrices that are part of the study - Set<org.cipres.treebase.domain.matrix.Matrix> tbMatrices = tbStudy.getMatrices(); + //check if study has character state matrices exist + if (tbStudy.getMatrices() != null) { + // these are the character state matrices that are part of the study + Set<org.cipres.treebase.domain.matrix.Matrix> tbMatrices = tbStudy.getMatrices(); - // this is an object representation of a NeXML document - Document nexDoc = DocumentFactory.safeCreateDocument(); + // this is an object representation of a NeXML document + Document nexDoc = DocumentFactory.safeCreateDocument(); - // the converter populates the NeXML document with the contents of the treebase study - NexmlDocumentConverter ndc = new NexmlDocumentConverter(tbStudy,getTaxonLabelHome(),nexDoc); - ndc.fromTreeBaseToXml(tbStudy); // here is where the conversion happens + // the converter populates the NeXML document with the contents of the treebase study + NexmlDocumentConverter ndc = new NexmlDocumentConverter(tbStudy,getTaxonLabelHome(),nexDoc); + ndc.fromTreeBaseToXml(tbStudy); // here is where the conversion happens - // these are the NeXML matrices that were created from the study - List<Matrix<?>> nexMatrices = nexDoc.getMatrices(); + // these are the NeXML matrices that were created from the study + List<Matrix<?>> nexMatrices = nexDoc.getMatrices(); - // there most be more than zero matrices because every treebase study has at least one matrix - Assert.assertTrue(nexMatrices.size() != 0 ); + // there most be more than zero matrices because every treebase study has at least one matrix + Assert.assertTrue(nexMatrices.size() != 0 ); - // now we're going to match up the NeXML matrices with their equivalent treebase ones - for ( Matrix<?> nexMatrix : nexMatrices ) { + // now we're going to match up the NeXML matrices with their equivalent treebase ones + for ( Matrix<?> nexMatrix : nexMatrices ) { - // the xml id is the same as the primary key of the equivalent matrix stored by treebase - String nexId = nexMatrix.getId(); + // the xml id is the same as the primary key of the equivalent matrix stored by treebase + String nexId = nexMatrix.getId(); - // iterate over all treebase matrices for the study - for ( org.cipres.treebase.domain.matrix.Matrix tbMatrix : tbMatrices ) { - String tbId = "M" + tbMatrix.getId(); + // iterate over all treebase matrices for the study + for ( org.cipres.treebase.domain.matrix.Matrix tbMatrix : tbMatrices ) { + String tbId = "M" + tbMatrix.getId(); - // if true, the matrices are equivalent - if ( nexId.equals(tbId) ) { - Assert.assertTrue("NeXML matrix "+nexId+ " is one of the known subclasses", + // if true, the matrices are equivalent + if ( nexId.equals(tbId) ) { + Assert.assertTrue("NeXML matrix "+nexId+ " is one of the known subclasses", nexMatrix instanceof CategoricalMatrix || nexMatrix instanceof MolecularMatrix || nexMatrix instanceof ContinuousMatrix); - // we have to coerce the tbMatrix into a character matrix to get its character sets - CharacterMatrix tbCharacterMatrix = (CharacterMatrix)tbMatrix; - Set<CharSet> tbCharSets = tbCharacterMatrix.getCharSets(); + // we have to coerce the tbMatrix into a character matrix to get its character sets + CharacterMatrix tbCharacterMatrix = (CharacterMatrix)tbMatrix; + Set<CharSet> tbCharSets = tbCharacterMatrix.getCharSets(); - // a treebase matrix has zero or more character sets, we must iterate over them - for ( CharSet tbCharSet : tbCharSets ) { + // a treebase matrix has zero or more character sets, we must iterate over them + for ( CharSet tbCharSet : tbCharSets ) { - // the coordinates of the character set are defined by a collection of column ranges that we iterate over - Collection<ColumnRange> tbColumnRanges = tbCharSet.getColumns(tbCharacterMatrix); + // the coordinates of the character set are defined by a collection of column ranges that we iterate over + Collection<ColumnRange> tbColumnRanges = tbCharSet.getColumns(tbCharacterMatrix); + + for ( ColumnRange tbColumnRange : tbColumnRanges ) { - for ( ColumnRange tbColumnRange : tbColumnRanges ) { - // these are the beginning and end of the range int tbStart = tbColumnRange.getStartColIndex(); int tbStop = tbColumnRange.getEndColIndex(); @@ -217,14 +219,18 @@ //declare coordinate index int nexCharSetCoordinate = nexCharacters.indexOf(nexCharacters.get(i)); - int tbCharSetCoordinate = i; // you added the offset twice + int tbCharSetCoordinate = i; Assert.assertTrue( nexCharSetCoordinate == tbCharSetCoordinate ); } + } } } } } } + else { + System.out.println("This study has no associated character sets!"); + } } /** * Return the TaxonLabelHome field. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-06-14 19:14:44
|
Revision: 917 http://treebase.svn.sourceforge.net/treebase/?rev=917&view=rev Author: hshyket Date: 2011-06-14 19:14:38 +0000 (Tue, 14 Jun 2011) Log Message: ----------- Fixing newWick string Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2011-06-14 13:06:13 UTC (rev 916) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2011-06-14 19:14:38 UTC (rev 917) @@ -574,10 +574,11 @@ String newWick = getNewickString(); if (newWick.indexOf(';') == -1) { - newWick.concat(";"); + newWick = newWick + ";"; } pBuilder.append(newWick).append("\n"); + pBuilder.append("[! TreeBASE tree URI: ").append(getPhyloWSPath().getPurl()).append("]\n"); pBuilder.append("\n\nEND;\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-06-14 13:06:19
|
Revision: 916 http://treebase.svn.sourceforge.net/treebase/?rev=916&view=rev Author: rvos Date: 2011-06-14 13:06:13 +0000 (Tue, 14 Jun 2011) Log Message: ----------- Offset was added twice. Modified Paths: -------------- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java 2011-06-13 16:47:34 UTC (rev 915) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java 2011-06-14 13:06:13 UTC (rev 916) @@ -161,7 +161,6 @@ // the xml id is the same as the primary key of the equivalent matrix stored by treebase String nexId = nexMatrix.getId(); - boolean foundEquivalentMatrix = false; // iterate over all treebase matrices for the study for ( org.cipres.treebase.domain.matrix.Matrix tbMatrix : tbMatrices ) { @@ -169,7 +168,6 @@ // if true, the matrices are equivalent if ( nexId.equals(tbId) ) { - foundEquivalentMatrix = true; Assert.assertTrue("NeXML matrix "+nexId+ " is one of the known subclasses", nexMatrix instanceof CategoricalMatrix || nexMatrix instanceof MolecularMatrix || nexMatrix instanceof ContinuousMatrix); @@ -219,12 +217,8 @@ //declare coordinate index int nexCharSetCoordinate = nexCharacters.indexOf(nexCharacters.get(i)); - int tbCharSetCoordinate = tbColumnRange.getStartColIndex() + i; - - //Assert.assertTrue( nexCharSetCoordinate == tbCharSetCoordinate ); - //if (nexCharSetCoordinate == tbCharSetCoordinate){ - // System.out.println("I work"); - //} + int tbCharSetCoordinate = i; // you added the offset twice + Assert.assertTrue( nexCharSetCoordinate == tbCharSetCoordinate ); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lol...@us...> - 2011-06-13 16:47:41
|
Revision: 915 http://treebase.svn.sourceforge.net/treebase/?rev=915&view=rev Author: loloyohe Date: 2011-06-13 16:47:34 +0000 (Mon, 13 Jun 2011) Log Message: ----------- Added a second JUnit test testNexmlCharSets(). It verifies if the title and coordinates of a treebase character set and nexml character set match up. Modified Paths: -------------- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java 2011-06-13 15:10:50 UTC (rev 914) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java 2011-06-13 16:47:34 UTC (rev 915) @@ -26,6 +26,8 @@ /** * Test for {@link org.cipres.treebase.domain.nexus.nexml.NexmlMatrixConverter#fromTreeBaseToXml(CharacterMatrix)}. + * Finds an equivalent, created NexmlMatrix within a NeXML document to go with the matrix + * fetched from the TreeBASE database. */ public void testNexmlMatrixConverter() { String testName = "testNexmlMatrixConverter"; @@ -38,10 +40,10 @@ // this is the full study as it is stored by the database Study tbStudy = (Study)loadObject(Study.class, studyId); - + // these are the character state matrices that are part of the study Set<org.cipres.treebase.domain.matrix.Matrix> tbMatrices = tbStudy.getMatrices(); - + // this is an object representation of a NeXML document Document nexDoc = DocumentFactory.safeCreateDocument(); @@ -61,11 +63,11 @@ // the xml id is the same as the primary key of the equivalent matrix stored by treebase String nexId = nexMatrix.getId(); boolean foundEquivalentMatrix = false; - + // iterate over all treebase matrices for the study for ( org.cipres.treebase.domain.matrix.Matrix tbMatrix : tbMatrices ) { String tbId = "M" + tbMatrix.getId(); - + // although there is a class DistanceMatrix, it is my belief that we don't actually have // any distance matrices stored, nor can we convert them to NeXML Assert.assertTrue("TreeBASE matrix "+tbId+" must be a character matrix, not a distance matrix", tbMatrix instanceof CharacterMatrix); @@ -85,6 +87,7 @@ // the coordinates of the character set are defined by a collection of column ranges that we iterate over Collection<ColumnRange> tbColumnRanges = tbCharSet.getColumns(tbCharacterMatrix); + for ( ColumnRange tbColumnRange : tbColumnRanges ) { // these are the beginning and end of the range @@ -122,6 +125,114 @@ } /** + * Test for {@link org.cipres.treebase.domain.nexus.nexml.NexmlMatrixConverter#}. + * It verifies that NexmlCharSets have the same name and coordinates as those in the + * TreeBASE matrix. + */ + public void testNexmlMatrixCharSets() { + String testName = "testNexmlCharSets"; + //signal beginning of test + if (logger.isInfoEnabled()) { + logger.info("Running Test: " + testName); + } + long studyId = 2000; + + // this is the full study as it is stored by the database + Study tbStudy = (Study)loadObject(Study.class, studyId); + + // these are the character state matrices that are part of the study + Set<org.cipres.treebase.domain.matrix.Matrix> tbMatrices = tbStudy.getMatrices(); + + // this is an object representation of a NeXML document + Document nexDoc = DocumentFactory.safeCreateDocument(); + + // the converter populates the NeXML document with the contents of the treebase study + NexmlDocumentConverter ndc = new NexmlDocumentConverter(tbStudy,getTaxonLabelHome(),nexDoc); + ndc.fromTreeBaseToXml(tbStudy); // here is where the conversion happens + + // these are the NeXML matrices that were created from the study + List<Matrix<?>> nexMatrices = nexDoc.getMatrices(); + + // there most be more than zero matrices because every treebase study has at least one matrix + Assert.assertTrue(nexMatrices.size() != 0 ); + + // now we're going to match up the NeXML matrices with their equivalent treebase ones + for ( Matrix<?> nexMatrix : nexMatrices ) { + + // the xml id is the same as the primary key of the equivalent matrix stored by treebase + String nexId = nexMatrix.getId(); + boolean foundEquivalentMatrix = false; + + // iterate over all treebase matrices for the study + for ( org.cipres.treebase.domain.matrix.Matrix tbMatrix : tbMatrices ) { + String tbId = "M" + tbMatrix.getId(); + + // if true, the matrices are equivalent + if ( nexId.equals(tbId) ) { + foundEquivalentMatrix = true; + Assert.assertTrue("NeXML matrix "+nexId+ " is one of the known subclasses", + nexMatrix instanceof CategoricalMatrix || nexMatrix instanceof MolecularMatrix || nexMatrix instanceof ContinuousMatrix); + + // we have to coerce the tbMatrix into a character matrix to get its character sets + CharacterMatrix tbCharacterMatrix = (CharacterMatrix)tbMatrix; + Set<CharSet> tbCharSets = tbCharacterMatrix.getCharSets(); + + // a treebase matrix has zero or more character sets, we must iterate over them + for ( CharSet tbCharSet : tbCharSets ) { + + // the coordinates of the character set are defined by a collection of column ranges that we iterate over + Collection<ColumnRange> tbColumnRanges = tbCharSet.getColumns(tbCharacterMatrix); + + for ( ColumnRange tbColumnRange : tbColumnRanges ) { + + // these are the beginning and end of the range + int tbStart = tbColumnRange.getStartColIndex(); + int tbStop = tbColumnRange.getEndColIndex(); + + // this is how we increment from beginning to end. This number is probably either null, for a + // contiguous range, or perhaps 3 for codon positions + int tbInc = 1; + + // need to do this to prevent nullpointerexceptions + if ( null != tbColumnRange.getRepeatInterval()) { + + tbInc = tbColumnRange.getRepeatInterval(); + } + // this is how we create the equivalent nexml character set + Subset nexSubset = nexMatrix.createSubset(tbCharSet.getLabel()); + + //get names of TreeBASE and NeXML character set + String tbCharSetName = tbCharSet.getLabel(); + String nexCharSetName = nexSubset.getLabel(); + + //verify that the names are the same + Assert.assertTrue(tbCharSetName.equals(nexCharSetName)); + + // we have to assign character objects to the subset. Here we get the full list + List<org.nexml.model.Character> nexCharacters = nexMatrix.getCharacters(); + + // now we iterate over the coordinates and assign the nexml characters to the set + //and verify coordinates of TreeBASE characterset and nexml characterset + //are the same + for ( int i = tbStart; i <= tbStop; i += tbInc ) { + nexSubset.addThing(nexCharacters.get(i)); + + //declare coordinate index + int nexCharSetCoordinate = nexCharacters.indexOf(nexCharacters.get(i)); + int tbCharSetCoordinate = tbColumnRange.getStartColIndex() + i; + + //Assert.assertTrue( nexCharSetCoordinate == tbCharSetCoordinate ); + //if (nexCharSetCoordinate == tbCharSetCoordinate){ + // System.out.println("I work"); + //} + } + } + } + } + } + } + } + /** * Return the TaxonLabelHome field. * * @return TaxonLabelHome mTaxonLabelHome This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sfr...@us...> - 2011-06-13 15:10:57
|
Revision: 914 http://treebase.svn.sourceforge.net/treebase/?rev=914&view=rev Author: sfrgpiel Date: 2011-06-13 15:10:50 +0000 (Mon, 13 Jun 2011) Log Message: ----------- Because Google is now indexing TreeBASE, I wanted to get the words "phylogeny" and "phylogenetic" in the <h2> title, such that "Homo sapiens" *and* "phylogeny" or "phylogenetic" has a chance of returning hits to TreeBASE. Modified Paths: -------------- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/taxa.jsp Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/taxa.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/taxa.jsp 2011-06-11 22:45:10 UTC (rev 913) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/taxa.jsp 2011-06-13 15:10:50 UTC (rev 914) @@ -1,12 +1,12 @@ <%@ include file="/common/taglibs.jsp"%> -<title>Taxa for <c:choose> +<title>Taxa in <c:choose> <c:when test="${not empty matrix}"> matrix ${matrix.id} of </c:when> <c:when test="${not empty tree}"> tree ${tree.id} of </c:when> -</c:choose> study ${study.id}</title> +</c:choose> the phylogeny or phylogenetic data in study ${study.id}</title> <body id="s-taxon" /> <c:set var="ncbiTaxonomyURL" value="http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=" /> @@ -52,7 +52,7 @@ <display:table id="taxon" name="${taxa}" class="list"> <%--display:column titleKey="taxonlabel.row.id">${taxon_rowNum}</display:column --%> <display:column property="id" title="ID" /> - <display:column property="taxonLabel" /> + <display:column property="taxonLabel" title="Taxon Label" /> <display:column titleKey="taxon.ncbiTaxID"> <c:if test="${taxon.taxonVariant!=null}"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-06-11 22:45:17
|
Revision: 913 http://treebase.svn.sourceforge.net/treebase/?rev=913&view=rev Author: rvos Date: 2011-06-11 22:45:10 +0000 (Sat, 11 Jun 2011) Log Message: ----------- Adding initial implementation of analysis step annotations. Added Paths: ----------- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlAnalysisConverterTest.java Added: trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlAnalysisConverterTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlAnalysisConverterTest.java (rev 0) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlAnalysisConverterTest.java 2011-06-11 22:45:10 UTC (rev 913) @@ -0,0 +1,233 @@ +package org.cipres.treebase.domain.nexus; + +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.HashMap; +import java.util.Map; + +import org.cipres.treebase.Constants; +import org.cipres.treebase.dao.AbstractDAOTest; +import org.cipres.treebase.domain.matrix.CharacterMatrix; +import org.cipres.treebase.domain.nexus.nexml.NexmlDocumentConverter; +import org.cipres.treebase.domain.study.Algorithm; +import org.cipres.treebase.domain.study.Analysis; +import org.cipres.treebase.domain.study.AnalysisStep; +import org.cipres.treebase.domain.study.AnalyzedData; +import org.cipres.treebase.domain.study.Software; +import org.cipres.treebase.domain.study.Study; +import org.cipres.treebase.domain.taxon.TaxonLabelHome; +import org.cipres.treebase.domain.tree.PhyloTree; +import org.nexml.model.Annotatable; +import org.nexml.model.Annotation; +import org.nexml.model.Document; +import org.nexml.model.DocumentFactory; +import org.nexml.model.Matrix; +import org.nexml.model.Network; +import org.nexml.model.TreeBlock; + +public class NexmlAnalysisConverterTest extends AbstractDAOTest { + private TaxonLabelHome mTaxonLabelHome; + + /** + * Test for {@link org.cipres.treebase.domain.nexus.nexml.NexmlMatrixConverter#fromTreeBaseToXml(CharacterMatrix)}. + * @throws URISyntaxException + * @throws IOException + */ + public void testNexmlAnalysisConverter() throws URISyntaxException, IOException { + String testName = "testNexmlAnalysisConverter"; + //signal beginning of test + if (logger.isInfoEnabled()) { + logger.info("Running Test: " + testName); + } + Map<String,AnalyzedData> analyzedDataForData = new HashMap<String,AnalyzedData>(); + long studyId = 794; // this study seems to have character sets + + // this is the full study as it is stored by the database + Study tbStudy = (Study)loadObject(Study.class, studyId); + + // this is an object representation of a NeXML document + Document nexDoc = DocumentFactory.safeCreateDocument(); + + // the converter populates the NeXML document with the contents of the treebase study + NexmlDocumentConverter ndc = new NexmlDocumentConverter(tbStudy,getTaxonLabelHome(),nexDoc); + ndc.fromTreeBaseToXml(tbStudy); // here is where the conversion happens + + attachAnalysisMetadata(analyzedDataForData, tbStudy, nexDoc); + + // attach analysis step metadata to matrices + for ( Matrix<?> nexMatrix : nexDoc.getMatrices() ) { + attachAnalyzedDataMetadata(analyzedDataForData, nexMatrix); + } + + // attach analysis step metadata to trees + for ( TreeBlock nexTrees : nexDoc.getTreeBlockList() ) { + int count = nexTrees.getSegmentCount(); + for ( int i = 0; i < count; i++ ) { + Network<?> nexTree = nexTrees.getSegment(i); + attachAnalyzedDataMetadata(analyzedDataForData, nexTree); + } + } + + FileWriter fstream = new FileWriter("/Users/rvosa/Desktop/outfile.xml"); + BufferedWriter out = new BufferedWriter(fstream); + out.write(nexDoc.getXmlString()); + out.close(); + } + + /** + * + * @param analyzedDataForData + * @param nexAnnotatable + * @throws URISyntaxException + */ + private void attachAnalyzedDataMetadata(Map<String, AnalyzedData> analyzedDataForData, Annotatable nexAnnotatable) throws URISyntaxException { + AnalyzedData tbData = analyzedDataForData.get(nexAnnotatable.getId()); + URI tbStepPurl = tbData.getAnalysisStep().getPhyloWSPath().getPurl().toURI(); + String predicate = tbData.isInputData() ? "tb:input.analysistep" : "tb:output.analysisstep"; + nexAnnotatable.addAnnotationValue(predicate, Constants.TBTermsURI, tbStepPurl); + logger.info("attached analyzed data metadata"); + } + + /** + * + * @param analyzedDataForData + * @param tbStudy + * @param nexDoc + * @throws URISyntaxException + */ + private void attachAnalysisMetadata(Map<String, AnalyzedData> analyzedDataForData, Study tbStudy, Document nexDoc) throws URISyntaxException { + for ( Analysis tbAnalysis : tbStudy.getAnalyses() ) { + URI tbAnalysisPurl = URI.create(tbAnalysis.getPhyloWSPath().getPurl().toString()); + Annotation nexAnalysis = nexDoc.addAnnotationValue("tb:identifier.analysis", Constants.TBTermsURI, tbAnalysisPurl); + logger.info("attached analysis identifier " + tbAnalysisPurl); + + for ( AnalysisStep tbAnalysisStep : tbAnalysis.getAnalysisStepsReadOnly() ) { + URI tbAnalysisStepPurl = URI.create(tbAnalysisStep.getPhyloWSPath().getPurl().toString()); + Annotation nexAnalysisStep = nexAnalysis.addAnnotationValue("tb:identifier.analysisstep", Constants.TBTermsURI, tbAnalysisStepPurl); + logger.info("attached analysis step identifier " + tbAnalysisStepPurl); + + attachAnalysisStepMetadata(tbAnalysisStep, nexAnalysisStep); + for ( AnalyzedData tbAnalyzedData : tbAnalysisStep.getDataSetReadOnly() ) { + String type = tbAnalyzedData.getDataType(); + logger.info("analyzed data is of type "+type); + if ( "tree".equals(type) ) { + PhyloTree tbTree = tbAnalyzedData.getTreeData(); + analyzedDataForData.put(tbTree.getTreebaseIDString().toString(), tbAnalyzedData); + } + else if ( "matrix".equals(type) ) { + org.cipres.treebase.domain.matrix.Matrix tbMatrix = tbAnalyzedData.getMatrixData(); + analyzedDataForData.put(tbMatrix.getTreebaseIDString().toString(), tbAnalyzedData); + } + else { + logger.warn("unexpected data type encountered: "+type); + } + } + } + } + } + + /** + * + * @param tbAnalysisStep + * @param nexAnalysisStep + * @throws URISyntaxException + */ + private void attachAnalysisStepMetadata(AnalysisStep tbAnalysisStep, + Annotation nexAnalysisStep) throws URISyntaxException { + // attach analysis step name + if ( null != tbAnalysisStep.getName() ) { + nexAnalysisStep.addAnnotationValue("dc:title", Constants.DCURI, tbAnalysisStep.getName()); + logger.info("attached analysis step name"); + } + + // attach analysis step commands + if ( null != tbAnalysisStep.getCommands() ) { + nexAnalysisStep.addAnnotationValue("tb:analysisstep.commands", Constants.TBTermsURI, tbAnalysisStep.getCommands()); + logger.info("attached analysis step commands"); + } + + // process software metadata + Software tbSoftware = tbAnalysisStep.getSoftwareInfo(); + attachSoftwareMetadata(nexAnalysisStep, tbSoftware); + + // process algorithm metadata + Algorithm tbAlgorithm = tbAnalysisStep.getAlgorithmInfo(); + attachAlgorithmMetadata(nexAnalysisStep, tbAlgorithm); + } + + /** + * + * @param nexAnalysisStep + * @param tbAlgorithm + * @throws URISyntaxException + */ + private void attachAlgorithmMetadata(Annotation nexAnalysisStep, + Algorithm tbAlgorithm) throws URISyntaxException { + URI tbAlgorithmPurl = tbAlgorithm.getPhyloWSPath().getPurl().toURI(); + Annotation nexAlgorithm = nexAnalysisStep.addAnnotationValue("tb:identifier.algorithm", Constants.TBTermsURI, tbAlgorithmPurl); + logger.info("attached algorithm url "+tbAlgorithmPurl); + + // attach algorithm type + if ( null != tbAlgorithm.getAlgorithmType() ) { + nexAlgorithm.addAnnotationValue("dc:type", Constants.DCURI, tbAlgorithm.getAlgorithmType()); + logger.info("attached algorithm type"); + } + + // attach algorithm description + if ( null != tbAlgorithm.getDescription() ) { + nexAlgorithm.addAnnotationValue("dc:description", Constants.DCURI, tbAlgorithm.getDescription()); + logger.info("attached algorithm description"); + } + } + + /** + * + * @param nexAnalysisStep + * @param tbSoftware + * @throws URISyntaxException + */ + private void attachSoftwareMetadata(Annotation nexAnalysisStep, Software tbSoftware) throws URISyntaxException { + URI tbSoftwarePurl = tbSoftware.getPhyloWSPath().getPurl().toURI(); + Annotation nexSoftware = nexAnalysisStep.addAnnotationValue("tb:identifier.software", Constants.TBTermsURI, tbSoftwarePurl); + logger.info("attached software identifier "+tbSoftwarePurl); + + // attach software name + if ( null != tbSoftware.getName() ) { + nexSoftware.addAnnotationValue("dc:title", Constants.DCURI, tbSoftware.getName()); + logger.info("attached software title"); + } + + // attach software version + if ( null != tbSoftware.getSoftwareVersion() ) { + nexSoftware.addAnnotationValue("dc:identifier", Constants.DCURI, tbSoftware.getSoftwareVersion()); + logger.info("attached software version"); + } + + // attach software url + if ( null != tbSoftware.getSoftwareURL() ) { + URI tbSoftwareURL = URI.create(tbSoftware.getSoftwareURL()); + nexSoftware.addAnnotationValue("dc:source", Constants.DCURI, tbSoftwareURL); + logger.info("attached software url"); + } + } + + /** + * Return the TaxonLabelHome field. + * + * @return TaxonLabelHome mTaxonLabelHome + */ + public TaxonLabelHome getTaxonLabelHome() { + return mTaxonLabelHome; + } + + /** + * Set the TaxonLabelHome field. + */ + public void setTaxonLabelHome(TaxonLabelHome pNewTaxonLabelHome) { + mTaxonLabelHome = pNewTaxonLabelHome; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-06-11 22:20:38
|
Revision: 912 http://treebase.svn.sourceforge.net/treebase/?rev=912&view=rev Author: rvos Date: 2011-06-11 22:20:32 +0000 (Sat, 11 Jun 2011) Log Message: ----------- Added javadoc Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java 2011-06-11 22:19:57 UTC (rev 911) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java 2011-06-11 22:20:32 UTC (rev 912) @@ -89,16 +89,28 @@ mVersion = pNewVersion; } + /** + * Returns an object whose string representation is of the format + * S1787 + */ @Transient public TreebaseIDString getTreebaseIDString () { return new TreebaseIDString(this); } + /** + * Returns an object whose string representation is of the format + * TB2:S1787 + */ @Transient public NamespacedGUID getNamespacedGUID () { return getTreebaseIDString().getNamespacedGUID(); } + /** + * Returns an object whose string representation is of the format + * study/TB2:1787 + */ @Transient public PhyloWSPath getPhyloWSPath() { return new PhyloWSPath(this); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-06-11 22:20:03
|
Revision: 911 http://treebase.svn.sourceforge.net/treebase/?rev=911&view=rev Author: rvos Date: 2011-06-11 22:19:57 +0000 (Sat, 11 Jun 2011) Log Message: ----------- Added prefixes for algorithm and software identifiers Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseIDString.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseIDString.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseIDString.java 2011-06-10 20:41:41 UTC (rev 910) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseIDString.java 2011-06-11 22:19:57 UTC (rev 911) @@ -8,9 +8,11 @@ import org.cipres.treebase.domain.matrix.DiscreteMatrixElement; import org.cipres.treebase.domain.matrix.Matrix; import org.cipres.treebase.domain.matrix.PhyloChar; +import org.cipres.treebase.domain.study.Algorithm; import org.cipres.treebase.domain.study.Analysis; import org.cipres.treebase.domain.study.AnalysisStep; import org.cipres.treebase.domain.study.AnalyzedData; +import org.cipres.treebase.domain.study.Software; import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.taxon.Taxon; import org.cipres.treebase.domain.taxon.TaxonLabel; @@ -57,6 +59,8 @@ val.put(Analysis.class, "A"); val.put(AnalysisStep.class, "As"); val.put(AnalyzedData.class, "Ad"); + val.put(Algorithm.class, "Al"); + val.put(Software.class, "So"); return val; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-06-10 20:41:48
|
Revision: 910 http://treebase.svn.sourceforge.net/treebase/?rev=910&view=rev Author: hshyket Date: 2011-06-10 20:41:41 +0000 (Fri, 10 Jun 2011) Log Message: ----------- Fixing error with last commit. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2011-06-10 19:41:35 UTC (rev 909) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2011-06-10 20:41:41 UTC (rev 910) @@ -577,7 +577,7 @@ newWick.concat(";"); } - pBuilder.append(getNewickString()).append("\n"); + pBuilder.append(newWick).append("\n"); pBuilder.append("[! TreeBASE tree URI: ").append(getPhyloWSPath().getPurl()).append("]\n"); pBuilder.append("\n\nEND;\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-06-10 19:41:41
|
Revision: 909 http://treebase.svn.sourceforge.net/treebase/?rev=909&view=rev Author: hshyket Date: 2011-06-10 19:41:35 +0000 (Fri, 10 Jun 2011) Log Message: ----------- Fixing issue with semicolon not being at the end of the tree in a nexus file. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2011-06-10 16:47:32 UTC (rev 908) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2011-06-10 19:41:35 UTC (rev 909) @@ -569,6 +569,14 @@ } } + + //check to see if the NewickString has a semicolon in it + String newWick = getNewickString(); + + if (newWick.indexOf(';') == -1) { + newWick.concat(";"); + } + pBuilder.append(getNewickString()).append("\n"); pBuilder.append("[! TreeBASE tree URI: ").append(getPhyloWSPath().getPurl()).append("]\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-06-10 16:47:39
|
Revision: 908 http://treebase.svn.sourceforge.net/treebase/?rev=908&view=rev Author: rvos Date: 2011-06-10 16:47:32 +0000 (Fri, 10 Jun 2011) Log Message: ----------- Removed unused import Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlOTUConverter.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlOTUConverter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlOTUConverter.java 2011-06-10 14:51:54 UTC (rev 907) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlOTUConverter.java 2011-06-10 16:47:32 UTC (rev 908) @@ -1,7 +1,5 @@ package org.cipres.treebase.domain.nexus.nexml; -import java.net.URI; - import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.taxon.TaxonLabel; import org.cipres.treebase.domain.taxon.TaxonLabelHome; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-06-10 14:52:00
|
Revision: 907 http://treebase.svn.sourceforge.net/treebase/?rev=907&view=rev Author: rvos Date: 2011-06-10 14:51:54 +0000 (Fri, 10 Jun 2011) Log Message: ----------- Now using a study ID that actually has character sets, and added some defensive programming to prevent null pointer exceptions in cases where no increment has been defined for the column range (in which case we default to an increment of 1, i.e. a contiguous range). Modified Paths: -------------- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java 2011-06-10 14:46:37 UTC (rev 906) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java 2011-06-10 14:51:54 UTC (rev 907) @@ -34,7 +34,7 @@ logger.info("Running Test: " + testName); } - long studyId = 1787; + long studyId = 794; // this study seems to have character sets // this is the full study as it is stored by the database Study tbStudy = (Study)loadObject(Study.class, studyId); @@ -91,12 +91,19 @@ int start = tbColumnRange.getStartColIndex(); int stop = tbColumnRange.getEndColIndex(); - // this is how we increment from beginning to end. This number is probably either 1, for a - // contiguous range, or 3 for codon positions - int inc = tbColumnRange.getRepeatInterval(); + // this is how we increment from beginning to end. This number is probably either null, for a + // contiguous range, or perhaps 3 for codon positions + int inc = 1; + // need to do this to prevent nullpointerexceptions + if ( null != tbColumnRange.getRepeatInterval() ) { + inc = tbColumnRange.getRepeatInterval(); + } + // this is how we create the equivalent nexml character set - Subset nexSubset = nexMatrix.createSubset(tbCharSet.getLabel()); + // you will need to update CharSet to get the new implementation of getLabel(), which + // returns the same value as getTitle() + Subset nexSubset = nexMatrix.createSubset(tbCharSet.getLabel()); // we have to assign character objects to the subset. Here we get the full list List<org.nexml.model.Character> nexCharacters = nexMatrix.getCharacters(); @@ -110,6 +117,7 @@ } } Assert.assertTrue("Searched for equivalent to NeXML matrix "+nexId, foundEquivalentMatrix); + System.out.println(nexDoc.getXmlString()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-06-10 14:46:43
|
Revision: 906 http://treebase.svn.sourceforge.net/treebase/?rev=906&view=rev Author: rvos Date: 2011-06-10 14:46:37 +0000 (Fri, 10 Jun 2011) Log Message: ----------- Added default serialVersionUID Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharSet.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharSet.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharSet.java 2011-06-10 14:45:52 UTC (rev 905) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharSet.java 2011-06-10 14:46:37 UTC (rev 906) @@ -38,6 +38,11 @@ @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "matrixCache") public abstract class CharSet extends AbstractPersistedObject { + /** + * + */ + private static final long serialVersionUID = 1L; + private String mTitle; private CharacterMatrix mMatrix; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-06-10 14:45:58
|
Revision: 905 http://treebase.svn.sourceforge.net/treebase/?rev=905&view=rev Author: rvos Date: 2011-06-10 14:45:52 +0000 (Fri, 10 Jun 2011) Log Message: ----------- Added override of AbstractPersistedObject.getLabel(), which is there to simplify NeXML generation by creating a uniform way of getting the human readable label for things (rather than having to guess between getTitle() or getName()) Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharSet.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharSet.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharSet.java 2011-06-08 19:44:15 UTC (rev 904) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharSet.java 2011-06-10 14:45:52 UTC (rev 905) @@ -58,6 +58,16 @@ public String getTitle() { return mTitle; } + + /** + * This method is here to simplify NeXML generation. It overrides the + * method in AbstractPersistedObject + * @return + */ + @Transient + public String getLabel() { + return getTitle(); + } /** * Set the Title field. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-06-08 19:44:21
|
Revision: 904 http://treebase.svn.sourceforge.net/treebase/?rev=904&view=rev Author: hshyket Date: 2011-06-08 19:44:15 +0000 (Wed, 08 Jun 2011) Log Message: ----------- Updating the allowed date format that is parsed to be ISO 8601 compliant Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudySearchController.java Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudySearchController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudySearchController.java 2011-06-08 14:02:50 UTC (rev 903) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudySearchController.java 2011-06-08 19:44:15 UTC (rev 904) @@ -25,7 +25,9 @@ import org.cipres.treebase.domain.study.Submission; import org.cipres.treebase.domain.study.SubmissionService; import org.cipres.treebase.web.Constants; +import org.cipres.treebase.web.model.Identify; import org.cipres.treebase.web.util.RequestMessageSetter; +import org.cipres.treebase.web.util.IdentifyUtil; import org.springframework.validation.BindException; import org.springframework.web.servlet.ModelAndView; import org.z3950.zing.cql.CQLAndNode; @@ -54,6 +56,7 @@ */ private static final Logger LOGGER = Logger.getLogger(StudySearchController.class); protected String mValidateTaxaView; + private Identify identify; public String getValidateTaxaView() { return mValidateTaxaView; @@ -308,14 +311,17 @@ Collection<Study> matches; Date from = null; Date until = null; - DateFormat df = DateFormat.getDateInstance(); + //DateFormat df = DateFormat.getDateInstance(); if ( relation.getBase().startsWith(">") ) { - from = df.parse(searchTerm); + //from = df.parse(searchTerm); + from = IdentifyUtil.parseGranularity(identify.getGranularityPattern(), searchTerm); until = new Date(); // i.e. now } else if ( relation.getBase().startsWith("<") ) { from = new Date(0); // i.e. epoch - until = df.parse(searchTerm); + //until = df.parse(searchTerm); + until = IdentifyUtil.parseGranularity(identify.getGranularityPattern(), searchTerm); + } Collection<Submission> submissions = submissionService.findSubmissionByCreateDateRange(from, until); matches = new HashSet<Study>(); @@ -329,14 +335,17 @@ CQLRelation relation, StudyService studyService) throws ParseException { Date from = null; Date until = null; - DateFormat df = DateFormat.getDateInstance(); + //DateFormat df = DateFormat.getDateInstance(); + if ( relation.getBase().startsWith(">") ) { - from = df.parse(searchTerm); + //from = df.parse(searchTerm); + from = IdentifyUtil.parseGranularity(identify.getGranularityPattern(), searchTerm); until = new Date(); // i.e. now } else if ( relation.getBase().startsWith("<") ) { from = new Date(0); // i.e. epoch - until = df.parse(searchTerm); + //until = df.parse(searchTerm); + until = IdentifyUtil.parseGranularity(identify.getGranularityPattern(), searchTerm); } return studyService.findByPublicationDateRange(from, until); } @@ -347,14 +356,16 @@ Collection<Study> matches; Date from = null; Date until = null; - DateFormat df = DateFormat.getDateInstance(); + //DateFormat df = DateFormat.getDateInstance(); if ( relation.getBase().startsWith(">") ) { - from = df.parse(searchTerm); + from = IdentifyUtil.parseGranularity(identify.getGranularityPattern(), searchTerm); + //from = df.parse(searchTerm); until = new Date(); // i.e. now } else if ( relation.getBase().startsWith("<") ) { from = new Date(0); // i.e. epoch - until = df.parse(searchTerm); + //until = df.parse(searchTerm); + until = IdentifyUtil.parseGranularity(identify.getGranularityPattern(), searchTerm); } Collection<Submission> submissions = submissionService.findSubmissionByLastModifiedDateRange(from, until); matches = new HashSet<Study>(); @@ -415,4 +426,12 @@ mapping.put("dcterms.identifier", "tb.identifier.study"); return mapping; } + + public Identify getIdentify() { + return identify; + } + + public void setIdentify(Identify identify) { + this.identify = identify; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-06-08 14:02:59
|
Revision: 903 http://treebase.svn.sourceforge.net/treebase/?rev=903&view=rev Author: rvos Date: 2011-06-08 14:02:50 +0000 (Wed, 08 Jun 2011) Log Message: ----------- Updated this to demonstrate how char set creation should work. Modified Paths: -------------- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java 2011-06-08 14:01:38 UTC (rev 902) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlMatrixConverterTest.java 2011-06-08 14:02:50 UTC (rev 903) @@ -1,11 +1,15 @@ package org.cipres.treebase.domain.nexus; +import java.util.Collection; import java.util.List; +import java.util.Set; import junit.framework.Assert; import org.cipres.treebase.dao.AbstractDAOTest; +import org.cipres.treebase.domain.matrix.CharSet; import org.cipres.treebase.domain.matrix.CharacterMatrix; +import org.cipres.treebase.domain.matrix.ColumnRange; import org.cipres.treebase.domain.nexus.nexml.NexmlDocumentConverter; import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.taxon.TaxonLabelHome; @@ -15,6 +19,7 @@ import org.nexml.model.Document; import org.nexml.model.Matrix; import org.nexml.model.MolecularMatrix; +import org.nexml.model.Subset; public class NexmlMatrixConverterTest extends AbstractDAOTest { private TaxonLabelHome mTaxonLabelHome; @@ -26,30 +31,85 @@ String testName = "testNexmlMatrixConverter"; //signal beginning of test if (logger.isInfoEnabled()) { - logger.info("\n\t\tRunning Test: " + testName); + logger.info("Running Test: " + testName); } long studyId = 1787; - Study study = (Study)loadObject(Study.class, studyId); - Document doc = DocumentFactory.safeCreateDocument(); - NexmlDocumentConverter ndc = new NexmlDocumentConverter(study,getTaxonLabelHome(),doc); - Document document = ndc.fromTreeBaseToXml(study); - List<Matrix<?>> matrices = document.getMatrices(); - Assert.assertTrue(matrices.size() != 0 ); - for ( Matrix<?> matrix : matrices ) { - if ( matrix instanceof MolecularMatrix ) { - System.out.println(matrix.getId() + " is a molecular character state matrix"); + // this is the full study as it is stored by the database + Study tbStudy = (Study)loadObject(Study.class, studyId); + + // these are the character state matrices that are part of the study + Set<org.cipres.treebase.domain.matrix.Matrix> tbMatrices = tbStudy.getMatrices(); + + // this is an object representation of a NeXML document + Document nexDoc = DocumentFactory.safeCreateDocument(); + + // the converter populates the NeXML document with the contents of the treebase study + NexmlDocumentConverter ndc = new NexmlDocumentConverter(tbStudy,getTaxonLabelHome(),nexDoc); + ndc.fromTreeBaseToXml(tbStudy); // here is where the conversion happens + + // these are the NeXML matrices that were created from the study + List<Matrix<?>> nexMatrices = nexDoc.getMatrices(); + + // there most be more than zero matrices because every treebase study has at least one matrix + Assert.assertTrue(nexMatrices.size() != 0 ); + + // now we're going to match up the NeXML matrices with their equivalent treebase ones + for ( Matrix<?> nexMatrix : nexMatrices ) { + + // the xml id is the same as the primary key of the equivalent matrix stored by treebase + String nexId = nexMatrix.getId(); + boolean foundEquivalentMatrix = false; + + // iterate over all treebase matrices for the study + for ( org.cipres.treebase.domain.matrix.Matrix tbMatrix : tbMatrices ) { + String tbId = "M" + tbMatrix.getId(); + + // although there is a class DistanceMatrix, it is my belief that we don't actually have + // any distance matrices stored, nor can we convert them to NeXML + Assert.assertTrue("TreeBASE matrix "+tbId+" must be a character matrix, not a distance matrix", tbMatrix instanceof CharacterMatrix); + + // if true, the matrices are equivalent + if ( nexId.equals(tbId) ) { + foundEquivalentMatrix = true; + Assert.assertTrue("NeXML matrix "+nexId+ " is one of the known subclasses", + nexMatrix instanceof CategoricalMatrix || nexMatrix instanceof MolecularMatrix || nexMatrix instanceof ContinuousMatrix); + + // we have to coerce the tbMatrix into a character matrix to get its character sets + CharacterMatrix tbCharacterMatrix = (CharacterMatrix)tbMatrix; + Set<CharSet> tbCharSets = tbCharacterMatrix.getCharSets(); + + // a treebase matrix has zero or more character sets, we must iterate over them + for ( CharSet tbCharSet : tbCharSets ) { + + // the coordinates of the character set are defined by a collection of column ranges that we iterate over + Collection<ColumnRange> tbColumnRanges = tbCharSet.getColumns(tbCharacterMatrix); + for ( ColumnRange tbColumnRange : tbColumnRanges ) { + + // these are the beginning and end of the range + int start = tbColumnRange.getStartColIndex(); + int stop = tbColumnRange.getEndColIndex(); + + // this is how we increment from beginning to end. This number is probably either 1, for a + // contiguous range, or 3 for codon positions + int inc = tbColumnRange.getRepeatInterval(); + + // this is how we create the equivalent nexml character set + Subset nexSubset = nexMatrix.createSubset(tbCharSet.getLabel()); + + // we have to assign character objects to the subset. Here we get the full list + List<org.nexml.model.Character> nexCharacters = nexMatrix.getCharacters(); + + // now we iterate over the coordinates and assign the nexml characters to the set + for ( int i = start; i <= stop; i += inc ) { + nexSubset.addThing(nexCharacters.get(i)); + } + } + } + } } - else if ( matrix instanceof ContinuousMatrix ) { - System.out.println(matrix.getId() + " is a continuous-valued character matrix"); - } - else if ( matrix instanceof CategoricalMatrix ) { - System.out.println(matrix.getId() + " is a categorical character state matrix"); - } - else { - System.out.println("This should not ever happen."); - } + Assert.assertTrue("Searched for equivalent to NeXML matrix "+nexId, foundEquivalentMatrix); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-06-08 14:01:47
|
Revision: 902 http://treebase.svn.sourceforge.net/treebase/?rev=902&view=rev Author: rvos Date: 2011-06-08 14:01:38 +0000 (Wed, 08 Jun 2011) Log Message: ----------- The Set that contains all CharSets associated with the matrix should be parameterized to Set<CharSet> to avoid warnings about this. I also commented out a private method that is never used locally (and therefore useless). Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java 2011-06-08 13:59:18 UTC (rev 901) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java 2011-06-08 14:01:38 UTC (rev 902) @@ -48,6 +48,11 @@ @DiscriminatorValue("C") public abstract class CharacterMatrix extends Matrix { + /** + * + */ + private static final long serialVersionUID = 1L; + protected List<MatrixRow> mRows = new ArrayList<MatrixRow>(); private AncStateSet mDefaultAncSet; @@ -58,7 +63,7 @@ private List<MatrixColumn> mColumns = new ArrayList<MatrixColumn>(); private Set<AncStateSet> mAncStateSets = new HashSet<AncStateSet>(); - private Set mCharSets = new HashSet(); + private Set<CharSet> mCharSets = new HashSet<CharSet>(); private Collection<CharWeightSet> mWeightSets = new ArrayList<CharWeightSet>(); private Collection<CodonPositionSet> mCodonPosSets = new ArrayList<CodonPositionSet>(); private Collection<GeneticCodeSet> mCodeSets = new ArrayList<GeneticCodeSet>(); @@ -158,9 +163,10 @@ * @param pExSet * @return */ - private boolean isDefaultExcludedSet(ExcludedCharSet pExSet) { - return (pExSet == getDefaultExcludedSet()); - } +// this is never used locally, so I commented it out - maybe it shouldn't be here? -- rav, 8 June '11 +// private boolean isDefaultExcludedSet(ExcludedCharSet pExSet) { +// return (pExSet == getDefaultExcludedSet()); +// } /** * Return the DefaultTypeSet field. @@ -258,14 +264,14 @@ @OneToMany(mappedBy = "matrix", cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REMOVE}, targetEntity = CharSet.class) @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "matrixCache") - public Set getCharSets() { + public Set<CharSet> getCharSets() { return mCharSets; } /** * Set the CharSets field. */ - public void setCharSets(Set pNewCharSets) { + public void setCharSets(Set<CharSet> pNewCharSets) { mCharSets = pNewCharSets; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |