Examples of NucleotideSequence


Examples of org.moltools.lib.seq.NucleotideSequence

    libE.addContent(new Element(LIB_NAME,ns).addContent(lib.getName()));
    libE.addContent(new Element(LIB_MODE,ns).addContent(String.valueOf(lib.getMode())));

    Element tags = new Element(TAGS,ns);
    for (Iterator<NucleotideSequence> ti = lib.iterator(); ti.hasNext(); ) {
      NucleotideSequence t = ti.next();
      tags.addContent(getTagElement(TAG,t));
    }
    libE.addContent(tags);
    return libE;
  }
View Full Code Here

Examples of org.moltools.lib.seq.NucleotideSequence

  protected NucleotideSequence getTag(Element tagE) {
    String id = tagE.getAttributeValue(ID,ns);
    String typeStr = tagE.getChildText(TYPE,ns);
    String seqStr = tagE.getChildText(SEQUENCE,ns);

    NucleotideSequence seq = new SimpleNucleotideSequence(id,seqStr,Byte.parseByte(typeStr));
    return seq;
  }
View Full Code Here

Examples of org.moltools.lib.seq.NucleotideSequence

        }
        else if (subEs[pos].getName().equals(TAG_ID)) {
          String tagID = subEs[pos].getAttributeValue(ID,ns);
          KeyValue kv = getLibraryTag(tagSettings.getTagLibraries(),tagID);
          if (kv != null) {
            NucleotideSequence tag = (NucleotideSequence) kv.getKey();
            SequenceDB<NucleotideSequence> lib = (SequenceDB<NucleotideSequence>) kv.getValue();
            tags.put(tag,lib);
          }
          else
            throw new IllegalArgumentException("Could not find a tag named: " + tagID); //$NON-NLS-1$
        }
        else if (subEs[pos].getName().equals(TAG)) {
          NucleotideSequence tag = getTag(subEs[pos]);
          tags.put(tag,null);
        }
      }     

      Probe p = new DefaultProbe(tssP,upstream,downstream,type);
      p.setID(id);
      p.setName(probeName);
      ProbeMakerPropertyUtils.setRank(p,rank);
      if (pg!=null)
        DesignUtils.addGroup(p,pg);

      //Go through and add tags
      int pos = 0;
      for (Iterator ti = tags.keySet().iterator();ti.hasNext();pos++) {
        NucleotideSequence t = (NucleotideSequence) ti.next();
        p.addTagAt(t,pos);       
        project.getTagAllocationTable().use(t,p,pos);       
      }
      tags.clear();
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

Examples of org.moltools.lib.seq.NucleotideSequence

  /**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

Examples of org.moltools.lib.seq.NucleotideSequence

  public static String getLongDescription() {
    return "This constructor generates empty target-specific sequences"; //$NON-NLS-1$
  }

  public PropertyAcceptorNucleotideSequence get3PrimeTSS(ProbeMakerTarget target, byte type) {
    NucleotideSequence seq = new SimpleNucleotideSequence("3'","",type); //$NON-NLS-1$ //$NON-NLS-2$
    return ProbeMakerSequenceFactory.createTSS(seq,target.getID());
  }
View Full Code Here

Examples of org.moltools.lib.seq.NucleotideSequence

    NucleotideSequence seq = new SimpleNucleotideSequence("3'","",type); //$NON-NLS-1$ //$NON-NLS-2$
    return ProbeMakerSequenceFactory.createTSS(seq,target.getID());
  }

  public PropertyAcceptorNucleotideSequence get5PrimeTSS(ProbeMakerTarget target, byte type) {
    NucleotideSequence seq = new SimpleNucleotideSequence("5'","",type); //$NON-NLS-1$ //$NON-NLS-2$
    return ProbeMakerSequenceFactory.createTSS(seq,target.getID());
  }
View Full Code Here

Examples of org.moltools.lib.seq.NucleotideSequence

        if (compPositions[pos] == i+1)
          allowsComp = false;
      }
     
      //Get the tag from the probe
      NucleotideSequence tag = p.getTagAt(i);
      int block = p.getBlockNoOfTag(i);
      int blockStart = p.getStartOfSequence(block);
      //If the tag is of 0 length don't do anything
      if (tag.length() > 0) {
        //Search for the tag sequence in the probe
        if (!allowsSeq) {
         
          occurrences = tsc.getOccurrences(tag.seqString(), p.seqString(),
              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
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.