Package uk.ac.bbsrc.tgac.miso.core.data.impl.illumina

Examples of uk.ac.bbsrc.tgac.miso.core.data.impl.illumina.IlluminaRun


    dataObjectFactory = new TgacDataObjectFactory();
  }

  @Test
  public void testIlluminaRun() {
    IlluminaRun r = (IlluminaRun)dataObjectFactory.getRunOfType(PlatformType.ILLUMINA);
    r.setId(-1L);

    log.info("Registering listeners");

    MockRunListener foo = new MockRunListener();

    Set<ResponderService> responders = new HashSet<ResponderService>();
    MockRunResponderService runResponder = new MockRunResponderService();
    MockStatusChangedResponderService statusResponder = new MockStatusChangedResponderService();

    Set<AlerterService> alerters = new HashSet<AlerterService>();
    MockLogAlerterService logAlerter = new MockLogAlerterService();
    alerters.add(logAlerter);

    //MockEmailAlerterService emailAlerter = new MockEmailAlerterService();
    //alerters.add(emailAlerter);

    runResponder.setAlerterServices(alerters);
    statusResponder.setAlerterServices(alerters);

    responders.add(runResponder);
    responders.add(statusResponder);

    foo.setResponderServices(responders);
    r.addListener(foo);

    log.info("Attempting to set status from "+r.getStatus().getHealth().getKey()+" to Unknown");
    Status s = new StatusImpl();
    s.setHealth(HealthType.Unknown);
    r.setStatus(s);

    log.info("Attempting to set status from "+r.getStatus().getHealth().getKey()+" to Started");
    s = new StatusImpl();
    s.setHealth(HealthType.Started);
    r.setStatus(s);

    log.info("Attempting to set status from "+r.getStatus().getHealth().getKey()+" to Stopped");
    s = new StatusImpl();
    s.setHealth(HealthType.Stopped);
    r.setStatus(s);

    log.info("Attempting to set status from "+r.getStatus().getHealth().getKey()+" to Failed");
    s = new StatusImpl();
    s.setHealth(HealthType.Failed);
    r.setStatus(s);

    log.info("Attempting to set status from "+r.getStatus().getHealth().getKey()+" to Completed");
    s = new StatusImpl();
    s.setHealth(HealthType.Completed);
    r.setStatus(s);

    log.info("Unregistering listeners");
    r.removeListener(foo);
  }
