Package org.moltools.apps.probemaker.messages

Examples of org.moltools.apps.probemaker.messages.Message


      String type = messE.getAttributeValue(MESSAGE_TYPE_NAME,ns);
      String desc = messE.getAttributeValue(DESCRIPTION,ns);
      MessageType mt = new MessageType(type,desc);
      byte severity = Byte.parseByte(messE.getAttributeValue(SEVERITY,ns));     
      String messageStr = messE.getText();
      Message m = new Message(messageStr,mt,severity);
      ProbeMakerPropertyUtils.addMessage(mh,m);
    }   
  }
View Full Code Here


  }

  protected Element getMessageListElement(Collection<? extends Message> messages) {
    Element messageList = new Element("messageList",ns); //$NON-NLS-1$
    for (Iterator<? extends Message> i = messages.iterator();i.hasNext();) {
      Message m = i.next();
      MessageType mt = m.getType();

      Element me = new Element(MESSAGE,ns);          
      me.setAttribute(MESSAGE_TYPE_NAME,mt.getType(),ns);
      me.setAttribute(DESCRIPTION,mt.getDescription(),ns);
      me.setAttribute(SEVERITY,String.valueOf(m.getSeverity()),ns);
      me.addContent(m.getMessage());           
      messageList.addContent(me);
    }
    return messageList;
 
View Full Code Here

      }
      p.println(outStr);

      if (fivePrime != null) {
        for (Iterator<Message> mi = ProbeMakerPropertyUtils.getAllMessages(fivePrime).iterator();mi.hasNext();) {
          Message m = mi.next();
          MessageType mt = m.getType();
          p.println(tio.getOutString(new String[] {mt.getType(),mt.getDescription(),m.getMessage(),String.valueOf(m.getSeverity())}));
        }
      }
      if (threePrime != null) {
        for (Iterator<Message> mi = ProbeMakerPropertyUtils.getAllMessages(threePrime).iterator();mi.hasNext();) {
          Message m = mi.next();
          MessageType mt = m.getType();
          p.println(tio.getOutString(new String[] {mt.getType(),mt.getDescription(),m.getMessage(),String.valueOf(m.getSeverity())}));
        }
      }
      for (Iterator<Message> mi = ProbeMakerPropertyUtils.getOwnMessages(pr.getTSSPair()).iterator();mi.hasNext();) {
        Message m = mi.next();
        MessageType mt = m.getType();
        p.println(tio.getOutString(new String[] {mt.getType(),mt.getDescription(),m.getMessage(),String.valueOf(m.getSeverity())}));
      }
      for (Iterator<Message> mi = ProbeMakerPropertyUtils.getOwnMessages(pr).iterator();mi.hasNext();) {
        Message m = mi.next();
        MessageType mt = m.getType();
        p.println(tio.getOutString(new String[] {mt.getType(),mt.getDescription(),m.getMessage(),String.valueOf(m.getSeverity())}));
      }
    }
    p.println(TITLE_DESCRIPTOR + LISTEND);

    increaseProgress();
View Full Code Here

      for (int mess = 0;mess < messageCount5;mess++) {
        String[] messageLine = tio.getInStrings(r.readLine());
        if (messageLine.length != 4)
          throw new UnsupportedOperationException("Error parsing message line: " + messageLine); //$NON-NLS-1$
        MessageType mt = new MessageType(messageLine[0],messageLine[1]);
        ProbeMakerPropertyUtils.addMessage(tss5,new Message(messageLine[2],mt,Byte.parseByte(messageLine[3])));
      }

      //UITexts for 3' TSS
      for (int mess = 0;mess < messageCount3;mess++) {
        String[] messageLine = tio.getInStrings(r.readLine());
        if (messageLine.length != 4)
          throw new UnsupportedOperationException("Error parsing message line: " + messageLine); //$NON-NLS-1$
        MessageType mt = new MessageType(messageLine[0],messageLine[1]);
        ProbeMakerPropertyUtils.addMessage(tss3,new Message(messageLine[2],mt,Byte.parseByte(messageLine[3])));
      }

      //UITexts for TSS Pair
      for (int mess = 0;mess < messageCountTSS;mess++) {
        String[] messageLine = tio.getInStrings(r.readLine());
        if (messageLine.length != 4)
          throw new UnsupportedOperationException("Error parsing message line: " + messageLine); //$NON-NLS-1$
        MessageType mt = new MessageType(messageLine[0],messageLine[1]);
        ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(messageLine[2],mt,Byte.parseByte(messageLine[3])));
      }

      //UITexts for Probe
      for (int mess = 0;mess < messageCountProbe;mess++) {
        String[] messageLine = tio.getInStrings(r.readLine());
        if (messageLine.length != 4)
          throw new UnsupportedOperationException("Error parsing message line: " + messageLine); //$NON-NLS-1$
        MessageType mt = new MessageType(messageLine[0],messageLine[1]);
        ProbeMakerPropertyUtils.addMessage(p,new Message(messageLine[2],mt,Byte.parseByte(messageLine[3])));
      }

      proj.getProbes().addSequence(p);
    }
