Package org.moltools.apps.probemaker.seq.impl

Examples of org.moltools.apps.probemaker.seq.impl.DefaultProbe


      PropertyAcceptorNucleotideSequence tss3 = ProbeMakerSequenceFactory.createTSS(new SimpleNucleotideSequence(
          "3' TSS", substrings[14], type),pt == null ? "" : pt.getID()); //$NON-NLS-1$ //$NON-NLS-2$
      ProbeMakerPropertyUtils.setHybridizationTemp(tss3,Float.parseFloat(substrings[15]));

      Probe p = new DefaultProbe(ProbeMakerSequenceFactory.createTSSPair(tss5, tss3, pt),Integer.parseInt(substrings[3]),Integer.parseInt(substrings[4]),type);
      p.setName(substrings[0]);
      p.setID(substrings[1]);
      if (gr_no >= 0)
        DesignUtils.addGroup(p, p_groups.get(gr_no));

      ProbeMakerPropertyUtils.setRank(p,Byte.parseByte(substrings[7]));

      //Read tags from substring 16;
      int t = 0;
      for (int i = 16; i < substrings.length; i+=2, t++) {
        String l_str = substrings[i];
        String t_str = substrings[i+1];
        if (l_str.startsWith("Spacer")) { //$NON-NLS-1$
          NucleotideSequence tag = new SimpleNucleotideSequence("Spacer " + t_str, t_str, p.getType()); //$NON-NLS-1$
          p.addTagAt(tag,t);
        }
        else {
          int lib_no = Integer.parseInt(l_str);
          int tag_no = Integer.parseInt(t_str);
          NucleotideSequence tag = libraries[lib_no].getSequenceAt(tag_no);
          p.addTagAt(tag, t);
          proj.getTagAllocationTable().use(tag,p,t);
        }
      }

      //UITexts for 5' TSS
      for (int mess = 0;mess < messageCount5;mess++) {
        String[] messageLine = tio.getInStrings(r.readLine());
        if (messageLine.length != 4)
          throw new UnsupportedOperationException("Error parsing message line: " + messageLine); //$NON-NLS-1$
        MessageType mt = new MessageType(messageLine[0],messageLine[1]);
        ProbeMakerPropertyUtils.addMessage(tss5,new Message(messageLine[2],mt,Byte.parseByte(messageLine[3])));
      }

      //UITexts for 3' TSS
      for (int mess = 0;mess < messageCount3;mess++) {
        String[] messageLine = tio.getInStrings(r.readLine());
        if (messageLine.length != 4)
          throw new UnsupportedOperationException("Error parsing message line: " + messageLine); //$NON-NLS-1$
        MessageType mt = new MessageType(messageLine[0],messageLine[1]);
        ProbeMakerPropertyUtils.addMessage(tss3,new Message(messageLine[2],mt,Byte.parseByte(messageLine[3])));
      }

      //UITexts for TSS Pair
      for (int mess = 0;mess < messageCountTSS;mess++) {
        String[] messageLine = tio.getInStrings(r.readLine());
        if (messageLine.length != 4)
          throw new UnsupportedOperationException("Error parsing message line: " + messageLine); //$NON-NLS-1$
        MessageType mt = new MessageType(messageLine[0],messageLine[1]);
        ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(messageLine[2],mt,Byte.parseByte(messageLine[3])));
      }

      //UITexts for Probe
      for (int mess = 0;mess < messageCountProbe;mess++) {
        String[] messageLine = tio.getInStrings(r.readLine());
View Full Code Here


    PropertyAcceptorNucleotideSequence tss5 = ProbeMakerSequenceFactory.createTSS(seq,target.getID());   
    ProbeMakerPropertyUtils.addMessage(tss5, new Message("Test",new MessageType("test_type","Test type"),Message.ERROR));     //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    TSSPair pair = new TSSPair(tss5,null,target);
    ProbeMakerPropertyUtils.addMessage(pair, new Message("Test",new MessageType("test_type","Test type"),Message.ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    Probe probe = new DefaultProbe(pair,0,0,NucleotideSequence.DNA);

    ProbeMakerPropertyUtils.setRank(probe, ProbeMakerConstants.BAD_QUALITY);
   
    assertTrue("Incorrect rank", ProbeMakerConstants.BAD_QUALITY == ProbeMakerPropertyUtils.getRank(probe)); //$NON-NLS-1$
   
    assertTrue("Incorrect target ID", target.getID().equals(DesignUtils.getTargetID(probe))); //$NON-NLS-1$
    assertTrue("Incorrect target", target.equals(pair.getTarget())); //$NON-NLS-1$
    assertTrue("Incorrect target", target.equals(probe.getTarget())); //$NON-NLS-1$
    assertTrue("Incorrect message count", 2 == ProbeMakerPropertyUtils.getAllMessages(probe).size()); //$NON-NLS-1$
    assertTrue("Wrong tss pair",pair == probe.getTSSPair()); //$NON-NLS-1$
   
    ProbeMakerPropertyUtils.addMessage(probe, new Message("Test",new MessageType("test_type","Test type"),Message.ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
   
    assertTrue("Incorrect message count", 3 == ProbeMakerPropertyUtils.getAllMessages(probe).size()); //$NON-NLS-1$
   
View Full Code Here

    DefaultTSSPairDesigner tpd = new DefaultTSSPairDesigner(con);
 
    ProbeMakerTarget target = new PadlockTarget("T1","ATACAGTCGTCCGGGTCGAA|AAGAGCATCGACGCGGATCAAGCCTATCGTCACGCGA","Target 1");
    TSSPair pair = tpd.designTSSPair(target);
   
    Probe p = new DefaultProbe(pair,0,0,NucleotideSequence.DNA);
 
    plc.checkTemplatingByTarget(p);
   
    assertEquals(0,ProbeMakerPropertyUtils.getAllMessages(p).size());
   
    //Get a variant of an allele specific padlock
    AlleleSpecificPadlockTarget target2 = new AlleleSpecificPadlockTarget("T2","ATACAGTCGTCCGGGTCGAAWAGAGCATCGACGCGGATCAA","Target 2");
    target = target2.expand().get(0);
   
    pair = tpd.designTSSPair(target);
   
    p = new DefaultProbe(pair,0,0,NucleotideSequence.DNA);
    plc.checkTemplatingByTarget(p);
    assertEquals(0,ProbeMakerPropertyUtils.getAllMessages(p).size());
   
   
  }
View Full Code Here

  }

  /**Creates a probe skeleton with the given DefaultTSSPair. Description and ID are not set.*/
  public static Probe createProbeSkeleton(TSSPair pair, byte probeAcidType, int upstreamBlocks, int downstreamBlocks, DefiniteSequenceDB<Probe> probeset) {
 
    Probe p = new DefaultProbe(pair, upstreamBlocks, downstreamBlocks, probeAcidType);
    //If the target belongs to a TargetGroup, this probe should be placed in the
    //corresponding ProbeGroup. This is accomplished by checking the earlier made
    //probes for having a target from the same group and if so adding this probe
    //to that probegroup.
    TargetGroup tg = (TargetGroup) DesignUtils.getGroupWithType((PropertyHolder) p.getTarget(),TargetGroup.GROUP_TYPE);
    if (tg != null) {
      boolean groupfound = false;
      for (Iterator<Probe> i = probeset.iterator(); i.hasNext() && !groupfound; ) {
        Probe other = i.next();    
        ProbeGroup og = (ProbeGroup) DesignUtils.getGroupWithType(other,ProbeGroup.GROUP_TYPE);       
View Full Code Here

  }

  /**Creates a probe skeleton with the given DefaultTSSPair. Description and ID are not set.*/
  public static Probe createProbeSkeleton(String id, TSSPair pair, byte probeAcidType, int upstreamBlocks, int downstreamBlocks, DefiniteSequenceDB<Probe> probeset) {
 
    Probe p = new DefaultProbe(pair, upstreamBlocks, downstreamBlocks, probeAcidType);
    p.setID(id);
    //If the target belongs to a TargetGroup, this probe should be placed in the
    //corresponding ProbeGroup. This is accomplished by checking the earlier made
    //probes for having a target from the same group and if so adding this probe
    //to that probegroup.
    TargetGroup tg = (TargetGroup) DesignUtils.getGroupWithType((PropertyHolder) p.getTarget(),TargetGroup.GROUP_TYPE);
    if (tg != null) {
      boolean groupfound = false;
      for (Iterator<Probe> i = probeset.iterator(); i.hasNext() && !groupfound; ) {
        Probe other = i.next();    
        ProbeGroup og = (ProbeGroup) DesignUtils.getGroupWithType(other,ProbeGroup.GROUP_TYPE);       
View Full Code Here

          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();

      addMessagesFromElement(p,probeE.getChild("messageList",ns));       //$NON-NLS-1$
View Full Code Here

    ListSequenceDB<NucleotideSequence> db = new ListSequenceDB<NucleotideSequence>();
    db.addSequence(tag1);
    db.addSequence(tag2);
    lib = new DefaultTagLibrary(db,"lib"); //$NON-NLS-1$
    TagLibrary[] libs = new TagLibrary[] {lib};
    c1 = new DefaultProbe(null,0,0,NucleotideSequence.DNA);
    c1.setID("PROBE_1"); //$NON-NLS-1$
    c2 = new DefaultProbe(null,0,0,NucleotideSequence.DNA);
    c2.setID("PROBE_2"); //$NON-NLS-1$
    c3 = new DefaultProbe(null,0,0,NucleotideSequence.DNA);
    c3.setID("PROBE_3"); //$NON-NLS-1$

    g1 = new ProbeGroup(null,"G1"); //$NON-NLS-1$
    g2 = new ProbeGroup(null,"G2"); //$NON-NLS-1$
    g1.addMember(c1);
View Full Code Here

    PropertyAcceptorNucleotideSequence tss5 = ProbeMakerSequenceFactory.createTSS(seq,target.getID());   
    ProbeMakerPropertyUtils.addMessage(tss5, new Message("Test",new MessageType("test_type","Test type"),Message.ERROR));     //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    TSSPair pair = new TSSPair(tss5,null,target);
    ProbeMakerPropertyUtils.addMessage(pair, new Message("Test",new MessageType("test_type","Test type"),Message.ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    Probe probe = new DefaultProbe(pair,0,0,NucleotideSequence.DNA);

    ProbeMakerPropertyUtils.setRank(probe, ProbeMakerConstants.BAD_QUALITY);

    assertTrue("Incorrect rank", ProbeMakerConstants.BAD_QUALITY == ProbeMakerPropertyUtils.getRank(probe)); //$NON-NLS-1$

    assertTrue("Incorrect target ID", target.getID().equals(DesignUtils.getTargetID(probe))); //$NON-NLS-1$
    assertTrue("Incorrect target", target.equals(pair.getTarget())); //$NON-NLS-1$
    assertTrue("Incorrect target", target.equals(probe.getTarget())); //$NON-NLS-1$
    assertTrue("Incorrect message count", 2 == ProbeMakerPropertyUtils.getAllMessages(probe).size()); //$NON-NLS-1$
    assertTrue("Wrong tss pair",pair == probe.getTSSPair()); //$NON-NLS-1$

    ProbeMakerPropertyUtils.addMessage(probe, new Message("Test",new MessageType("test_type","Test type"),Message.ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    assertTrue("Incorrect message count", 3 == ProbeMakerPropertyUtils.getAllMessages(probe).size()); //$NON-NLS-1$
View Full Code Here

  }

  public void testGroup() {
   
    Probe p1 = new DefaultProbe(NucleotideSequence.DNA);
    p1.setID("P1");
   
    TargetGroup tg = new TargetGroup("tg");
    ProbeGroup pg = new ProbeGroup(tg, "PG");
    assertEquals(0, pg.getMembers().size());
    pg.addMember(p1);
    assertEquals(1, pg.getMembers().size());
    p1.setName("Probe 1");   
    pg.removeMember(p1);
    assertEquals(0, pg.getMembers().size());
 
View Full Code Here

TOP

Related Classes of org.moltools.apps.probemaker.seq.impl.DefaultProbe

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.