Package org.moltools.apps.probemaker.seq

Examples of org.moltools.apps.probemaker.seq.Probe


      super.abort();
      designer.abort();     

      //Recalculate the probe qualities and finish up the work
      for (Iterator<Probe> i = probes.iterator(); i.hasNext(); ) {
        Probe p = i.next();
        Analyzer.calculateAndSetQuality(p);
      }
    }
    log.endJob();
View Full Code Here


  protected void doTest(TSSConstructor tsc, String expect5, String expect3) throws ClusterException {
    ProbeDesigner pd = new DefaultProbeDesigner(new GreedyTagAllocator());
    ProbeDesignTask task = pm.getProbeDesignTask(false, true, false, new GoodAcceptor(), new NoSelector(), pd, tsc, new StreamErrorHandler(System.out,true));
    task.run();
   
    Probe p = proj.getProbes().getSequenceAt(0);
    TSSPair pair = p.getTSSPair();
   
    PropertyAcceptorNucleotideSequence tss5 = (PropertyAcceptorNucleotideSequence) pair.getSequence(TSSPair.KEY_FIVE_PRIME);
    PropertyAcceptorNucleotideSequence tss3 = (PropertyAcceptorNucleotideSequence) pair.getSequence(TSSPair.KEY_THREE_PRIME);
   
    String seq5 = tss5.seqString();
View Full Code Here

        //Create a new probe for the target, with the specified TSS
        logger.info("Creating probe for " + target.getID()); //$NON-NLS-1$
        byte probeAcidType = Byte.parseByte(parameters.get(PROP_PROBE_ACID_TYPE));
        int up = Integer.parseInt(parameters.get(PROP_UPSTREAM_BLOCKS));
        int down = Integer.parseInt(parameters.get(PROP_DOWNSTREAM_BLOCKS));
        Probe p = ProbeMakerSequenceFactory.createProbeSkeleton(pairs[tindex],probeAcidType,up,down,probes);        
       
        p.setName(namer.getProbeName(project, target));
        p.setID(namer.getProbeID(project, target));
        //and add it to the probe db and newProbe list
        probes.addSequence(p);
        newProbes.addSequence(p);
      }
      catch (Exception ex) {
        log.printLine("A problem occurred"); //$NON-NLS-1$
        log.printError(ex.getMessage());
        handler.handleError(ex.toString(),ex);
      }
      tindex++;
    }
   
    //The newProbe method has set the group fields of each probe, so we make a
    //list of all groups that are new (when appending, it is necessary to
    //separate new and old groups).
    List<Identifiable> newGroupsAndProbes = new ArrayList<Identifiable>();
    for (Iterator<Probe> pi = newProbes.iterator(); pi.hasNext(); ) {
      Probe pr = pi.next();     
      ProbeGroup pg = (ProbeGroup) DesignUtils.getGroupWithType(pr, ProbeGroup.GROUP_TYPE);
      if (pg == null) {
        //If no group, add the probe instead
        newGroupsAndProbes.add(pr);
      }
      else if (!newGroupsAndProbes.contains(pg)) {
        newGroupsAndProbes.add(pg);
      }
    }
   
    //Screen the tags through the modules
    /*if (screentags) {
     setStatus(UITexts.getString("ProbeDesignTask.MESSAGE_SCREENING_TAGS")); //$NON-NLS-1$
    
    
     List allModules = new ArrayList();
    
     allModules.addAll(project.getSettings().getArmModules());
     allModules.addAll(project.getSettings().getCandidateModulesStage1());
     allModules.addAll(project.getSettings().getCandidateModulesStage2());        
    
     pd.screenTags(allModules);
     */
   
    fireStatusChange(0,CoreMessages.getString("ProbeDesignTask.MESSAGE_ALLOCATING_TAGS")); //$NON-NLS-1$
   
    //The probes db now contains all probes with TSSs only.
    //Now go through each new probegroup and allocate tags to the probes.
    int groupindex = 0; //status marker
    for (Iterator<Identifiable> gi = newGroupsAndProbes.iterator(); gi.hasNext(); ) {
      if (aborted()) return false;
      groupindex++;
      logger.info("Designing probes for group " + (groupindex)); //$NON-NLS-1$*/
      try {
        Object o = gi.next();
        if (o instanceof ProbeGroup) {
          ProbeGroup pg = (ProbeGroup) o;
          fireStatusChange(0,"Group " + (groupindex)); //$NON-NLS-1$
          allocator.allocateTagsToGroup(pg);
       
          //When the probes are finished confirm them and increment the progress value
          for (Iterator<Probe> pi = pg.getMembers().iterator(); pi.hasNext(); ) {
            allocator.confirm(pi.next());
            progress++;
            fireProgressChange(progress);
          }
        }
        else {
          Probe p = (Probe) o;
          ProbeGroup pg = new ProbeGroup(null,"DUMMY"); //$NON-NLS-1$
          pg.addMember(p);
          fireStatusChange(0,"Group " + (groupindex)); //$NON-NLS-1$
          allocator.allocateTagsToGroup(pg);
       
          //When the probes are finished confirm them and increment the progress value
          for (Iterator<Probe> pi = pg.getMembers().iterator(); pi.hasNext(); ) {
            allocator.confirm(pi.next());
            progress++;
            fireProgressChange(progress);
          }
          pg.removeMember(p);
        }
      }
      catch (Exception ex) {
        log.printLine("A problem occurred"); //$NON-NLS-1$
        log.printError(ex.getMessage());
        handler.handleError(ex.toString(),ex);
      }
    }
   
    //Recalculate the probe qualities and finish up the work
    for (Iterator<Probe> i = probes.iterator(); i.hasNext(); ) {
      if (aborted()) return false;
      Probe p = i.next();
      Analyzer.calculateAndSetQuality(p);
    }
   
    elapsedTime = System.currentTimeMillis() - startTime;
   
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());
   