View Full Code Here

  public void testTargetSpecificSequence() {
    PropertyAcceptorNucleotideSequence tss = ProbeMakerSequenceFactory.createTSS(seq,target.getID());

    ProbeMakerPropertyUtils.setHybridizationTemp(tss, 10f);
    ProbeMakerPropertyUtils.addMessage(tss, new Message("Test",new MessageType("test_type","Test type"),Message.ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    assertTrue("Incorrect target ID", target.getID().equals(DesignUtils.getTargetID(tss))); //$NON-NLS-1$
    assertTrue("Incorrect temp", 10f == ProbeMakerPropertyUtils.getHybridizationTemp(tss)); //$NON-NLS-1$
    assertTrue("Incorrect message count", 1 == ProbeMakerPropertyUtils.getAllMessages(tss).size()); //$NON-NLS-1$
View Full Code Here

  }

  public void testTSSPair() {
    PropertyAcceptorNucleotideSequence tss5 = ProbeMakerSequenceFactory.createTSS(seq,target.getID());   
    ProbeMakerPropertyUtils.addMessage(tss5, new Message("Test",new MessageType("test_type","Test type"),Message.ERROR));     //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    TSSPair pair = new TSSPair(tss5,null,target);
    ProbeMakerPropertyUtils.setRank(pair, ProbeMakerConstants.BAD_QUALITY);

    assertTrue("Incorrect rank", ProbeMakerConstants.BAD_QUALITY == ProbeMakerPropertyUtils.getRank(pair)); //$NON-NLS-1$
    assertTrue("Incorrect target ID", target.getID().equals(DesignUtils.getTargetID(pair))); //$NON-NLS-1$
    assertTrue("Incorrect message count", 1 == ProbeMakerPropertyUtils.getAllMessages(pair).size()); //$NON-NLS-1$

    ProbeMakerPropertyUtils.addMessage(pair, new Message("Test",new MessageType("test_type","Test type"),Message.ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    assertTrue("Incorrect message count", 2 == ProbeMakerPropertyUtils.getAllMessages(pair).size()); //$NON-NLS-1$

  }
View Full Code Here

  }

  public void testProbe() {
    PropertyAcceptorNucleotideSequence tss5 = ProbeMakerSequenceFactory.createTSS(seq,target.getID());   
    ProbeMakerPropertyUtils.addMessage(tss5, new Message("Test",new MessageType("test_type","Test type"),Message.ERROR));     //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    TSSPair pair = new TSSPair(tss5,null,target);
    ProbeMakerPropertyUtils.addMessage(pair, new Message("Test",new MessageType("test_type","Test type"),Message.ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    Probe probe = new DefaultProbe(pair,0,0,NucleotideSequence.DNA);

    ProbeMakerPropertyUtils.setRank(probe, ProbeMakerConstants.BAD_QUALITY);

    assertTrue("Incorrect rank", ProbeMakerConstants.BAD_QUALITY == ProbeMakerPropertyUtils.getRank(probe)); //$NON-NLS-1$

    assertTrue("Incorrect target ID", target.getID().equals(DesignUtils.getTargetID(probe))); //$NON-NLS-1$
    assertTrue("Incorrect target", target.equals(pair.getTarget())); //$NON-NLS-1$
    assertTrue("Incorrect target", target.equals(probe.getTarget())); //$NON-NLS-1$
    assertTrue("Incorrect message count", 2 == ProbeMakerPropertyUtils.getAllMessages(probe).size()); //$NON-NLS-1$
    assertTrue("Wrong tss pair",pair == probe.getTSSPair()); //$NON-NLS-1$

    ProbeMakerPropertyUtils.addMessage(probe, new Message("Test",new MessageType("test_type","Test type"),Message.ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    assertTrue("Incorrect message count", 3 == ProbeMakerPropertyUtils.getAllMessages(probe).size()); //$NON-NLS-1$

  }
View Full Code Here

      }
    }
    else { //TSS pair not accepted
      log.info("TSS pair not accepted"); //$NON-NLS-1$

      ProbeMakerPropertyUtils.addMessage(p,new Message(
          "Skipped probe because of problems with TSS pair"//$NON-NLS-1$
          TAG_ALLOCATION, Message.FATAL));
      htmllog.printLine("TSS pair not accepted - Skipping probe"); //$NON-NLS-1$
      htmllog.printList(ProbeMakerPropertyUtils.getAllMessages(p));
      ProbeMakerPropertyUtils.setRank(p, BAD_QUALITY);
View Full Code Here

  /**Called when all variations of a probe have been tested. Clears the tags of the probe,
   * adds a fatal internal message and calculates the quality*/
  protected void badProbe(Probe p) {
    clear(p);
    ProbeMakerPropertyUtils.addMessage(p,new Message("Tested all variations, none accepted", //$NON-NLS-1$
        TAG_ALLOCATION, Message.FATAL));
    ProbeMakerPropertyUtils.setRank(p, BAD_QUALITY);
  }
View Full Code Here

      byte acceptFirst = analyzer.analyzeTSSPair(groupprobes[0],this,probes);
      byte acceptSecond = analyzer.analyzeTSSPair(groupprobes[1],this,probes);
     
      if (! (acceptFirst == CandidateAcceptor.ACCEPT &&
             acceptSecond == CandidateAcceptor.ACCEPT) ) {
        ProbeMakerPropertyUtils.addMessage(groupprobes[0],new Message(
            "Skipped probe because of problems with TSS pair in group", //$NON-NLS-1$
            TAG_ALLOCATION, Message.FATAL));
        htmllog.printLine("Problem with TSS pair in group - Skipping probe"); //$NON-NLS-1$
        htmllog.printList(ProbeMakerPropertyUtils.getAllMessages(groupprobes[0]));
        ProbeMakerPropertyUtils.addMessage(groupprobes[1],new Message(
            "Skipped probe because of problems with TSS pair in group", //$NON-NLS-1$
            TAG_ALLOCATION, Message.FATAL));
        htmllog.printLine("Problem with TSS pair in group - Skipping probe"); //$NON-NLS-1$
        htmllog.printList(ProbeMakerPropertyUtils.getAllMessages(groupprobes[1]));
     
View Full Code Here

TOP

Related Classes of org.moltools.apps.probemaker.messages.Message

Copyright © 2018 www.massapicom. 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.