Examples of Study


Examples of edu.lmu.cs.razor.model.Study

     * @throws Exception
     */
    public void testCreateFromPath() throws Exception {
        // Read the study.
        File testStudy = new File(TESTDIR);
        Study s = Study.createFromPath(testStudy);

        // Make sure the study stored the correct source directory.
        assertEquals(testStudy, s.getSourceDirectory());
       
        // Make sure the study read the correct numbers of objects.
        assertEquals(NUM_IMAGES, s.getImages().size());
        assertEquals(NUM_SERIES, s.getSeries().size());
        assertEquals(NUM_SCOUTS, s.getScouts().size());
        assertEquals(NUM_SR, s.getStructuredReports().size());
       
        // Make sure that the presentation states were read in properly.
        int psTotal = 0;
        for (DICOMImage di : s.getScouts()) {
            psTotal += di.getPresentationStates().size();
        }
        // TODO Ask Craig if the overall image list should include scouts.
        for (DICOMImage di : s.getImages()) {
            psTotal += di.getPresentationStates().size();
        }
        assertEquals(NUM_PS, psTotal);
       
        // Make sure that the images were properly distributed into their
        // series.  We can assume a specific order here, because the study
        // reading process sorts the datasets in a deterministic fashion.
        int i = 0;
        for (Series series : s.getSeries()) {
            assertEquals(SERIES_NUMBERS[i], series.getSeriesNumber());
            assertEquals(SERIES_COUNTS[i], series.getImages().size());
            i++;
        }
       
View Full Code Here

Examples of org.cipres.treebase.domain.study.Study

    String username = request.getRemoteUser();

    long study_id = ControllerUtil.getStudyId(request);
    Long submissionId = null;

    Study study = getStudyService().findByID(study_id);
    if (study != null) {
      Submission sub = study.getSubmission();
      if (sub != null) {
        submissionId = sub.getId();
      }
    }
View Full Code Here

Examples of org.cipres.treebase.domain.study.Study

  Map<String,String> getObjectQueryParameters(Long objectId) throws ObjectNotFoundException {
    Matrix matrix = getMatrixService().findByID(objectId);
    if ( matrix == null ) {
      throw new ObjectNotFoundException("Can't find matrix " + objectId);
    }
    Study study = matrix.getStudy();
   
    if ( study == null ) {
      throw new ObjectNotFoundException("Can't find study for matrix "+objectId);
    }
   
    setStudy(matrix.getStudy());
   
    Map<String,String> params = new HashMap<String,String>();
    params.put("id", ""+study.getId());
    params.put("matrixid", ""+objectId);
    return params;
  }
View Full Code Here

Examples of org.cipres.treebase.domain.study.Study

  /* (non-Javadoc)
   * @see org.cipres.treebase.web.controllers.AbstractDownloadController#getFileContent(long, javax.servlet.http.HttpServletRequest)
   */
  @Override
  protected String getFileContent(long pStudyID, HttpServletRequest request) {
    Study study = getStudyService().findByID(pStudyID);
    if ( getFormat(request) == FORMAT_NEXML || getFormat(request) == FORMAT_RDF ) {
      return getNexmlService().serialize(study,getDefaultProperties(request));
    }
    /*else if ( getFormat(request) == FORMAT_RDF ) {
      return getRdfaService().serialize(study,getDefaultProperties(request));     
    }*/   
    else {
      StringBuilder builder = new StringBuilder();
      builder.append("#NEXUS\n\n");
           
      // header:
      TreebaseUtil.attachStudyHeader(study, builder);
 
      // taxa:
     
      //set a unique number for each block when the title is Taxa
      Integer taxaCount = 1;
      List<List <TaxonLabel>> taxonCompare = new ArrayList<List <TaxonLabel>>();
      for ( TaxonLabelSet tls : study.getTaxonLabelSets() ) {
        Boolean isDuplicateTaxa = false;
        Integer taxaCompareCount = 1;
       
        List<TaxonLabel> taxonLblSet = tls.getTaxonLabelsReadOnly();
        if (taxonCompare != null) {
          for (List<TaxonLabel> lstTls : taxonCompare) {
            if (taxonLblSet.equals(lstTls)) {
              isDuplicateTaxa = true;
              break;
            }
            else {
              taxaCompareCount++;
            }
          }
        }
       
        if (isDuplicateTaxa) {
          tls.setTitle("Taxa" + taxaCompareCount.toString());
        }
        else {
          tls.setTitle("Taxa" + taxaCount.toString());
          taxaCount++;
          // one taxon label per line, no line number.
          tls.buildNexusBlockTaxa(builder, true, false);
          taxonCompare.add(taxonLblSet);
        }
      }
     
      // matrices::
      for ( Matrix m : study.getMatrices() ) {
        m.generateNexusBlock(builder);
      }
     
      //tree blocks:
      for ( TreeBlock tb : study.getTreeBlocks() ) {
        tb.generateAFileDynamically(builder);
      }
     
      return builder.toString();
    }
View Full Code Here

Examples of org.cipres.treebase.domain.study.Study

    if (request.getParameter(ACTION_UPDATE) != null) {

      for (Submission submission : asbmcollection) {

        Study study = submission.getStudy();
        StudyStatus studyStatus = study.getStudyStatus();

        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug("++ " + submission.getId() + "  "
            + study.getTransientDescription());
        }

        if (study.getTransientDescription().equals(StudyStatus.READY)) {
          if (!submission.isReady()) {
            getSubmissionService().updateStudyStatusReady(submission.getId());
          }
        } else if (study.getTransientDescription().equals(StudyStatus.PUBLISHED)) {
          // check the status is ready before change to publish:
          if (!submission.isReady() && !submission.isPublished()) {
            // Undo the change:
            study.resetTransientDescription();

            errorsList.add("Submission with ID: " + submission.getId()
              + " could not be updated.");

          } else {
            if (!submission.isPublished()) {
              getSubmissionService().updateStudyStatusPublish(submission.getId());
            }
          }
        } else if (study.getTransientDescription().equals(StudyStatus.INPROGRESS)) {
          if (!submission.isInProgress()) {
            getSubmissionService().updateStudyStatusInProgress(submission.getId());
          }
        }
View Full Code Here

Examples of org.cipres.treebase.domain.study.Study

          }
          phyloWSPath = new PhyloWSPath(theClass.getPackage(),namespacedGUID);
         
          TBPersistable theObject = getStudyService().findByID(theClass, treebaseIDString.getId());
          if ( null != theObject ) {
            Study theContainingStudy = theObject.getStudy();
            if (null != theContainingStudy && ! theContainingStudy.isPublished()) {
                  response.setContentType("text/plain");
                  response.setStatus(HttpServletResponse.SC_SEE_OTHER);       
                  response.setHeader("Location", "/treebase-web/accessviolation.html");
                  return null;
                }
View Full Code Here

Examples of org.cipres.treebase.domain.study.Study

   *      javax.servlet.http.HttpServletResponse)
   */

  protected Object formBackingObject(HttpServletRequest request) throws ServletException {

    Study study = ControllerUtil.findStudy(request, mStudyService);
    Collection<TreeBlock> treeBlockList = study
      .getSubmission().getSubmittedTreeBlocksReadOnly();
    checkAnalyzed(treeBlockList,study);
    List<TreeBlock> test = new ArrayList<TreeBlock>();
    test.addAll(treeBlockList);
    return new AGenericList<List<TreeBlock>>(test);
View Full Code Here

Examples of org.cipres.treebase.domain.study.Study

      case byCreationDate:
        matches = findByCreationDate(searchTerm, relation, submissionService);
        break;
      case byDOI:
      {
        Study result = studyService.findByDOI(searchTerm);
        if ( null != result ) {
          matches.add(result);
        }
        break;
      }
View Full Code Here

Examples of org.cipres.treebase.domain.study.Study

    if ( valueLabel.matches("^[0-9]+$") ) {
      pError.rejectValue("taxonLabel", null, "Taxon Label cannot consist of integers alone.");
    }

    // Checking for the duplication of the Taxon Labels (String) in the Set
    Study study = myTaxonLabel.getStudy();
    List<TaxonLabel> taxonLabelSet = study.getSubmission().getSubmittedTaxonLabelsReadOnly();
    String testLbl = null;
    long valueId = myTaxonLabel.getId();
    String valueLabelUC = valueLabel.toUpperCase();   
    Iterator<TaxonLabel> itTxnLbl = taxonLabelSet.iterator();
    while (itTxnLbl.hasNext()) {
View Full Code Here

Examples of org.cipres.treebase.domain.study.Study

   
    private Map getRecordMap(Submission submission){
     
      Map map= new HashMap();
     
      Study study=submission.getStudy();
      Citation citation=study.getCitation();
      String publisher=null;
      if(!study.isPublished())return null;
     
      //System.out.println("ctype: "+citation.getCitationType());
      try{
      if(citation.getCitationType().toUpperCase().contains("BOOK"))
           publisher=((BookCitation)citation).getPublisher();
      else publisher=((ArticleCitation)citation).getJournal();
     
     
      List<Person> authors=citation.getAuthors();
      
   
      map.put("title", citation.getTitle());
      map.put("creator", authors);     
      map.put("subject", citation.getKeywords());
        if(study.getName()!=null&study.getNotes()!=null)     
          map.put("description", study.getName()+" "+study.getNotes());
        else if(study.getNotes()==null)
          map.put("description",study.getName());
        else
          map.put("description",study.getNotes());
      map.put("publisher", publisher);           
      map.put("date", citation.getPublishYear());
      map.put("identifier", "TreeBASE.org/study/TB2:s"+study.getId());
      map.put("datestamp", study.getReleaseDate());
     
      }catch(NullPointerException e){
        //study 253 citation= null, data should be fixed
         System.err.println("study "+study.getId()+
            " citation= "+e.getMessage());
         return null;
      }
     
      //map.put("type", "text");
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.