Examples of NucleotideSequence


Examples of org.moltools.lib.seq.NucleotideSequence

    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

Examples of org.moltools.lib.seq.NucleotideSequence

    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

Examples of org.moltools.lib.seq.NucleotideSequence

  }

  @Override
  public Object getValueAt(int parm1, int parm2) {
    try {
      NucleotideSequence t = (NucleotideSequence) getSequenceAt(parm1);
      switch (parm2) {
        case 0:
          return t.getID();
        case 1:
          return t.seqString();
        case 2:
          List<String> c = new ArrayList<String>(tagAllocationTable.getUserIDs(t));
          if (c == null) {
            return Collections.EMPTY_LIST;
          }
View Full Code Here

Examples of org.moltools.lib.seq.NucleotideSequence

    if (_library != null) {
      ChangeableSequenceDB<NucleotideSequence> templib = new ListSequenceDB<NucleotideSequence>(_library);
      _library.clear();
      Iterator<NucleotideSequence> i = templib.iterator();
      while (i.hasNext()) {
        NucleotideSequence t = i.next();
        _library.addSequence(t);
      }
    }
    super.setLibrary(_library);
  }
View Full Code Here

Examples of org.moltools.lib.seq.NucleotideSequence

    /**** 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 {
View Full Code Here

Examples of org.moltools.lib.seq.NucleotideSequence

  /**Checks whether the arms of this probe may template ligation of the probe.
   * The arms are linked at the ligation site, open at the linker ends.*/
  public boolean checkTemplatingByArms(Probe p) {
    boolean found = false;
    //Check self-templating
    NucleotideSequence fp;
    try {
      fp = p.getTSSPair().getSequence(TSSPair.KEY_FIVE_PRIME);
    }
    catch (ClusterException e) {
      fp = null;
    }
    NucleotideSequence tp;
    try {
      tp = p.getTSSPair().getSequence(TSSPair.KEY_THREE_PRIME);
    }
    catch (ClusterException e) {
      tp = null;
    }
   
    if (tp == null || fp == null) throw new UnsupportedOperationException("Can't perform ligation calculations with missing TSSs"); //$NON-NLS-1$
   
    int[] results = isLigationTemplate(
        new SimpleChangeableNucleotideSequence(
            "TSS|"+p.getName(), //$NON-NLS-1$
            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(
View Full Code Here

Examples of org.moltools.lib.seq.NucleotideSequence

    for (Iterator<? extends Probe> pi = probes.iterator(); pi.hasNext(); ) {
      Probe other = pi.next();
      //Check for templating and add messages accordingly
      if (other != p) {
        //Does the arms of this probe template other probe?
        NucleotideSequence fp;
        try {
          fp = p.getTSSPair().getSequence(TSSPair.KEY_FIVE_PRIME);
        }
        catch (ClusterException e) {
          fp = null;
        }
        NucleotideSequence tp;
        try {
          tp = p.getTSSPair().getSequence(TSSPair.KEY_THREE_PRIME);
        }
        catch (ClusterException e) {
          tp = null;
        }
       
        if (tp == null || fp == null) throw new UnsupportedOperationException("Can't perform ligation calculations with missing TSSs"); //$NON-NLS-1$
       
        if (isLigationTemplate(new SimpleNucleotideSequence(tp.
            seqString() + fp.seqString(),
            "Arms of " + p.getName(), //$NON-NLS-1$
            p.getType()), other, false, false) != null) {
          ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message("May act as template for " + //$NON-NLS-1$
              other.getName(),
View Full Code Here

Examples of org.moltools.lib.seq.NucleotideSequence

    if (spacerPosition > -1 && spacerString.length() == 0 &&
        p.getTags().size() > 0) {
      //Spacer used and not first call
      //Shouldn't bother with this if the combination of the other tags is invalid
      if (tagSelector.isValidCombination(tagSelector.getTagIndices(), p)) {
        NucleotideSequence spacer = ( (SpacerLibrary) taglibraries[spacerPosition]).getNext();
        if (spacer != null) {
          p.removeTagAt(spacerPosition);
          p.addTagAt(spacer, spacerPosition);
          return true;
        }
View Full Code Here

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

Examples of org.moltools.lib.seq.NucleotideSequence

  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
TOP
Copyright © 2018 www.massapi.com. 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.