Package org.moltools.apps.probemaker.design

Examples of org.moltools.apps.probemaker.design.TagLibrary


    tags1.addSequence(new SimpleNucleotideSequence("ZIP|1","ACTAGCACGGACGAC")); //$NON-NLS-1$ //$NON-NLS-2$
    tags1.addSequence(new SimpleNucleotideSequence("ZIP|2","ACTAGCACGGACGAC")); //$NON-NLS-1$ //$NON-NLS-2$
    tags1.addSequence(new SimpleNucleotideSequence("ZIP|3","ACTAGCACGGACGAC")); //$NON-NLS-1$ //$NON-NLS-2$
    tags2.addSequence(new SimpleNucleotideSequence("PRIMER|1","ACTAGCACGGACGAC")); //$NON-NLS-1$ //$NON-NLS-2$
    project.getSettings().getDesignParameters().put("UPSTREAM_BLOCKS","1"); //$NON-NLS-1$ //$NON-NLS-2$
    TagLibrary lib1 = new DefaultTagLibrary(tags1,"Lib 1"); //$NON-NLS-1$
    TagLibrary lib2 = new DefaultTagLibrary(tags2,"Lib 2"); //$NON-NLS-1$
    lib1.setMode(TagLibrary.USE_UNIQUE_TAG);
    lib2.setMode(TagLibrary.USE_SAME_TAG);
    project.setTagSettings(new DefaultTagSettings(new TagLibrary[] { lib1, lib2 }));
  }
View Full Code Here


    pm.getProject().getTargets().addSequence(t1);
   
    ListSequenceDB<NucleotideSequence> db = new ListSequenceDB<NucleotideSequence>();
    db.addSequence(new SimpleNucleotideSequence("Tag 1","AAAAAAAAAA")); //$NON-NLS-1$ //$NON-NLS-2$
    db.addSequence(new SimpleNucleotideSequence("Tag 2","TTTTTTTTTT")); //$NON-NLS-1$ //$NON-NLS-2$
    TagLibrary tl = new DefaultTagLibrary(db,"Unique"); //$NON-NLS-1$
    tl.setMode(TagLibrary.USE_UNIQUE_TAG);
   
    pm.getProject().setTagSettings(new DefaultTagSettings(new TagLibrary[] {tl}));
   
    //Design
    ProbeDesigner pd = new DefaultProbeDesigner(new PairwiseTagAllocator());
    pm.getProbeDesignTask(false, false, true, new AllAcceptor(),new NoSelector(), pd, new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true)).run();
       
//  Store to project file
    File f = new File("temp.pmp"); //$NON-NLS-1$
    f.deleteOnExit();
    new ProjectXMLIOTask(pm,null,new FileWriter(f)).run();
   
    //Read project
    new ProjectXMLIOTask(pm,null,new FileReader(f)).run();
   
    //Add new target
    pm.getProject().getTargets().clear();
    pm.getProject().getTargets().addSequence(t2);
   
//  Design with append       
    pm.getProbeDesignTask(true, false, true, new AllAcceptor(), new NoSelector(), pd, new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true)).run();
   
        
//  Store to project file
    f = new File("temp2.pmp"); //$NON-NLS-1$
    f.deleteOnExit();
    new ProjectXMLIOTask(pm,eh,new FileWriter(f)).run();
   
    //Read project
    new ProjectXMLIOTask(pm,eh,new FileReader(f)).run();
      
    pm.getProject().getTargets().clear();
    pm.getProject().getTargets().addSequence(t1);
    pm.getProject().getTargets().addSequence(t2);
   
    db = new ListSequenceDB<NucleotideSequence>();
    db.addSequence(new SimpleNucleotideSequence("Tag 1","AAAAAAAAAA")); //$NON-NLS-1$ //$NON-NLS-2$
    db.addSequence(new SimpleNucleotideSequence("Tag 2","TTTTTTTTTT")); //$NON-NLS-1$ //$NON-NLS-2$
    db.addSequence(new SimpleNucleotideSequence("Tag 3","AAAAAAAAAA")); //$NON-NLS-1$ //$NON-NLS-2$
    db.addSequence(new SimpleNucleotideSequence("Tag 4","TTTTTTTTTT")); //$NON-NLS-1$ //$NON-NLS-2$
    tl = new DefaultTagLibrary(db,"Unique"); //$NON-NLS-1$
    tl.setMode(TagLibrary.USE_PER_GROUP);
   
    pm.getProject().setTagSettings(new DefaultTagSettings(new TagLibrary[] {tl, tl}));
   
