Package org.moltools.lib.seq

Examples of org.moltools.lib.seq.NucleotideSequence


        if (p.getTags().size() > spacerPosition) {
          //We have to replace the tag with a copy, otherwise the next probe will adjust the same spacer
          //first remove the old spacer
          p.removeTagAt(spacerPosition);
          int spacerLength = Math.max(0, prefLength - p.length());
          NucleotideSequence spacer;
          if (spacerString.length() > 0) {
            String temp = ""; //$NON-NLS-1$
            //Add a new nucleotide until the correct length is achieved
            for (int i = 0; i < spacerLength; i++) {
              temp += spacerString.charAt(i % spacerString.length());
View Full Code Here


  protected void reserve(Probe p) {
    //Target target = p.getTarget();
    p.setTagsAllocated(true);
    //Iterate through the tag positions
    for (int tagpos = 0; tagpos < p.getTags().size(); tagpos++) {
      NucleotideSequence tag = p.getTagAt(tagpos);
      //Set each tag to used
      tagAllocationTable.use(tag,p,tagpos);  
    }
  }
View Full Code Here

  /**Clears this probe candidate by removing any messages and tags.*/
  protected void clear(Probe p) {
    ProbeMakerPropertyUtils.clearMessages(p);

    for (int i = 0; i < p.getTags().size(); i++) {
      NucleotideSequence t = p.getTagAt(i);
      //This target is no longer associated with this tag
      tagAllocationTable.unuse(t,p);
    }
    p.removeAllTags();
    p.setTagsAllocated(false);
View Full Code Here

        }
      }
    }
   
    //Check the 3' TSS of this probe against all targets
    NucleotideSequence primer;
    try {
      primer = p.getTSSPair().getSequence(TSSPair.KEY_THREE_PRIME);
    }
    catch (ClusterException e) {
      primer = null;
    }

    //Debug
    log.debug("Checking probe " + p.getName()); //$NON-NLS-1$
   
    if (tests[0].perform() && primer != null) {
      Group<?> thisGroup = DesignUtils.getGroupWithType((PropertyHolder) p.getTarget(), TargetGroup.GROUP_TYPE);
      for (Iterator<ProbeMakerTarget> ti = targetList.iterator();ti.hasNext();) {
        ProbeMakerTarget t = ti.next();
        Group<?> otherGroup = DesignUtils.getGroupWithType(t, TargetGroup.GROUP_TYPE);
        int[] results = getPrimingPositions(primer,t);
        if (results != null) {
          for (int i = 0; i < results.length; i++) {
            boolean err = true;
            //Special treatment if targets of same group (only valid for minisequencing targets)
                                   
            if (otherGroup != null && thisGroup == otherGroup && t instanceof MinisequencingTarget)
              if (results[i] == ((MinisequencingTarget) t).getTargetPosition())
                err = false;
             
            if (err) {
              ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(
                  "May prime on " + t.getID() + " (pos. " + results[i] + ", Tm = " + Math.round((tms.get(i)).floatValue()) + ").", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                  FALSE_PRIME_ON_TARGET,
                  Message.ERROR));
              log.debug(p.getName() + "/" + t.getID() + ": " + results[i] + ", " + Math.round((tms.get(i)).floatValue()) + " �C"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
            }
          }
        }
      }
    }
    if (tests[1].perform()) {
      for (Iterator<NucleotideSequence> pi = primerList.iterator();pi.hasNext();) {
        NucleotideSequence other = pi.next();           
        int[] results = getPrimingPositions(primer,other);
        if (results != null) {
          for (int i = 0; i < results.length; i++) {
            ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(
                "May prime on " + other.getID() + " (pos. " + results[i] + ", Tm = " + Math.round((tms.get(i)).floatValue()) + ").", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                FALSE_PRIME_ON_PRIMER,
                Message.ERROR));
            log.debug(p.getName() + "/" + other.getID() + ": " + results[i] + ", " + Math.round((tms.get(i)).floatValue()) + " �C"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
          }
        }
      }       
    }
  }
