Examples of Taxon


Examples of com.psddev.cms.db.Taxon

            Site site = page.getSite();
            Predicate predicate = search.toQuery(page.getSite()).getPredicate();

            if (!ObjectUtils.isBlank(taxonParentUuid)) {

                Taxon parent = Query.findById(Taxon.class, taxonParentUuid);
                taxonResults = (Collection<Taxon>) Taxon.Static.getChildren(parent, predicate);

                if (site != null && !ObjectUtils.isBlank(taxonResults)) {

                    Collection<Taxon> siteTaxons = new ArrayList<Taxon>();
View Full Code Here

Examples of mesquite.lib.Taxon

        }

        // FIXME: instead of using a loop, use one query!
        long[] taxaIDs = t.getTaxaIDs();
        for (int j = 0; j < taxaIDs.length; j++) {
          Taxon taxon = t.getTaxon(j);

          String aLabel = taxon.getName();

          TaxonLabel taxonLabel = getTaxonLabelHome().getByDescriptionAndStudy(
            aLabel,
            pStudy);
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.Taxon

 
  /**
   * @author mjd 20081204
   */
  public void testFindStudiesByTaxon() {
    Taxon hSap = findHSapTaxon();
    Collection<Study> studies = getFixture().findStudies(hSap);
    logger.info("Query finished; results = " + studies.size() + " studies");
   
    assertTrue(studies.size() > 0);
    for (Study s : studies) {
      boolean thisStudyOK = false;
      for (TaxonLabelSet tls : s.getTaxonLabelSets()) {
        for (TaxonLabel tl : tls.getTaxonLabelsReadOnly()) {
          if (tl.getTaxonVariant() == null || tl.getTaxonVariant().getTaxon() == null) continue;
          if (tl.getTaxonVariant().getTaxon().getId() == hSap.getId()) {
            thisStudyOK = true;
            break;
          }
          if (thisStudyOK) break;
        }
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.Taxon

 
  /**
   * @author mjd 20081204
   */
  public void testFindTreesByTaxon() {
    Taxon hSap = findHSapTaxon();
    Collection<PhyloTree> trees = getFixture().findTrees(hSap);
    logger.info("Query finished; results = " + trees.size() + " studies");
   
    assertTrue(trees.size() > 0);
    for (PhyloTree t : trees) {
      boolean thisTreeOK = false;
      for (TaxonLabel tl : t.getAllTaxonLabels()) {
        if (tl.getTaxonVariant() == null || tl.getTaxonVariant().getTaxon() == null) continue;
        if (tl.getTaxonVariant().getTaxon().getId() == hSap.getId()) {
          thisTreeOK = true;
          break;
        }
      }
      assertTrue(thisTreeOK);
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.Taxon

 
  /**
   * @author mjd 20081204
   */
  public void testFindMatricesByTaxon() {
    Taxon hSap = findHSapTaxon();
    Collection<Matrix> matrices = getFixture().findMatrices(hSap);
    logger.info("Query finished; results = " + matrices.size() + " studies");
   
    assertTrue(matrices.size() > 0);
    for (Matrix t : matrices) {
      boolean thisMatrixOK = false;
      for (TaxonLabel tl : t.getAllTaxonLabels()) {
        if (tl.getTaxonVariant() == null || tl.getTaxonVariant().getTaxon() == null) continue;
        if (tl.getTaxonVariant().getTaxon().getId() == hSap.getId()) {
          thisMatrixOK = true;
          break;
        }
      }
      assertTrue(thisMatrixOK);
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.Taxon

    assertNotNull(expansion);
    assertEquals(14, expansion.size());
 
    // And each one of those TVs should refer to the same taxon
    for (TaxonVariant tv : expansion) {
      Taxon t = tv.getTaxon();
      assertTrue(t == tvEolphus.getTaxon() || t == tvCacatua.getTaxon());
   
   
    // And moreover the call should be idempotent
    // That is, the expansion of the expansion should be the same as
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.Taxon

    boolean bad = false;
    MergeDuplicateTaxaInterface me = (MergeDuplicateTaxaInterface) ContextManager.getBean("mergeDuplicateTaxa");

    for (String arg : args) {
      Long tId = Long.parseLong(arg);
      Taxon t = getTaxonHome().findPersistedObjectByID(Taxon.class, tId);
      if (t == null) {
        warn("No taxon with id T" + tId);
        bad = true;
      } else
        taxonClass.add(t);
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.Taxon

    Map<String,Set<Taxon>> taxonClasses = new HashMap<String,Set<Taxon>> ();
   
    warn("Scanning database");
    int taxonCount = 0;
    for (TBPersistable obj : getTaxonHome().findAll(Taxon.class)) {
      Taxon t = (Taxon) obj;
      String key = key(t);
      if (! taxonClasses.containsKey(key))
        taxonClasses.put(key, new HashSet<Taxon> ());
      taxonClasses.get(key).add(t);
      taxonCount++;
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.Taxon

  /* WARNING: This method should modify the TaxonSet and TaxonLink objects too, but doesn't.
   * At the time it was written, there were no such objects.  20090409 MJD
   */
  public void doMergeTaxonClass(Set<Taxon> taxonClass) {
    Iterator<Taxon> it = taxonClass.iterator();
    Taxon canonicalTaxon = it.next();
       
    // Find the taxon in the set with the lowest ID number
    while (it.hasNext()) {
      Taxon t = it.next();
      if (t.getId() < canonicalTaxon.getId()) canonicalTaxon = t;
    }
   
    {
      StringBuilder s = new StringBuilder ("Merging taxon class : ");
      for (Taxon t : taxonClass) s.append(t.getId()).append(" ");
      s.append("\n");
      warn(s.toString());
    }
    warn("  Canonical taxon for this set is T" + canonicalTaxon.getId());
   
    // Map all the other taxa to the canonical one
    for (Taxon t : taxonClass) {
      if (t.equals(canonicalTaxon)) continue;
      for (TaxonVariant tv : getTaxonHome().findVariantsByTaxon(t)) {
        tv.setTaxon(canonicalTaxon)
        getTaxonHome().merge(tv);
      }
      getCurrentSession().flush();
View Full Code Here

Examples of org.cipres.treebase.domain.taxon.Taxon

  public void createTaxon(String[] args) {
    String name = args[0];
    Long ubio = Long.decode(args[1]);
    Integer ncbi = Integer.decode(args[2]);

    Taxon t = new Taxon(name, ubio, ncbi);
    getTaxonHome().save(t);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.