//  Design
    pm.getProbeDesignTask(false, true, true, new AllAcceptor(), new NoSelector(), pd, new DefaultTSSConstructor(), eh).run();   
View Full Code Here

    t1.setVariant(t1.getVariants()[0]);
    t2.setVariant(t2.getVariants()[0]);


    //Make tag library with ten tags
    TagLibrary tags10 = new DefaultTagLibrary(new ListSequenceDB<NucleotideSequence>(),"Tag library 10"); //$NON-NLS-1$
    tags10.setMode(TagLibrary.USE_UNIQUE_TAG);
    for (int i = 1;i <= 10;i++) {
      tags10.addSequence(new SimpleNucleotideSequence("Tag" + i,"AAAAAAAAAAAAAAAAAAAA", NucleotideSequence.DNA)); //$NON-NLS-1$ //$NON-NLS-2$
    }   

    //Make tag library with one tag
    TagLibrary tags1 = new DefaultTagLibrary(new ListSequenceDB<NucleotideSequence>(),"Tag library 1"); //$NON-NLS-1$
    tags1.setMode(TagLibrary.USE_UNIQUE_TAG);
    tags1.addSequence(new SimpleNucleotideSequence("Tag1","AAAAAAAAAAAAAAAAAAAA", NucleotideSequence.DNA)); //$NON-NLS-1$ //$NON-NLS-2$

    TagLibrary tags1b = new DefaultTagLibrary(new ListSequenceDB<NucleotideSequence>(),"Tag library 1b"); //$NON-NLS-1$
    tags1b.setMode(TagLibrary.USE_UNIQUE_TAG);
    tags1b.addSequence(new SimpleNucleotideSequence("Tag1b","AAAAAAAAAAAAAAAAAAAA", NucleotideSequence.DNA)); //$NON-NLS-1$ //$NON-NLS-2$

    libraries1_10 = new TagLibrary[] { tags10 };
    libraries1_1 = new TagLibrary[] { tags1 };
    libraries2_1_1 = new TagLibrary[] { tags1, tags1b };
View Full Code Here

    proj.getTargets().addSequence(t1);
    proj.getTargets().addSequence(t2);
    TargetHandler.expandTargets(pm.getProject().getTargets());
    pm.setProject(proj);
  
    TagLibrary lib = libraries1_10[0];

    Probe[] probes = performModeTest(TagLibrary.USE_ANY_TAG);

    assertEquals(lib.getSequenceAt(0),probes[0].getTagAt(0));
    assertEquals(lib.getSequenceAt(0),probes[1].getTagAt(0));
    assertEquals(lib.getSequenceAt(0),probes[2].getTagAt(0));
    assertEquals(lib.getSequenceAt(0),probes[3].getTagAt(0));
    assertEquals(lib.getSequenceAt(0),probes[4].getTagAt(0));

    probes = performModeTest(TagLibrary.USE_UNIQUE_TAG);

    assertEquals(lib.getSequenceAt(0),probes[0].getTagAt(0));
    assertEquals(lib.getSequenceAt(1),probes[1].getTagAt(0));
    assertEquals(lib.getSequenceAt(2),probes[2].getTagAt(0));
    assertEquals(lib.getSequenceAt(3),probes[3].getTagAt(0));
    assertEquals(lib.getSequenceAt(4),probes[4].getTagAt(0));
   
    probes = performModeTest(TagLibrary.USE_PER_GROUP);

    assertEquals(lib.getSequenceAt(0),probes[0].getTagAt(0));
    assertEquals(lib.getSequenceAt(0),probes[1].getTagAt(0));
    assertEquals(lib.getSequenceAt(1),probes[2].getTagAt(0));
    assertEquals(lib.getSequenceAt(1),probes[3].getTagAt(0));
    assertEquals(lib.getSequenceAt(1),probes[4].getTagAt(0));

    probes = performModeTest(TagLibrary.USE_SAME_TAG);

    assertEquals(lib.getSequenceAt(0),probes[0].getTagAt(0));
    assertEquals(lib.getSequenceAt(0),probes[1].getTagAt(0));
    assertEquals(lib.getSequenceAt(0),probes[2].getTagAt(0));
    assertEquals(lib.getSequenceAt(0),probes[3].getTagAt(0));
    assertEquals(lib.getSequenceAt(0),probes[4].getTagAt(0));
   
    probes = performModeTest(TagLibrary.USE_UNIQUE_IN_GROUP);

    assertEquals(lib.getSequenceAt(0),probes[0].getTagAt(0));
    assertEquals(lib.getSequenceAt(1),probes[1].getTagAt(0));
    assertEquals(lib.getSequenceAt(0),probes[2].getTagAt(0));
    assertEquals(lib.getSequenceAt(1),probes[3].getTagAt(0));
    assertEquals(lib.getSequenceAt(2),probes[4].getTagAt(0));   
  
  }