View Full Code Here


        if (attemptRunPopulation) {
          if (r == null) {
            log.debug("Saving new run and status: " + runName);
            if (!run.has("status")) {
              //probably MiSeq
              r = new IlluminaRun();
              r.setPlatformRunId(Integer.parseInt(m.group(2)));
              r.setAlias(runName);
              r.setFilePath(runName);
              r.setDescription(m.group(3));
              r.setPairedEnd(false);
              is.setHealth(ht);
              r.setStatus(is);
            }
            else {
              String xml = run.getString("status");
              is = new IlluminaStatus(xml);
              r = new IlluminaRun(xml);
              is.setHealth(ht);
              r.getStatus().setHealth(ht);
            }

            if (run.has("fullPath")) {
View Full Code Here

    return JSONUtils.SimpleJSONError("No platform specified");
  }

  public JSONObject changeIlluminaContainer(HttpSession session, JSONObject json) {
    StringBuilder b = new StringBuilder();
    IlluminaRun run = (IlluminaRun) session.getAttribute("run_" + json.getString("run_cId"));
    run.getSequencerPartitionContainers().clear();

    if ("Illumina MiSeq".equals(run.getSequencerReference().getPlatform().getInstrumentModel())) {
      b.append("<h2>Container 1</h2>");
      b.append("<table class='in'>");
      b.append("<tr><td>ID:</td><td><button onclick='Run.container.lookupContainer(this, 0);' type='button' class='right-button ui-state-default ui-corner-all'>Lookup</button><div style='overflow:hidden'><input type='text' id='sequencerPartitionContainers[0].identificationBarcode' name='sequencerPartitionContainers[0].identificationBarcode'/></div></td></tr>");
      b.append("<tr><td>Location:</td><td><input type='text' id='sequencerPartitionContainers[0].locationBarcode' name='sequencerPartitionContainers[0].locationBarcode'/></td></tr>");
      b.append("<tr><td>Paired:</td><td><input type='checkbox' id='sequencerPartitionContainers[0].paired' name='sequencerPartitionContainers[0].paired' value='false'/></td></tr>");
      b.append("</table>");
      b.append("<div id='partitionErrorDiv'> </div>");
      b.append("<div id='partitionDiv'>");
      b.append("<table class='in'>");
      b.append("<th>Lane No.</th>");
      b.append("<th>Pool</th>");

      b.append("<tr><td>1 </td><td width='90%'><div id='p_div_0-0' class='elementListDroppableDiv'><ul class='runPartitionDroppable' bind='sequencerPartitionContainers[0].partitions[0].pool' partition='0_0'></ul></div></td></tr>");
      b.append("</table>");
      b.append("</div>");

      SequencerPartitionContainer<SequencerPoolPartition> f = dataObjectFactory.getSequencerPartitionContainer();
      f.setPartitionLimit(1);
      f.initEmptyPartitions();
      run.addSequencerPartitionContainer(f);
    }
    else if ("Illumina HiSeq 2500".equals(run.getSequencerReference().getPlatform().getInstrumentModel())) {
      b.append("<h2>Container 1</h2>");
      b.append("<table class='in'>");
      b.append("<tr><td>ID:</td><td><button onclick='Run.container.lookupContainer(this, 0);' type='button' class='right-button ui-state-default ui-corner-all'>Lookup</button><div style='overflow:hidden'><input type='text' id='sequencerPartitionContainers[0].identificationBarcode' name='sequencerPartitionContainers[0].identificationBarcode'/></div></td></tr>");
      b.append("<tr><td>Location:</td><td><input type='text' id='sequencerPartitionContainers[0].locationBarcode' name='sequencerPartitionContainers[0].locationBarcode'/></td></tr>");
      b.append("<tr><td>Paired:</td><td><input type='checkbox' id='sequencerPartitionContainers[0].paired' name='sequencerPartitionContainers[0].paired' value='false'/></td></tr>");
      b.append("</table>");
      b.append("<div id='partitionErrorDiv'> </div>");
      b.append("<div id='partitionDiv'>");
      b.append("<input id='lane2' name='container0Select' onchange='Run.ui.changeIlluminaLane(this, 0);' type='radio' value='2'/>2 ");
      b.append("<input id='lane8' name='container0Select' onchange='Run.ui.changeIlluminaLane(this, 0);' type='radio' value='8'/>8 ");
      b.append("<div id='containerdiv0'> </div>");

      SequencerPartitionContainer<SequencerPoolPartition> f = dataObjectFactory.getSequencerPartitionContainer();
      run.addSequencerPartitionContainer(f);
    }
    else {
      int numContainers = json.getInt("numContainers");
      run.getSequencerPartitionContainers().clear();
      for (int i = 0; i < numContainers; i++) {
        b.append("<h2>Container " + (i + 1) + "</h2>");
        b.append("<table class='in'>");
        b.append("<tr><td>ID:</td><td><button onclick='Run.container.lookupContainer(this, " + i + ");' type='button' class='right-button ui-state-default ui-corner-all'>Lookup</button><div style='overflow:hidden'><input type='text' id='sequencerPartitionContainers[" + i + "].identificationBarcode' name='sequencerPartitionContainers[" + i + "].identificationBarcode'/></div></td></tr>");
        b.append("<tr><td>Location:</td><td><input type='text' id='sequencerPartitionContainers[" + i + "].locationBarcode' name='sequencerPartitionContainers[" + i + "].locationBarcode'/></td></tr>");
        b.append("<tr><td>Paired:</td><td><input type='checkbox' id='sequencerPartitionContainers[" + i + "].paired' name='sequencerPartitionContainers[" + i + "].paired' value='false'/></td></tr>");
        b.append("</table>");
        b.append("<div id='partitionErrorDiv'> </div>");
        b.append("<div id='partitionDiv'>");
        b.append("<table class='in'>");
        b.append("<th>Lane No.</th>");
        b.append("<th>Pool</th>");

        b.append("<tr><td>1 </td><td width='90%'><div id='p_div_" + i + "-0' class='elementListDroppableDiv'><ul class='runPartitionDroppable' bind='sequencerPartitionContainers[" + i + "].partitions[0].pool' partition='" + i + "_0'></ul></div></td></tr>");
        b.append("<tr><td>2 </td><td width='90%'><div id='p_div_" + i + "-1' class='elementListDroppableDiv'><ul class='runPartitionDroppable' bind='sequencerPartitionContainers[" + i + "].partitions[1].pool' partition='" + i + "_1'></ul></div></td></tr>");
        b.append("<tr><td>3 </td><td width='90%'><div id='p_div_" + i + "-2' class='elementListDroppableDiv'><ul class='runPartitionDroppable' bind='sequencerPartitionContainers[" + i + "].partitions[2].pool' partition='" + i + "_2'></ul></div></td></tr>");
        b.append("<tr><td>4 </td><td width='90%'><div id='p_div_" + i + "-3' class='elementListDroppableDiv'><ul class='runPartitionDroppable' bind='sequencerPartitionContainers[" + i + "].partitions[3].pool' partition='" + i + "_3'></ul></div></td></tr>");
        b.append("<tr><td>5 </td><td width='90%'><div id='p_div_" + i + "-4' class='elementListDroppableDiv'><ul class='runPartitionDroppable' bind='sequencerPartitionContainers[" + i + "].partitions[4].pool' partition='" + i + "_4'></ul></div></td></tr>");
        b.append("<tr><td>6 </td><td width='90%'><div id='p_div_" + i + "-5' class='elementListDroppableDiv'><ul class='runPartitionDroppable' bind='sequencerPartitionContainers[" + i + "].partitions[5].pool' partition='" + i + "_5'></ul></div></td></tr>");
        b.append("<tr><td>7 </td><td width='90%'><div id='p_div_" + i + "-6' class='elementListDroppableDiv'><ul class='runPartitionDroppable' bind='sequencerPartitionContainers[" + i + "].partitions[6].pool' partition='" + i + "_6'></ul></div></td></tr>");
        b.append("<tr><td>8 </td><td width='90%'><div id='p_div_" + i + "-7' class='elementListDroppableDiv'><ul class='runPartitionDroppable' bind='sequencerPartitionContainers[" + i + "].partitions[7].pool' partition='" + i + "_7'></ul></div></td></tr>");
        b.append("</table>");
        b.append("</div>");

        SequencerPartitionContainer<SequencerPoolPartition> f = dataObjectFactory.getSequencerPartitionContainer();
        f.initEmptyPartitions();
        run.addSequencerPartitionContainer(f);
      }
    }
    return JSONUtils.SimpleJSONResponse(b.toString());
  }
View Full Code Here

    StringBuilder b = new StringBuilder();
    b.append("<table class='in'>");
    b.append("<th>Lane No.</th>");
    b.append("<th>Pool</th>");

    IlluminaRun run = (IlluminaRun) session.getAttribute("run_" + json.getString("run_cId"));
    SequencerPartitionContainer<SequencerPoolPartition> f = run.getSequencerPartitionContainers().get(container);
    f.setPartitionLimit(numLanes);
    f.initEmptyPartitions();

    for (int i = 0; i < numLanes; i++) {
      b.append("<tr><td>" + (i + 1) + "</td>");
View Full Code Here

    }
  }

  public JSONObject generateIlluminaDemultiplexCSV(HttpSession session, JSONObject json) throws IOException {
    User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
    IlluminaRun r = (IlluminaRun) requestManager.getRunById(json.getLong("runId"));
    SequencerPartitionContainer<SequencerPoolPartition> f = requestManager.getSequencerPartitionContainerById(json.getLong("containerId"));
    if (r != null && f != null) {
      String casavaVersion = "1.8.2";
      if (json.has("casavaVersion") && !"".equals(json.getString("casavaVersion"))) {
        casavaVersion = json.getString("casavaVersion");
View Full Code Here

  public Run getRun(User user) {
    return new RunImpl(user);
  }

  public Run getIlluminaRun() {
    return new IlluminaRun();
  }
View Full Code Here

  public Run getIlluminaRun() {
    return new IlluminaRun();
  }

  public Run getIlluminaRun(User user) {
    return new IlluminaRun(user);
  }
View Full Code Here

    return new IlluminaRun(user);
  }

  public Run getIlluminaRun(Experiment experiment, User user) {
    if (experiment.userCanWrite(user)) {
      return new IlluminaRun(user);
    }
    else {
      throw new SecurityException();
    }
  }
View Full Code Here

      sb.append("Processing " + runName);
      log.debug("Processing " + runName);
      Status is = new IlluminaStatus();
      is.setRunName(runName);

      Run r = new IlluminaRun();
      r.setPlatformRunId(0);
      r.setAlias(runName);
      r.setFilePath(runName);
      r.setDescription("Test Run Import");
      r.setPairedEnd(false);
      is.setHealth(ht);
      r.setStatus(is);

      updatedRuns.put(r.getAlias(), r);
      sb.append("...done\n");
    }

    log.info(sb.toString());
    return updatedRuns;
View Full Code Here

TOP

Related Classes of uk.ac.bbsrc.tgac.miso.core.data.impl.illumina.IlluminaRun

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.