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

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


    return sequencerReference.getId();
  }

  public SequencerReference get(long id) throws IOException {
    List eResults = template.query(SEQUENCER_REFERENCE_SELECT_BY_ID, new Object[]{id}, new SequencerReferenceMapper());
    SequencerReference e = eResults.size() > 0 ? (SequencerReference) eResults.get(0) : null;
    return e;
  }
View Full Code Here


    return e;
  }

  public SequencerReference getByRunId(long runId) throws IOException {
    List eResults = template.query(SEQUENCER_REFERENCE_SELECT_BY_RELATED_RUN, new Object[]{runId}, new SequencerReferenceMapper());
    SequencerReference e = eResults.size() > 0 ? (SequencerReference) eResults.get(0) : null;
    return e;
  }
View Full Code Here

    return e;
  }

  public SequencerReference getByName(String referenceName) throws IOException {
    List eResults = template.query(SEQUENCER_REFERENCE_SELECT_BY_NAME, new Object[]{referenceName}, new SequencerReferenceMapper());
    SequencerReference e = eResults.size() > 0 ? (SequencerReference) eResults.get(0) : null;
    return e;
  }
View Full Code Here

                                 new MapSqlParameterSource().addValue("referenceId", r.getId())) == 1));
  }

  public class SequencerReferenceMapper implements RowMapper<SequencerReference> {
    public SequencerReference mapRow(ResultSet rs, int rowNum) throws SQLException {
      SequencerReference c = dataObjectFactory.getSequencerReference();

      try {
        if (c != null) {
          c.setId(rs.getLong("referenceId"));
          c.setName(rs.getString("name"));
          c.setPlatform(platformDAO.get(rs.getLong("platformId")));
          c.setAvailable(rs.getBoolean("available"));

          Blob ipBlob = rs.getBlob("ipAddress");
          if (ipBlob != null) {
            if (ipBlob.length() > 0) {
              byte[] rbytes = ipBlob.getBytes(1, (int)ipBlob.length());
              c.setIpAddress(InetAddress.getByAddress(rbytes));
            }
          }
        }
      }
      catch (IOException e1) {
View Full Code Here

    return new ModelAndView("/pages/viewStats.jsp", model);
  }

  @RequestMapping(value = "/sequencer/{referenceId}", method = RequestMethod.GET)
  public ModelAndView viewSequencer(@PathVariable(value = "referenceId") Long referenceId, ModelMap model) throws IOException {
    SequencerReference sr = requestManager.getSequencerReferenceById(referenceId);
    if (sr != null) {
      model.put("sequencerReference", sr);
      String ip = sr.getIpAddress().toString();
      if (ip.startsWith("/")) {
        model.put("trimmedIpAddress", ip.substring(1));
      }
      else {
        model.put("trimmedIpAddress", ip);
View Full Code Here

  }

  @RequestMapping(value = "/ls454/{referenceId}", method = RequestMethod.GET)
  public ModelAndView ls454Stats(@PathVariable(value = "referenceId") Long referenceId, ModelMap model) throws IOException {
    model.put("platformtype", PlatformType.LS454);
    SequencerReference sr = requestManager.getSequencerReferenceById(referenceId);
    if (sr != null) {
      if (!sr.getPlatform().getPlatformType().equals(PlatformType.LS454)) {
        throw new IOException("Trying to interrogate a " + sr.getPlatform().getPlatformType().getKey() + " sequencer reference with a 454 strategy");
      }
      try {
        SequencerInterrogator context = SequencerInterrogatorFactory.getSequencerInterrogator(sr);

        model.put("stats", context.listAllStatus());
        model.put("referenceName", sr.getName());
        model.put("referenceId", sr.getId());
      }
      catch (InterrogationException e) {
        model.put("error", MisoWebUtils.generateErrorDivMessage("Cannot retrieve status information for the given sequencer reference: " + sr.getName(), e.getMessage()));
        log.info(e.getMessage());
        e.printStackTrace();
      }
    }
    else {
View Full Code Here

  }

  @RequestMapping(value = "/ls454/{referenceId}/{runName}", method = RequestMethod.GET)
  public ModelAndView ls454Stats(@PathVariable(value = "referenceId") Long referenceId, @PathVariable(value = "runName") String runName, ModelMap model) throws IOException {
    model.put("platformtype", PlatformType.LS454);
    SequencerReference sr = requestManager.getSequencerReferenceById(referenceId);
    if (sr != null) {
      if (!sr.getPlatform().getPlatformType().equals(PlatformType.LS454)) {
        throw new IOException("Trying to interrogate a " + sr.getPlatform().getPlatformType().getKey() + " sequencer reference with a 454 strategy");
      }
      try {
        SequencerInterrogator context = SequencerInterrogatorFactory.getSequencerInterrogator(sr);
        Status status = context.getRunStatus(runName);
        if (status != null) {
          model.put("referenceName", sr.getName());
          model.put("referenceId", sr.getId());
          model.put("runId", requestManager.getRunByAlias(runName).getId());
          model.put("runName", runName);
          model.put("runStatus", status);
        }
        else {
          model.put("error", MisoWebUtils.generateErrorDivMessage("Cannot consume the xml file for the given run name: " + runName));
        }
      }
      catch (InterrogationException e) {
        model.put("error", MisoWebUtils.generateErrorDivMessage("Cannot retrieve status information for the given sequencer reference: " + sr.getName(), e.getMessage()));
        log.info(e.getMessage());
        e.printStackTrace();
      }
    }
    else {
View Full Code Here

  }

  @RequestMapping(value = "/illumina/{referenceId}", method = RequestMethod.GET)
  public ModelAndView illuminaStats(@PathVariable(value = "referenceId") Long referenceId, ModelMap model) throws IOException {
    model.put("platformtype", PlatformType.ILLUMINA.getKey().toLowerCase());
    SequencerReference sr = requestManager.getSequencerReferenceById(referenceId);
    if (sr != null) {
      if (!sr.getPlatform().getPlatformType().equals(PlatformType.ILLUMINA)) {
        throw new IOException("Trying to interrogate a " + sr.getPlatform().getPlatformType().getKey() + " sequencer reference with an Illumina strategy");
      }
      model.put("stats", requestManager.listAllStatusBySequencerName(sr.getName()));
      model.put("referenceName", sr.getName());
      model.put("referenceId", sr.getId());
    }
    else {
      model.put("error", "Cannot retrieve the given sequencer reference: " + referenceId);
    }
    return new ModelAndView("/pages/viewStats.jsp", model);
View Full Code Here

  }

  @RequestMapping(value = "/illumina/{referenceId}/{runName}", method = RequestMethod.GET)
  public ModelAndView illuminaStats(@PathVariable(value = "referenceId") Long referenceId, @PathVariable(value = "runName") String runName, ModelMap model) throws IOException {
    model.put("platformtype", PlatformType.ILLUMINA);
    SequencerReference sr = requestManager.getSequencerReferenceById(referenceId);
    if (sr != null) {
      if (!sr.getPlatform().getPlatformType().equals(PlatformType.ILLUMINA)) {
        throw new IOException("Trying to interrogate a " + sr.getPlatform().getPlatformType().getKey() + " sequencer reference with an Illumina strategy");
      }
     
      try {
        Status status = requestManager.getStatusByRunName(runName);
        if (status != null) {
          model.put("referenceName", sr.getName());
          model.put("referenceId", sr.getId());
          model.put("runId", requestManager.getRunByAlias(runName).getId());
          model.put("runName", runName);
          model.put("runStatus", status);

          InputStream in = StatsController.class.getResourceAsStream("/status/xsl/illumina/statusXml.xsl");
View Full Code Here

  }

  @RequestMapping(value = "/solid/{referenceId}", method = RequestMethod.GET)
  public ModelAndView solidStats(@PathVariable(value = "referenceId") Long referenceId, ModelMap model) throws IOException {
    model.put("platformtype", PlatformType.SOLID);
    SequencerReference sr = requestManager.getSequencerReferenceById(referenceId);

    if (!sr.getPlatform().getPlatformType().equals(PlatformType.SOLID)) {
      throw new IOException("Trying to interrogate a " + sr.getPlatform().getPlatformType().getKey() + " sequencer reference with a SOLiD strategy");
    }

    if (!sr.getPlatform().getInstrumentModel().contains("5500xl")) {
      SolidService ss = new SolidService(new URL("http://"+sr.getFQDN()+":8080/sets/webservice/solid?wsdl"), new QName("http://solid.aga.appliedbiosystems.com", "SolidService"));
      StringBuilder sb = new StringBuilder();
      try {
        InputStream in = StatsController.class.getResourceAsStream("/integration/solid/xsl/clusterStatus.xsl");
        if (in != null) {
          String xsl = LimsUtils.inputStreamToString(in);
          sb.append(SubmissionUtils.xslTransform(ss.getSolidPort().getClusterStatus().getXml(), xsl));
        }
      }
      catch (TransformerException e) {
        sb.append("Unable to transform Cluster Status XML: " + e.getMessage());
        e.printStackTrace();
      }
      model.put("clusterStatus", sb.toString());
    }
   
    model.put("stats", requestManager.listAllStatusBySequencerName(sr.getName()));
    model.put("referenceName", sr.getName());
    model.put("referenceId", sr.getId());

    return new ModelAndView("/pages/viewStats.jsp", model);
  }
View Full Code Here

TOP

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

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.