Package org.moltools.apps.probemaker.messages

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


    "Temperature calculation"); //$NON-NLS-1$
    ProbeMakerTarget t = null;
    try {
      t = (ProbeMakerTarget) p.getTarget();     
      if (p.getTarget() == null) {
        ProbeMakerPropertyUtils.addMessage(p,new Message(
            "No target found. Calculated hybridization temperature based on full match", //$NON-NLS-1$
            mt, Message.ALERT));
      }           
    }
    catch (ClassCastException ccx) {     
      ProbeMakerPropertyUtils.addMessage(p,new Message(
          "Not a ProbeMakerTarget. Calculated hybridization temperature based on full match", //$NON-NLS-1$
          mt, Message.ALERT));
    }

    try {
View Full Code Here


      Tm = defaultMpc.getMeltingPoint(tss, temp, st);
    }
    catch (UnsupportedHybridStructureException ex1) {
      try {
        Tm = backupMpc.getMeltingPoint(tss, temp, st);
        ProbeMakerPropertyUtils.addMessage(tss,new Message("Approximate temp. calculation used", MESSAGE_TYPE_TEMP_CALC, Message.ALERT)); //$NON-NLS-1$
      }
      catch (UnsupportedHybridStructureException ex2) {
        throw new UnsupportedOperationException(
            "Could not calculate Tm for " + //$NON-NLS-1$
            tss.getID() + "-" + temp.getID());//$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));
      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

    //If the two lengths added is greater than the length of the probe,
    //the longest of the two (or 3' if equal) is reduced to the maximum possible
    //value (or 0) and an alert is added.
    int probeLength = p.length();
    if (min5Length + min3Length > probeLength) {
      ProbeMakerPropertyUtils.addMessage(p,new Message(
          "Templating not properly calculated because minimum lengths are too great", //$NON-NLS-1$
          PROBE_IS_SELF_TEMPLATE, Message.ALERT));
      while (min5Length + min3Length > probeLength) {
        if (min5Length > min3Length) {
          min5Length = probeLength - min3Length > 0 ?
              probeLength - min3Length : 1;
        }
        else {
          min3Length = probeLength - min5Length > 0 ?
              probeLength - min5Length : 1;
        }
      }
    }

    /**** Searches are performed as string searches, and thus use string index system.  ******/
    //For a sequence to be a template for a padlock probe, it is
    //necessary for the sequence to be similar to the intended template, and
    //in particular, the sequence near the probes ends must be identical
    try {
      NucleotideSequence tss5 = p.getTSSPair().getSequence(TSSPair.KEY_FIVE_PRIME);
      NucleotideSequence tss3 = p.getTSSPair().getSequence(TSSPair.KEY_THREE_PRIME);

      //    The sequence of the probe arms (full arms)
      String tssSeq = tss3.seqString() + tss5.seqString();
      NucleotideSequence fullTSS = new SimpleNucleotideSequence("TSS",tssSeq,p.getType()); //$NON-NLS-1$


      //Get the sequence to search for in other probes  
      String threeseq = p.subsequence(p.length() - min3Length + 1, p.length());
      String fiveseq = p.subsequence(1, min5Length);
      String query = NucleotideSequenceHandler.getRevComp(threeseq + fiveseq, p.getType(),s.getType());
     
      //Length of 5' TSS
      int TSSlen5 = tss5.length();
      //Length of 3' TSS
      int TSSlen3 = tss3.length();

      //Get the string to search in, extend it if it is to be interpreted as circular,
      //and change any Us to Ts to allow correct interpretation       
      String sequence = s.seqString().replace('U', 'T');

      if (circular) {
        sequence += sequence.substring(0, min3Length + min5Length - 1);
      }

      //To store the results in
      Stack<Integer> results = new Stack<Integer>();

      //Search for occurrences of the query in the sequence
      int index = -1;
      while ((index = sequence.indexOf(query, index + 1)) > -1) {    
        //If stipulated, check Tm to be above limit
        if (doTm) {               
          float maxTm = -Float.MAX_VALUE;     

          //Extract a template to check the whole TSS pair against
          int start = Math.max(0,index+min5Length-TSSlen5);
          int end = Math.min(index+min5Length+TSSlen3,sequence.length());

          //Get the template to compare to
          String template = sequence.substring(start,end);
          //Get all possible sequences to match the probe to
          String[] sequences = NucleotideSequenceHandler.getPossibleSequences(template,s.getType());

          for (int sc = 0;sc<sequences.length;sc++) {

            NucleotideSequence s2 = new SimpleNucleotideSequence("S2",sequences[sc],s.getType());                       //$NON-NLS-1$
            NAHybridStructure hs = ((FractionalMeltingPointCalculator) fmpc).calculateHybridStructure(fullTSS,s2);       

            if (hs != null) {
              float Tm;
              try {
                Tm = fmpc.getMeltingPoint(fullTSS,s2,hs);
              }
              catch (UnsupportedHybridStructureException e) {
                Tm = -MeltingPointCalculator.T0;
              }                     
              if (Tm > maxTm) {
                maxTm = Tm;
              }
            }
          } 

          if (maxTm >= limit) {
            results.push(new Integer(index + min5Length));
          }            
        }
        else {
          results.push(new Integer(index + min5Length));       
        }
      }

      //Read results stack and transform to array
      if (results.isEmpty()) {
        return null;
      }
      int[] res = new int[results.size()];
      for (int i = 0; i < res.length; i++) {

        //Add one to convert from string to sequence index system
        res[i] = ( results.pop()).intValue() + 1;
      }

      return res;     

    }
    catch (ClusterException e1) {
      ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message("Padlock ligation analysis could not be performed: " + e1.toString(), //$NON-NLS-1$
          NO_ANALYSIS,Message.ALERT));
      return new int[0];
    }
  }