View Full Code Here

      //Get all sequences to match the primer to
      String[] sequences = NucleotideSequenceHandler.getPossibleSequences(sequence.substring(index,Math.min(index + primer.length(),sequence.length()-1)),target.getType());
     
      float maxTm = -Float.MAX_VALUE;
      NAHybridStructure top = null;
      NucleotideSequence s1 = new SimpleNucleotideSequence(primer.getID(),primer.seqString(),primer.getType());
      //int tops = -1;
      for (int s = 0;s<sequences.length;s++) {
             
        NucleotideSequence s2 = new SimpleNucleotideSequence("S2",sequences[s],target.getType());              //$NON-NLS-1$

        log.debug(s + ":  " + s1.seqString()); //$NON-NLS-1$
        log.debug("    " + SequenceHandler.getRev(s2)); //$NON-NLS-1$
       
        NAHybridStructure hs = fmpc.calculateHybridStructure(s1,s2);       
View Full Code Here

  public boolean isUsable(int tagpos, int tagno, Group<?> group) {   
    boolean usable = false;
    TagLibrary lib = taglibraries[tagpos];
    Collection<String> usedTagIDs = usedLists[tagpos];
    byte mode = lib.getMode();
    NucleotideSequence tag = lib.getSequenceAt(tagno);
    switch (mode) {
      case TagLibrary.USE_ANY_TAG:
        //All tags are usable
        usable = true;
        break;
      case TagLibrary.USE_SAME_TAG:
        //Only the first tag in usedTags is usable, or any if not set
        if (usedTagIDs.isEmpty()) {
          usable = true;
        }
        else {
          usable = usedTagIDs.contains(tag.getID());
          if (usedTagIDs.size()>1) throw new IllegalStateException("Cannot have two ids in same mode"); //$NON-NLS-1$
        }
        break;
      case TagLibrary.USE_UNIQUE_TAG:
        //Usable if not already used
        usable = !isUsed(tag);
        break;
      case TagLibrary.USE_PER_GROUP:
        //If group tag set, only that one usable, else any unused is usable
        //If no group, all unused usable
        if (group == null) {
          usable = !isUsed(tag);
          //If set, only group tag usable
        }
        else {
          String tagID = getGroupTagID(group);       
          if (tagID != null) {
            usable = (tagID.equals(tag.getID()));
          }
          else {
            //If group tag not set, all unused usable
            usable = !isUsed(tag);
          }
View Full Code Here

      //For all libraries except spacers
      TagLibrary library = libraries[i];
      if (!(library instanceof SpacerLibrary)) {
        //Iterate through each tag...
        for (int tagno = 0; tagno < libraries[i].size(); tagno++) {
          NucleotideSequence t = libraries[i].getSequenceAt(tagno);
          //setStatus(t.getName());
          for (Iterator<CandidateAnalysisModule> m = modules.iterator(); m.hasNext(); ) {
            ProbeAnalysisModule mod = (ProbeAnalysisModule) m.next();
            if (!mod.acceptTag(t, probeset)) {
              //log.printLine(t.getName() + " not accepted by " + PlugInDescriptor.getBriefDescription(mod)); //$NON-NLS-1$
View Full Code Here

        ProbeMakerPropertyUtils.clearMessages(five);
        //Set up the structure for the MPC, 5'
        float Tm;
        if (five.length() > 0) {
          if (t != null) {
            NucleotideSequence temp = p.getTarget().getTemplateCluster().getSequence(ProbeMakerTarget.KEY_FIVE_PRIME);
            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

    setData(KEY_SELECTOR_5_MATCH_LENGTH,new Integer(PROPERTY_SELECTOR_5_MATCH_LENGTH));
    setData(KEY_SELECTOR_3_MATCH_LENGTH,new Integer(PROPERTY_SELECTOR_3_MATCH_LENGTH));   
  }

  public void doAnalysis(Probe p, TagAllocator pd, DefiniteSequenceDB<? extends Probe> probes) {
    NucleotideSequence sel5;
    NucleotideSequence sel3;
    try {
      sel5 = p.getTSSPair().getSequence(TSSPair.KEY_FIVE_PRIME);
    }
    catch (ClusterException e) {
      sel5 = null;
    }
    try {
      sel3 = p.getTSSPair().getSequence(TSSPair.KEY_THREE_PRIME);
    }
    catch (ClusterException e) {
      sel3 = null;
    }

    if (tests[0].perform() && sel5 != null) {
      //Selector 5' end ligates to 5' end of self
      if (isMatch(p, sel5, false, FIVE_PRIME_END)) {
        ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(SELECTOR_SELF_LIGATION_5.getDescription(),
            SELECTOR_SELF_LIGATION_5, Message.WARNING));
      }
    }
    if (tests[1].perform() && sel3 != null) {
      //Selector 3' end ligates to 3' end of self
      if (isMatch(p, sel3, false, THREE_PRIME_END)) {
        ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(SELECTOR_SELF_LIGATION_3.getDescription(),
            SELECTOR_SELF_LIGATION_3, Message.WARNING));
      }
    }
    if (tests[2].perform()) {
      //Selector 5' end ligates to 5' end of target
      Target t = p.getTarget();
      if (t != null) {
        if (t instanceof SelectorTarget) {
          SelectorTarget it = (SelectorTarget) t;
          if (Integer.parseInt(it.getVariant().getName()) > 0) {
            if (isMatch(it, sel5, true, FIVE_PRIME_END)) {
              ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(SELECTOR_TARGET_LIGATION_5.
                  getDescription(),
                  SELECTOR_TARGET_LIGATION_5,
                  Message.WARNING));
            }
          }
        }
        else {
          ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(
              "Could not perform ligation to target test: Incompatible target", //$NON-NLS-1$
              SELECTOR_TARGET_LIGATION_5, Message.ALERT));

        }
      }
      else {
        ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(
            "Could not perform ligation to target test: No target", //$NON-NLS-1$
            SELECTOR_TARGET_LIGATION_5, Message.ALERT));
      }
    }
    for (Iterator<? extends Probe> pi = probes.iterator(); pi.hasNext(); ) {
      Probe other = pi.next();
      NucleotideSequence other5;
      NucleotideSequence other3;
      try {
        other5 = other.getTSSPair().getSequence(TSSPair.KEY_FIVE_PRIME);
      }
      catch (ClusterException e) {
        other5 = null;
View Full Code Here

    super(new ListSequenceDB<NucleotideSequence>(), "Spacers"); //$NON-NLS-1$
    //The mode is set to be SAME so that the library look non-variable although it actually is,
    mode = TagLibrary.USE_SAME_TAG;
    nextIndices = new int[length];
    type = acidType;
    NucleotideSequence proto = new SimpleChangeableNucleotideSequence("Spacer","",NucleotideSequence.DNA); //$NON-NLS-1$ //$NON-NLS-2$

    addSequence(proto);
  }
View Full Code Here

TOP

Related Classes of org.moltools.lib.seq.NucleotideSequence

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.