Package org.moltools.apps.probemaker.messages

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


      throw new UnsupportedOperationException("Invalid sequence"); //$NON-NLS-1$
    }

    //If template is polymorphic
    if (NucleotideSequenceHandler.countPolys(temp) > 0) {
      ProbeMakerPropertyUtils.addMessage(pa,new Message("Could not calculate Tm because of polymorphisms",messagetype,Message.ALERT)); //$NON-NLS-1$
    }
    else {
      //If both ends are fixed, this is the probe arm, so just skip the design
      if (fixedEnd != TemplateHandler.BOTH) {

        //Now cut off one base at a time until we reach either minimum length, or
        //preferred temperature.
        boolean done = false; //are we done yet?
        String oldseq = pa.seqString(); //store old seq here
        float oldTm = 0.0f;
        float Tm = 0.0f; //melting temp

        while (!done) {

          if (pa.length() == 0) {
            ProbeMakerPropertyUtils.addMessage(pa,new Message("Could not calculate Tm because of zero length",messagetype,Message.ALERT)); //$NON-NLS-1$
            return pa;
          }

          //Set up the structure for the MPC
          int secstart = fixedEnd == TemplateHandler.THREEPRIME ? 1 :
View Full Code Here


      for (Iterator<? extends Probe> i = probes.iterator(); i.hasNext(); ) {
        Probe other = i.next();
        //If other is not yet allocated, this will be found when checking other's arms
        if (other != p && other.tagsAllocated()) {
          if (ltc.isLigationTemplate(p, other, true, false) != null) {
            ProbeMakerPropertyUtils.addMessage(other,new Message("May be templated by " + //$NON-NLS-1$
                                         p.getName(),
                                         PadlockLigationCalculator.
                                         OTHER_PROBE_IS_TEMPLATE,
                                         Message.ERROR));
            Analyzer.calculateAndSetQuality(other);
View Full Code Here

   * if not OK*/
  protected void checkHybridizationInterference(Probe p, TagAllocator ta) {   
    ProbeMakerTarget t = (ProbeMakerTarget) p.getTarget();
    if (tests[0].perform()) {
      if (t == null) {
        ProbeMakerPropertyUtils.addMessage(p,new Message(
            "Could not check 5' hybridization: No target found", //$NON-NLS-1$
            FIVE_PRIME_HYBRIDIZATION_INTERFERENCE,
            Message.ALERT));
      }
      else {
        //Check fiveprime part
        PropertyAcceptorNucleotideSequence pa5;
        try {
          pa5 = (PropertyAcceptorNucleotideSequence) p.getTSSPair().getSequence(TSSPair.KEY_FIVE_PRIME);
        }
        catch (ClusterException e) {
          pa5 = null;
        }

        TargettedSubSequence fiveTemplate = null;
        try {
          fiveTemplate = (TargettedSubSequence) t.getTemplateCluster().getSequence(ProbeMakerTarget.KEY_FIVE_PRIME);
        }
        catch (ClusterException e) {
          ProbeMakerPropertyUtils.addMessage(p,new Message(
              "Could not check 5' hybridization: No 5' TSS template found", //$NON-NLS-1$
              FIVE_PRIME_HYBRIDIZATION_INTERFERENCE,
              Message.ALERT));
       
        catch (ClassCastException cx) {
          ProbeMakerPropertyUtils.addMessage(p,new Message(
              "Could not check 5' hybridization: 5' TSS template is not a subsequence", //$NON-NLS-1$
              FIVE_PRIME_HYBRIDIZATION_INTERFERENCE,
              Message.ALERT));       
        }     
        if (pa5 == null) {
          ProbeMakerPropertyUtils.addMessage(p,new Message(
              "Could not check 5' hybridization: No 5' TSS found", //$NON-NLS-1$
              FIVE_PRIME_HYBRIDIZATION_INTERFERENCE,
              Message.ALERT));
        }
        else if (fiveTemplate != null) {
          int targetLength = t.length();
          String tseq = t.seqString();
          int probeLength = p.length();       
          int[] positions = TemplateHandler.subTemplatePositions(fiveTemplate,pa5.length(),t.getFivePrimeFixedEnd());
          int begin = positions[0];
          int end = positions[1];

          String sequencelong = tseq.substring(begin - length - 1 < 0 ? 0 :
            begin - length - 1,
            end + length > targetLength ?
                targetLength : end + length);

          int block = p.getBlockNoOf5();
          int probebegin = p.getStartOfSequence(block);
          int probeend = p.getEndOfSequence(block);
          int pb = probebegin - length < 1 ? 1 : probebegin - length;
          int pe = probeend + length > probeLength ? probeLength :
            probeend + length;
          String plong = p.subsequence(pb, pe);

          //log.info("Checking hyb of " + sequencelong + " to " + plong);

          NAHybridStructure s1 = complementStructCalc.calculateStructure(sequencelong,
              plong,
              t.getType(), p.getType());
          //If hybridization is interfered with, add message and put tag in badtags
          if (s1.getSecondString().length() > pa5.length()) {
            ProbeMakerPropertyUtils.addMessage(p,new Message("Hybridization temp. of 5' arm may be incorrect. Other part of probe may hybridize to the target.", //$NON-NLS-1$
                FIVE_PRIME_HYBRIDIZATION_INTERFERENCE,
                Message.WARNING));
            //Record as bad only if there are tags
            if (p.getTags().size()>0)
              ta.setCurrentTagBad(0);
          }        
        }
      }
    }
    if (tests[1].perform()) {     
      //Check threeprime part
      if (t == null) {
        ProbeMakerPropertyUtils.addMessage(p,new Message(
            "Could not check 3' hybridization: No target found", //$NON-NLS-1$
            THREE_PRIME_HYBRIDIZATION_INTERFERENCE,
            Message.ALERT));
      }
      else {
        PropertyAcceptorNucleotideSequence pa3;   
        try {
          pa3 = (PropertyAcceptorNucleotideSequence) p.getTSSPair().getSequence(TSSPair.KEY_THREE_PRIME);
        }
        catch (ClusterException e) {
          pa3 = null;
        }   
        SimpleSubSequenceTemplate threeTemplate = null;
        try {
          threeTemplate = (SimpleSubSequenceTemplate) t.getTemplateCluster().getSequence(ProbeMakerTarget.KEY_THREE_PRIME);
        }
        catch (ClusterException e) {
          ProbeMakerPropertyUtils.addMessage(p,new Message(
              "Could not check 3' hybridization: No 3' TSS template found", //$NON-NLS-1$
              THREE_PRIME_HYBRIDIZATION_INTERFERENCE,
              Message.ALERT));
       
        catch (ClassCastException cx) {
          ProbeMakerPropertyUtils.addMessage(p,new Message(
              "Could not check 3' hybridization: 3' TSS template is not a subsequence", //$NON-NLS-1$
              THREE_PRIME_HYBRIDIZATION_INTERFERENCE,
              Message.ALERT));       
        }                 
        if (pa3 == null) {
          ProbeMakerPropertyUtils.addMessage(p,new Message(
              "Could not check 3' hybridization: No 3' TSS found", //$NON-NLS-1$
              THREE_PRIME_HYBRIDIZATION_INTERFERENCE,
              Message.ALERT));
        }
        else if (threeTemplate != null) {
          int targetLength = t.length();
          String tseq = t.seqString();      
          int[] positions = TemplateHandler.subTemplatePositions(threeTemplate,pa3.length(),t.getThreePrimeFixedEnd());

          int begin = positions[0];
          int end = positions[1];

          String sequencelong = tseq.substring(begin - length - 1 < 0 ? 0 :
            begin - length - 1,
            end + length > targetLength ?
                targetLength : end + length);

          int block = p.getBlockNoOf3();
          int probebegin = p.getStartOfSequence(block);
          int probeend = p.getEndOfSequence(block);
          String plong = p.subsequence(probebegin - length < 1 ? 1 :
            probebegin - length,
            probeend + length > p.length() ?
                p.length() : end + length);

          //log.info("Checking hyb of " + sequencelong + " to " + plong);

          NAHybridStructure s1 = complementStructCalc.calculateStructure(sequencelong,
              plong,
              t.getType(), p.getType());
          //Structure s2 = complementStructCalc.getStructure(sequence, pa3.getSequence(), t.getType(), pa3.getType(), true, false);
          if (s1.getSecondString().length() > pa3.length()) {
//            if (s1.getLength() > s2.getLength()) {
            ProbeMakerPropertyUtils.addMessage(p,new Message("Hybridization temp. of 3' arm may be incorrect. Other part of probe may hybridize to the target.", //$NON-NLS-1$
                THREE_PRIME_HYBRIDIZATION_INTERFERENCE,
                Message.WARNING));
            //Record as bad if adjacent sequence is a tag
            int pos = p.getTags().size()-1;
            if (pos >= 0)
View Full Code Here

              tag.getType(), p.getType(), true);
          //Go through each of the occurrences
          for (int occ = 0; occ < occurrences.length; occ++) {           
            int pos = occurrences[occ].intValue() + 1;
            if (pos != blockStart) {
              ProbeMakerPropertyUtils.addMessage(p,new Message(tag.getID() +
                  " found elsewhere in probe (position " + //$NON-NLS-1$
                  (pos) + ")", //$NON-NLS-1$
                  TAG_ELSEWHERE_INTERNAL,
                  Message.ERROR));
            }
          }
        }
        //search for the tag sequence complement in the probe
        if (!allowsComp) {
          occurrences = tsc.getOccurrences(NucleotideSequenceHandler.getRevComp(
              tag, p.getType()), p.seqString(), tag.getType(),
              p.getType(), true);
          for (int occ = 0; occ < occurrences.length; occ++) {
            int pos = occurrences[occ].intValue() + 1;
            if (pos != blockStart) {
              ProbeMakerPropertyUtils.addMessage(p,new Message("Complement of " + //$NON-NLS-1$
                  tag.getID() + " found (position " + //$NON-NLS-1$
                  (pos) + ")", //$NON-NLS-1$
                  TAG_COMPLEMENT_INTERNAL,
                  Message.ERROR));
            }
View Full Code Here

          }
         
          //If we're supposed to add a warning, do so now
          if (add) {
            foundTIO = true;
            ProbeMakerPropertyUtils.addMessage(thisProbe,new Message(tag.getID() +
                " found in " + otherProbe.getName(), //$NON-NLS-1$
                TAG_ELSEWHERE_EXTERNAL,
                Message.ERROR));
          }
        }
      }
      //Check the complement too
      /**Complement*/
      if (checkComplement) {
        occurrences = tsc1.getOccurrences(NucleotideSequenceHandler.getRevComp(
            tag, otherProbe.getType()), otherSeq, tag.getType(),
            otherProbe.getType(), true);
        //Check each occurrence
        for (int occ = 0; occ < occurrences.length; occ++) {
          foundTIO = true;
          ProbeMakerPropertyUtils.addMessage(thisProbe,new Message("Complement of " + //$NON-NLS-1$
              tag.getID() +
              " found in " + otherProbe.getName(), //$NON-NLS-1$
              TAG_COMPLEMENT_EXTERNAL,
              Message.ERROR));
        }
      }
    }
   
    /**Other probe's tag*/
    //Check number of tag libraries in other probe
    if (otherProbe.getTags().size() > tagpos) {
      //Get the tag from the other probe
      tag = otherProbe.getTagAt(tagpos);
      tagseq = tag.seqString();
      //Check that tag sequence is longer than 0
      if (tagseq.length() > 0) {
        /**Tag*/
        if (checkSequence) {
          //search for the tag sequence in this probe
          occurrences = tsc1.getOccurrences(tagseq, thisSeq, tag.getType(),
              otherProbe.getType(), true);
        }
        else {
          occurrences = new Integer[0];
        }
        //Check each occurrence
        for (int occ = 0; occ < occurrences.length; occ++) {
          int pos = occurrences[occ].intValue() + 1;
          int blockStart = thisProbe.getStartOfSequence(otherProbe.getBlockNoOfTag(
              tagpos));
          boolean add;
         
          switch (mode) {
            case TagLibrary.USE_SAME_TAG:
            case TagLibrary.USE_ANY_TAG:
             
              //Add only if present in other position
              add = (pos != blockStart);
              break;
            case TagLibrary.USE_UNIQUE_IN_GROUP:
             
              //Add if present in other position or if targets in same group
              add = (pos != blockStart) || sameGroup;
              break;
            case TagLibrary.USE_PER_GROUP:
             
              //Add if present in other position or target is in different group
              add = (pos != blockStart) || !sameGroup;
              break;
            default:
             
              //Always add
              add = true;
          }
          //if we're supposed to add a warning, do so now
          if (add) {
            foundOIT = true;
            ProbeMakerPropertyUtils.addMessage(thisProbe,new Message(tag.getID() +
                " from " + //$NON-NLS-1$
                otherProbe.getName() +
                " found (position " + //$NON-NLS-1$
                pos + ")", //$NON-NLS-1$
                OTHER_TAG_PRESENT, Message.ERROR));
          }
        }
        /**Complement*/
        if (checkComplement) {
          if (otherProbe.getTags().size() > tagpos) {
            //Get the tag from the other probe
            tag = otherProbe.getTagAt(tagpos);
            tagseq = tag.seqString();
            //Search for the tag sequence in this probe
            occurrences = tsc1.getOccurrences(NucleotideSequenceHandler.
                getRevComp(tag,
                    thisProbe.getType()), thisSeq, tag.getType(),
                    otherProbe.getType(), true);
          }
          else {
            occurrences = new Integer[0];
          }
          //Check each occurrence
          for (int occ = 0; occ < occurrences.length; occ++) {
            foundOIT = true;
            ProbeMakerPropertyUtils.addMessage(thisProbe,new Message("Complement of " + //$NON-NLS-1$
                tag.getID() +
                " from " + //$NON-NLS-1$
                otherProbe.getName() +
                " found (position " + //$NON-NLS-1$
                occurrences[occ] + ")", //$NON-NLS-1$
View Full Code Here

      for (Iterator<? extends Probe> i = probes.iterator(); i.hasNext(); ) {
        Probe other = i.next();
        //If other is not yet allocated, this will be found when checking other's arms
        if (other != p && other.tagsAllocated()) {
          if (ltc.isLigationTemplate(p, other, true, false) != null) {
            ProbeMakerPropertyUtils.addMessage(other,new Message("May be templated by " + //$NON-NLS-1$
                p.getName(),
                PadlockLigationCalculator.
                OTHER_PROBE_IS_TEMPLATE,
                Message.ERROR));
            Analyzer.calculateAndSetQuality(other);
View Full Code Here

        //log.debug(System.out.println("Comparing " + other.getID() + " with " + p.getID()));
        //Don't do anything if other is same as probe being analysed
        if (!other.equals(p) && other.tagsAllocated()) {
          byte dimer = compare(p,other);
          if (dimer == HI_RISK)
            ProbeMakerPropertyUtils.addMessage(p,new Message("High risk of hetero-dimer formation with " + other.getName(), //$NON-NLS-1$
                PROBE_DIMER_FORMATION, Message.ERROR));
          else if (dimer == RISK)
            ProbeMakerPropertyUtils.addMessage(p,new Message("Risk of hetero-dimer formation with " + other.getName(), //$NON-NLS-1$
                 PROBE_DIMER_FORMATION, Message.WARNING));

        }
      }     
    }
    if (tests[1].perform()) {
      byte dimer = compare(p,p);
      if (dimer == HI_RISK)
        ProbeMakerPropertyUtils.addMessage(p,new Message("High risk of homo-dimer formation", //$NON-NLS-1$
            PROBE_DIMER_FORMATION, Message.ERROR));
      else if (dimer == RISK)
        ProbeMakerPropertyUtils.addMessage(p,new Message("Risk of homo-dimer formation", //$NON-NLS-1$
            PROBE_DIMER_FORMATION, Message.WARNING));                
    }   
  }
View Full Code Here

      for (Iterator<? extends Probe> i = otherProbes.iterator(); i.hasNext(); ) {
        Probe other = i.next();
        if (!other.equals(p) && other.tagsAllocated()) {
          byte dimer = compare(p,other);
          if (dimer == HI_RISK)
            ProbeMakerPropertyUtils.addMessage(other,new Message("High risk of hetero-dimer formation with " + p.getName(), //$NON-NLS-1$
                PROBE_DIMER_FORMATION, Message.ERROR));
          else if (dimer == RISK)
            ProbeMakerPropertyUtils.addMessage(other,new Message("Risk of hetero-dimer formation with " + p.getName(), //$NON-NLS-1$
                 PROBE_DIMER_FORMATION, Message.WARNING));
          Analyzer.calculateAndSetQuality(other);         
        }
      }
    } 
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));
      designlog.printLine("TSS pair not accepted - Skipping probe"); //$NON-NLS-1$
      designlog.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

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.