View Full Code Here

          if (!(t instanceof LigationSiteHolder)) {
            throw new IllegalArgumentException("Padlock Ligation Calculator cannot be used for non-ligation probes");
          }
          //Add 1 to ligation position (5' end) to match return value from isLigationTemplate (3' end) 
          if (results[i] != ((LigationSiteHolder) t).getLigationSite() + 1) {
            ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(
                "May be templated by target in other position (" + results[i] + //$NON-NLS-1$
                ").", //$NON-NLS-1$
                TARGET_IS_TEMPLATE_IN_OTHER_POS, Message.ERROR));
            found = true;
          }
          else {
            correct = true;
          }
        }
      }
      //If none of the positions was the correct one, add an error message
      if (!correct) {
        ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(
            "Target is not ligation template for probe", //$NON-NLS-1$
            TARGET_IS_NOT_TEMPLATE, Message.ERROR));
      }
      found = true;
    }
View Full Code Here

            tp.seqString() + fp.seqString(),
            p.getType()
            ), p, false, false);
    if (results != null) {
      for (int i = 0; i < results.length; i++) {
        ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(
            "Probe TSSs may template itself (position " + //$NON-NLS-1$
                results[i] + ").", //$NON-NLS-1$
                PROBE_IS_SELF_TEMPLATE,
                Message.ERROR));
        found = true;
View Full Code Here

    //Check self-templating
    int[] results = isLigationTemplate(p, p, true, false);

    if (results != null) {
      for (int i = 0; i < results.length; i++) {
        ProbeMakerPropertyUtils.addMessage(p,new Message("Probe may template itself (position " + //$NON-NLS-1$
            results[i] + ").", //$NON-NLS-1$
            PROBE_IS_SELF_TEMPLATE,
            Message.ERROR));
        found = true;
      }
View Full Code Here

      if (other != p) {
        //Does other probe template this probe
        if (other.tagsAllocated()) {
          //Tags allocated, test as circle
          if (isLigationTemplate(other, p, true, false) != null) {
            ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message("May be templated by " + //$NON-NLS-1$
                other.getName(),
                OTHER_PROBE_IS_TEMPLATE,
                Message.ERROR));
            found = true;
          }
        }
        else {
          //Tags not allocated, test arms only (connected in ligation point)
          try {           
            String seqString = other.getTSSPair().getSequence(TSSPair.KEY_THREE_PRIME).seqString() + other.getTSSPair().getSequence(TSSPair.KEY_FIVE_PRIME).seqString();         
            if (isLigationTemplate(new SimpleNucleotideSequence("Arms of " + other.getName(), seqString, //$NON-NLS-1$
                other.getType()), p, false, false) != null) {
              ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message("May be templated by " + //$NON-NLS-1$
                  other.getName(),
                  OTHER_PROBE_IS_TEMPLATE,
                  Message.ERROR));
              found = true;
            }
View Full Code Here

      //Check for templating and add messages accordingly
      if (other != p) {
        if (other.getTarget() != null) {
          //Does other probe's target template this probe?
          if (isLigationTemplate((NucleotideSequence) other.getTarget(), p, false, true) != null) {
            ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message("May be templated by " + //$NON-NLS-1$
                other.getTarget().getID(),
                OTHER_TARGET_IS_TEMPLATE,
                Message.ERROR));
            found = true;
          }
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.