View Full Code Here

 

  /**Get a key-value pair, <tag, library> for a tag id*/
  protected KeyValue getLibraryTag(TagLibrary[] libraries, String tagID) {   
    NucleotideSequence theTag = null;
    TagLibrary theLib = null;
    for (int lib = 0;lib<libraries.length;lib++) {
      try {
        NucleotideSequence tag = libraries[lib].getSequenceByID(tagID);
        if (tag != null) {
          theTag = tag;
View Full Code Here

    for (Iterator<?> i2 = tagsE.getChildren().iterator();i2.hasNext();) {
      Element tagE = (Element) i2.next();
      tags.addSequence(getTag(tagE));
    }

    TagLibrary tl = new DefaultTagLibrary(tags,libName);
    tl.setMode(Byte.parseByte(libMode));
    return tl;
  }
View Full Code Here

  protected TagSettings getTagSettings(Element e) {
    List<TagLibrary> libs = new ArrayList<TagLibrary>();
    for (Iterator<?> i = e.getChildren(LIBRARY,ns).iterator();i.hasNext();) {
      Element libE = (Element) i.next();
      TagLibrary tl = getTagLibrary(libE);
      libs.add(tl);
    }

    TagLibrary[] tls = libs.toArray(new TagLibrary[libs.size()]);
    int[] order = new int[tls.length];
View Full Code Here

    db2.addSequence(new SimpleNucleotideSequence("T21",""))//$NON-NLS-1$//$NON-NLS-2$
    db2.addSequence(new SimpleNucleotideSequence("T21","")); //$NON-NLS-1$ //$NON-NLS-2$
   
    TagAllocationTable tat = new TagAllocationTable();
   
    TagLibrary lib1 = new DefaultTagLibrary(db1,"lib 1"); //$NON-NLS-1$
    TagLibrary lib2 = new DefaultTagLibrary(db2,"lib 2"); //$NON-NLS-1$
    TagLibrary[] libs = new TagLibrary[] { lib1, lib2 };
    int[] tagorder = new int[] {0,1};
   
    lib1.setMode(TagLibrary.USE_SAME_TAG);
    lib1.setMode(TagLibrary.USE_UNIQUE_TAG);
View Full Code Here

    p.println(TITLE_DESCRIPTOR + LIBRARIES);

    //Check for a spacer
    TagLibrary[] libraries = proj.getTagSettings().getTagLibraries();
    for (int i = 0, t = 0; i < libraries.length; i++, t++) {
      TagLibrary l = libraries[t];
      p.println(tio.getOutString(new String[] {l.getName(),
          String.valueOf(l.getMode()),
          String.valueOf(true),
          String.valueOf(true)}));
    }

    p.println(TITLE_DESCRIPTOR + LISTEND);

    //Print the tags of each library - id;sequence;type
    for (int i = 0; i < libraries.length; i++) {
      TagLibrary l = libraries[i];
      p.println(TITLE_DESCRIPTOR + LIBRARY);
      for (Iterator<NucleotideSequence> ti = l.iterator(); ti.hasNext(); ) {
        NucleotideSequence t = ti.next();
        p.println(tio.getOutString(new String[] {t.getID(),t.seqString(),String.valueOf(t.getType())}));
      }
      p.println(TITLE_DESCRIPTOR + LISTEND);
    }
View Full Code Here

    while (!(libString = r.readLine()).startsWith(String.valueOf(TITLE_DESCRIPTOR))) {

      String[] substrings = tio.getInStrings(libString);
      if (substrings.length != 4)
        throw new UnsupportedOperationException("Error parsing tag library line: " + libString); //$NON-NLS-1$
      TagLibrary l = new DefaultTagLibrary(new ListSequenceDB<NucleotideSequence>(), substrings[0]);
      l.setMode(Byte.parseByte(substrings[1]));
      libs.add(l);
    }
    TagLibrary[] libraries = new TagLibrary[libs.size()];
    for (int l = 0; l < libraries.length; l++) {
      libraries[l] = libs.get(l);
View Full Code Here

TOP

Related Classes of org.moltools.apps.probemaker.design.TagLibrary

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.