View Full Code Here

    proj.getTargets().addSequence(t1);
    proj.setTagSettings(new DefaultTagSettings(new TagLibrary[] { tags }));
   
//  Design without test
    pm.getProbeDesignTask(false, true, null, new DefaultNamingScheme(), new AllAcceptor(),new NoSelector(), new DefaultProbeDesigner(new PairwiseTagAllocator()), new DefaultTSSPairDesigner(new DefaultTSSConstructor()), new StreamErrorHandler(System.out,true)).run();   
    Probe p = proj.getProbes().getSequenceAt(0);   
    assertTrue("Hyb. interference, 0 messages expected, " + ProbeMakerPropertyUtils.getAllMessages(p).size() + " generated.",ProbeMakerPropertyUtils.getAllMessages(p).size() == 0); //$NON-NLS-1$ //$NON-NLS-2$
   
   
//  Design again with test
    proj.getSettings().addCandidateModuleStage1(new DefaultHybInterferenceModule());   
View Full Code Here

  protected void doTest(TSSConstructor tsc, String expect5, String expect3) throws ClusterException {
    ProbeDesigner pd = new DefaultProbeDesigner(new GreedyTagAllocator());
    ProbeDesignTask task = pm.getProbeDesignTask(false, true, null, new DefaultNamingScheme(), new GoodAcceptor(), new NoSelector(), pd, new DefaultTSSPairDesigner(tsc), new StreamErrorHandler(System.out,true));
    task.run();
   
    Probe p = proj.getProbes().getSequenceAt(0);
    TSSPair pair = p.getTSSPair();
   
    PropertyAcceptorNucleotideSequence tss5 = (PropertyAcceptorNucleotideSequence) pair.getSequence(TSSPair.KEY_FIVE_PRIME);
    PropertyAcceptorNucleotideSequence tss3 = (PropertyAcceptorNucleotideSequence) pair.getSequence(TSSPair.KEY_THREE_PRIME);
   
    String seq5 = tss5.seqString();
View Full Code Here

    lib1.setMode(TagLibrary.USE_UNIQUE_TAG);
    pm.getProject().setTagSettings(new DefaultTagSettings(new TagLibrary[] {lib1}));

    pm.getProbeDesignTask(false,true, null, new DefaultNamingScheme(), new GoodFairAcceptor(),new NoSelector(),pd,new DefaultTSSPairDesigner(new DefaultTSSConstructor()),null).run();

    Probe p1 = pm.getProject().getProbes().getSequenceAt(0);
    Probe p2 = pm.getProject().getProbes().getSequenceAt(1);

    assertEquals(ProbeMakerPropertyUtils.getRank(p1),ProbeMakerConstants.GOOD_QUALITY);
    assertEquals(ProbeMakerPropertyUtils.getRank(p2),ProbeMakerConstants.GOOD_QUALITY);

    //Test with forbidden tags
View Full Code Here

  }
 
  @Override
  public Object getValueAt(int row, int col) {
    try {
      Probe p = (Probe) getSequenceAt(row);
      if (col == 0) {
        return p.getName();
      }
      try {
        if (p.getTags().size() >= col) {
          return p.getTagAt(col - 1).getID();
        }
        return SwingUIMessages.getString("ProbeTagsTableModel.TEXT_NO_TAG"); //$NON-NLS-1$
      }
      catch (ArrayIndexOutOfBoundsException e) {
        throw new UnsupportedOperationException("Col index out of bounds " + //$NON-NLS-1$
View Full Code Here

    html.append("</TH>\n<TH>"); //$NON-NLS-1$
    html.append(SwingUIMessages.getString("ProbeSummaryViewFactory.TEXT_HEADER_QUALITY")); //$NON-NLS-1$
    html.append("</TH>\n</TR>\n"); //$NON-NLS-1$
    //Each row
    for (Iterator<? extends Probe> i = probes.iterator(); i.hasNext(); ) {
      Probe p = i.next();
      PropertyAcceptorNucleotideSequence fivePrime;
      PropertyAcceptorNucleotideSequence threePrime;
      try {
        fivePrime = (PropertyAcceptorNucleotideSequence) p.getTSSPair().getSequence(TSSPair.KEY_FIVE_PRIME);
      }
      catch (ClusterException e) {
        fivePrime = null;
      }
      try {
        threePrime = (PropertyAcceptorNucleotideSequence) p.getTSSPair().getSequence(TSSPair.KEY_THREE_PRIME);
      }
      catch (ClusterException e) {
        threePrime = null;
      }

      html.append("<TR><TD>" + p.getName() + "</TD>\n"); //$NON-NLS-1$ //$NON-NLS-2$
      html.append("<TD ALIGN = right>" + //$NON-NLS-1$
          (fivePrime == null ? "" : tempFormat.format(ProbeMakerPropertyUtils.getHybridizationTemp(fivePrime))) "</TD>\n"); //$NON-NLS-1$ //$NON-NLS-2$
      html.append("<TD ALIGN = right>" + //$NON-NLS-1$
          (threePrime == null ? "" : tempFormat.format(ProbeMakerPropertyUtils.getHybridizationTemp(threePrime))) + "</TD>\n"); //$NON-NLS-1$ //$NON-NLS-2$
      html.append("<TD>" + ProbeMakerConstants.qualityStrings[ProbeMakerPropertyUtils.getRank(p)] + //$NON-NLS-1$
View Full Code Here

        for (int i = 1; i < l.size() - 1; i++) {
          tags.add(new SimpleChangeableNucleotideSequence(id+"|Tag " + i,  //$NON-NLS-1$
              l.get(i), NucleotideSequence.DNA,  "Tag " + i)); //$NON-NLS-1$
        }
        PropertyAcceptorNucleotideSequence tss3 = ProbeMakerSequenceFactory.createTSS(new SimpleChangeableNucleotideSequence("3' TSS", l.get(l.size() - 1), NucleotideSequence.DNA,"3' TSS"),null); //$NON-NLS-1$
        Probe p = new DefaultProbe(ProbeMakerSequenceFactory.createTSSPair(tss5, tss3, null),0,0,NucleotideSequence.DNA);
        for (int i = 0;i<tags.size();i++) {
          p.addTagAt(tags.get(i),i)
        }
       
        p.setName(name);
        p.setID(id);
        p.setTagsAllocated(true);
        return p;
      }
    };
  }
View Full Code Here

TOP

Related Classes of org.moltools.apps.probemaker.seq.Probe

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.