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

Examples of uk.ac.bbsrc.tgac.miso.core.data.Run


  public JSONObject getRunStats(HttpSession session, JSONObject json) {
    if (runStatsManager != null) {
      Long runId = json.getLong("runId");
      try {
        Run run = requestManager.getRunById(runId);
        return runStatsManager.getSummaryStatsForRun(run);
      }
      catch (IOException e) {
        e.printStackTrace();
        return JSONUtils.SimpleJSONError("Cannot retrieve run: " + e.getMessage());
View Full Code Here


  public JSONObject getPartitionStats(HttpSession session, JSONObject json) {
    if (runStatsManager != null) {
      Long runId = json.getLong("runId");
      Integer partitionNumber = json.getInt("partitionNumber");
      try {
        Run run = requestManager.getRunById(runId);
        return runStatsManager.getSummaryStatsForLane(run, partitionNumber);
      }
      catch (IOException e) {
        e.printStackTrace();
        return JSONUtils.SimpleJSONError("Cannot retrieve run: " + e.getMessage());
View Full Code Here

  public JSONObject getSummaryRunstatsDiagram(HttpSession session, JSONObject json) {
    Long runId = json.getLong("runId");
    Integer lane = json.getInt("lane");
    StringBuilder b = new StringBuilder();
    try {
      Run run = requestManager.getRunById(runId);
      JSONObject resultJson = runStatsManager.getPerPositionBaseSequenceQualityForLane(run, lane);
      return resultJson;
    }
    catch (IOException e) {
      log.debug("Failed", e);
View Full Code Here

  public JSONObject getPerPositionBaseContentDiagram(HttpSession session, JSONObject json) {
    Long runId = json.getLong("runId");
    Integer lane = json.getInt("lane");
    StringBuilder b = new StringBuilder();
    try {
      Run run = requestManager.getRunById(runId);
      JSONObject resultJson = runStatsManager.getPerPositionBaseContentForLane(run, lane);
      return resultJson;
    }
    catch (IOException e) {
      log.debug("Failed", e);
View Full Code Here

  @Override
  public boolean respondsTo(Event event) {
    if (event instanceof RunEvent) {
      RunEvent re = (RunEvent)event;
      Run r = re.getEventObject();
      log.info("Checking responder for run " + r.getId());
      if (r.getStatus() != null) {
        Status s = r.getStatus();
        if (s.getHealth().equals(HealthType.Failed) || s.getHealth().equals(HealthType.Completed)) {
          return true;
        }
      }
    }
View Full Code Here

    update(misoRequestManager.getRunById(runId));
  }

  private void update(Run r) throws IOException {
    if (enabled) {
      Run clone = runs.get(r.getId());
      if (clone == null) {
        log.debug("Update: no clone - pushing");
        //new run - add all RunWatchers!
        for (User u : securityManager.listUsersByGroupName("RunWatchers")) {
          r.addWatcher(u);
        }
        push(r);
      }
      else {
        log.debug("Update: got clone of " + clone.getId());
        if (r.getStatus() != null) {
          clone.setStatus(r.getStatus());
        }

        //run QC added
        if (r.getRunQCs().size() > clone.getRunQCs().size()) {
          Set<RunQC> clonedQCs = new HashSet<RunQC>(clone.getRunQCs());
          for (RunQC qc : r.getRunQCs()) {
            if (!clonedQCs.contains(qc)) {
              try {
                clone.addQc(cloner.deepClone(qc));
              }
              catch (MalformedRunQcException e) {
                throw new IOException(e);
              }
            }
View Full Code Here

  }

  public void addWatcher(Run run, Long userId) throws IOException {
    User user = securityManager.getUserById(userId);
    if (user != null) {
      Run clone = runs.get(run.getId());
      if (clone == null) {
        run.addWatcher(user);
        push(run);
      }
      else {
        clone.addWatcher(user);
      }
    }
  }
View Full Code Here

  }

  public void removeWatcher(Run run, Long userId) throws IOException {
    User user = securityManager.getUserById(userId);
    if (user != null) {
      Run clone = runs.get(run.getId());
      if (clone == null) {
        run.removeWatcher(user);
        push(run);
      }
      else {
        clone.removeWatcher(user);
      }
    }
  }
View Full Code Here

    }
    else if (a.getJSONObject(0).getString("value").equals("Run")) {
      for (JSONObject j : (Iterable<JSONObject>) a) {
        if (j.getString("name").equals("ids")) {
          try {
            Run r = requestManager.getRunById(new Long(j.getString("value")));
            if (r != null) {
              reportables.add(r);
            }
          }
          catch (IOException e) {
View Full Code Here

  @Override
  public boolean respondsTo(Event event) {
    if (event instanceof RunEvent) {
      RunEvent re = (RunEvent)event;
      Run r = re.getEventObject();
      if (re.getEventType().equals(MisoEventType.RUN_QC_ADDED) && r.getRunQCs() != null && !r.getRunQCs().isEmpty()) {
        log.info("Run "+ r.getAlias() +": " + re.getEventMessage());
        return true;
      }
    }
    return false;
  }
View Full Code Here

TOP

Related Classes of uk.ac.bbsrc.tgac.miso.core.data.Run

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.