Package org.moltools.lib.struct

Examples of org.moltools.lib.struct.DefaultNAHybridStructure


            if (temp != null) {
              int secstart = t.getFivePrimeFixedEnd() == TemplateHandler.THREEPRIME ? 1 :
                temp.length() - five.length() + 1;
              int secend = t.getFivePrimeFixedEnd() == TemplateHandler.THREEPRIME ? five.length() :
                temp.length();
              NAHybridStructure st = new DefaultNAHybridStructure(five, 1, five.length(),
                  temp,
                  secstart, secend);
              Tm = calculateTm(five, temp, st, defaultMpc, backupMpc);
              ProbeMakerPropertyUtils.setHybridizationTemp(five,Tm);
            }
          }
          else {
            Tm = calculateFullMatchTm(five, defaultMpc, backupMpc);
            ProbeMakerPropertyUtils.setHybridizationTemp(five,Tm);
          }
        }

      }

    }
    catch (ClusterException e) {
//      Do nothing
    }


    try {
      PropertyAcceptorNucleotideSequence three = (PropertyAcceptorNucleotideSequence) p.getSequence(TSSPair.KEY_THREE_PRIME);
      if (three != null) {
        ProbeMakerPropertyUtils.clearMessages(three);
        //Set up the structure for the MPC, 3'
        float Tm;
        if (three.length() > 0) {
          if (t != null) {
            NucleotideSequence temp = p.getTarget().getTemplateCluster().getSequence(ProbeMakerTarget.KEY_THREE_PRIME);
            if (temp != null) {
              int secstart = t.getThreePrimeFixedEnd() == TemplateHandler.THREEPRIME ? 1 :
                temp.length() - three.length() + 1;
              int secend = t.getThreePrimeFixedEnd() == TemplateHandler.THREEPRIME ? three.length() :
                temp.length();
              NAHybridStructure st = new DefaultNAHybridStructure(three, 1, three.length(),
                  temp, secstart,
                  secend);
              Tm = calculateTm(three, temp, st, defaultMpc, backupMpc);
              ProbeMakerPropertyUtils.setHybridizationTemp(three,Tm);
            }
View Full Code Here


  public NAHybridStructure calculateStructure(String seq1, String seq2, byte type1, byte type2) {
    lac.doAlignment(seq1, SequenceHandler.getRev(seq2));
    Alignment la = lac.getNextAlignment();
    if (la == null) return null;
    NAHybridStructure s = new DefaultNAHybridStructure(la, seq2.length());
    return s;
  }
View Full Code Here

          //Set up the structure for the MPC
          int secstart = fixedEnd == TemplateHandler.THREEPRIME ? 1 :
            temp.length() - pa.length() + 1;
          int secend = fixedEnd == TemplateHandler.THREEPRIME ? pa.length() :
            temp.length();
          NAHybridStructure st = new DefaultNAHybridStructure(pa, 1, pa.length(),
              temp, secstart,
              secend);
          //calculate the Tm of the probe Arm to the template
          oldTm = Tm;

          Tm = Analyzer.calculateTm(pa,temp,st,defaultMpc,backupMpc);         
          //Tm = defaultMpc.getMeltingPoint(pa);         

          //If minimum length reached, stop and check if further away than last length
          if (pa.length() <= minlength) {
            done = true;
            //if further from temp than last, restore the old seq.
            if (oldTm > 0 && Math.abs(Tm - preftemp) > Math.abs(oldTm - preftemp)) {
              try {
                cns.setSequence(oldseq);
              }
              catch (SequenceFormatException e) {
                throw new UnsupportedOperationException("Invalid sequence"); //$NON-NLS-1$
              }
            }
            break;
          }
          //If below temp limit, back up one step
          if (Tm <= preftemp) {
            done = true;
            if (oldTm > 0 && Math.abs(Tm - preftemp) > Math.abs(oldTm - preftemp)) {
              try {
                cns.setSequence(oldseq);
              }
              catch (SequenceFormatException e) {
                throw new UnsupportedOperationException("Invalid sequence"); //$NON-NLS-1$
              }
            }
            break;
          }
          //Here we cut of the sequence at the appropriate end and do all again
          oldseq = pa.seqString(); //but first store the old sequence
          //remove nucleotides form the non-fixed end of the arm
          switch (fixedEnd) {
            case TemplateHandler.THREEPRIME:
              try {
                cns.edit(new SimpleSequenceEdit(1, 1, "")); //$NON-NLS-1$
              }
              catch (SequenceFormatException e) {
                throw new UnsupportedOperationException("Invalid sequence"); //$NON-NLS-1$
              }

              break;
            case TemplateHandler.FIVEPRIME:
              try {
                cns.edit(new SimpleSequenceEdit(pa.length(), 1, "")); //$NON-NLS-1$
              }
              catch (SequenceFormatException e) {
                throw new UnsupportedOperationException("Invalid sequence"); //$NON-NLS-1$
              }

              break;
          }
        }
      }

      //Recalculate tm, in case we backed the sequence up.
      //Set up the structure for the MPC
      int secstart = fixedEnd == TemplateHandler.FIVEPRIME ?
          temp.length() - pa.length() + 1 : 1;
          int secend = fixedEnd == TemplateHandler.FIVEPRIME ?
              temp.length() : pa.length();
              NAHybridStructure st = new DefaultNAHybridStructure(pa, 1, pa.length(),
                  temp, secstart, secend);

              ProbeMakerPropertyUtils.clearMessages(pa);
              float Tm = Analyzer.calculateTm(pa,temp,st,defaultMpc,backupMpc);     
              //Set the temperature
View Full Code Here

            if (temp != null) {
              int secstart = t.getFivePrimeFixedEnd() == TemplateHandler.THREEPRIME ? 1 :
                temp.length() - five.length() + 1;
              int secend = t.getFivePrimeFixedEnd() == TemplateHandler.THREEPRIME ? five.length() :
                temp.length();
              NAHybridStructure st = new DefaultNAHybridStructure(five, 1, five.length(),
                  temp,
                  secstart, secend);
              Tm = calculateTm(five, temp, st, defaultMpc, backupMpc);
              ProbeMakerPropertyUtils.setHybridizationTemp(five,Tm);
            }
          }
          else {
            Tm = calculateFullMatchTm(five, defaultMpc, backupMpc);
            ProbeMakerPropertyUtils.setHybridizationTemp(five,Tm);
          }
        }

      }

    }
    catch (ClusterException e) {
//      Do nothing
    }


    try {
      PropertyAcceptorNucleotideSequence three = (PropertyAcceptorNucleotideSequence) p.getSequence(TSSPair.KEY_THREE_PRIME);
      if (three != null) {
        ProbeMakerPropertyUtils.clearMessages(three);
        //Set up the structure for the MPC, 3'
        float Tm;
        if (three.length() > 0) {
          if (t != null) {
            NucleotideSequence temp = p.getTarget().getTemplateCluster().getSequence(ProbeMakerTarget.KEY_THREE_PRIME);
            if (temp != null) {
              int secstart = t.getThreePrimeFixedEnd() == TemplateHandler.THREEPRIME ? 1 :
                temp.length() - three.length() + 1;
              int secend = t.getThreePrimeFixedEnd() == TemplateHandler.THREEPRIME ? three.length() :
                temp.length();
              NAHybridStructure st = new DefaultNAHybridStructure(three, 1, three.length(),
                  temp, secstart,
                  secend);
              Tm = calculateTm(three, temp, st, defaultMpc, backupMpc);
              ProbeMakerPropertyUtils.setHybridizationTemp(three,Tm);
            }
View Full Code Here

TOP

Related Classes of org.moltools.lib.struct.DefaultNAHybridStructure

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.