Package uk.ac.bbsrc.tgac.qc.run

Examples of uk.ac.bbsrc.tgac.qc.run.ReportTable


  public boolean hasStatsForRun(Run run) throws RunStatsException {
    Map<RunProperty, String> map = new HashMap<RunProperty, String>();
    map.put(RunProperty.run, run.getAlias());
    try {
      ReportTable rt = reports.getAverageValues(map);
      return rt != null && !rt.isEmpty();
    }
    catch (SQLException e) {
      e.printStackTrace();
      return false;
    }
View Full Code Here


    }
  }

  public JSONObject getSummaryStatsForRun(Run run) throws RunStatsException {
    JSONObject report = new JSONObject();
    ReportTable rt;

    Map<RunProperty, String> map = new HashMap<RunProperty, String>();
    map.put(RunProperty.run, run.getAlias());
    try {
      rt = reports.getAverageValues(map);
      if (rt == null) {
        return null;
      }
      report.put("runSummary", JSONArray.fromObject(rt.toJSON()));
    }
    catch (SQLException e) {
      e.printStackTrace();
    }
    catch (IOException e) {
      e.printStackTrace();
    }

    if (!((RunImpl) run).getSequencerPartitionContainers().isEmpty()) {
      JSONObject containers = new JSONObject();
      for (SequencerPartitionContainer<SequencerPoolPartition> container : ((RunImpl) run).getSequencerPartitionContainers()) {
        JSONObject f = new JSONObject();
        f.put("idBarcode", container.getIdentificationBarcode());

        JSONArray partitions = new JSONArray();
        for (SequencerPoolPartition part : container.getPartitions()) {
          JSONObject partition = new JSONObject();

          map.put(RunProperty.lane, Integer.toString(part.getPartitionNumber()));

          try {
            rt = reports.getAverageValues(map);
            if (rt != null) {
              partition.put("partitionSummary", JSONArray.fromObject(rt.toJSON()));
            }
          }
          catch (SQLException e) {
            e.printStackTrace();
          }
          catch (IOException e) {
            e.printStackTrace();
          }

          //clear any previous barcode query
          map.remove(RunProperty.barcode);
          if (part.getPool() != null) {
            Pool<? extends Poolable> pool = part.getPool();
            for (Dilution d : pool.getDilutions()) {
              Library l = d.getLibrary();
              if (!l.getTagBarcodes().isEmpty()) {
                for (TagBarcode tb : l.getTagBarcodes().values()) {
                  map.remove(RunProperty.barcode);
                  try {
                    map.put(RunProperty.barcode, tb.getSequence());
                    rt = reports.getAverageValues(map);
                    if (rt != null) {
                      partition.put(tb.getSequence(), JSONArray.fromObject(rt.toJSON()));
                    }
                  }
                  catch (SQLException e) {
                    e.printStackTrace();
                  }
View Full Code Here

  public JSONObject getSummaryStatsForLane(Run run, int laneNumber) throws RunStatsException {
    Map<RunProperty, String> map = new HashMap<RunProperty, String>();
    map.put(RunProperty.run, run.getAlias());
    map.put(RunProperty.lane, String.valueOf(laneNumber));
    ReportTable rt;

    JSONObject partition = new JSONObject();
    try {
      rt = reports.getAverageValues(map);
      if (rt != null) {
        partition.put("partitionSummary", JSONArray.fromObject(rt.toJSON()));
      }
    }
    catch (SQLException e) {
      e.printStackTrace();
    }
    catch (IOException e) {
      e.printStackTrace();
    }

    //clear any previous barcode query
    map.remove(RunProperty.barcode);
    if (!((RunImpl) run).getSequencerPartitionContainers().isEmpty()) {
      for (SequencerPartitionContainer<SequencerPoolPartition> container : ((RunImpl) run).getSequencerPartitionContainers()) {
        SequencerPoolPartition part = container.getPartitionAt(laneNumber);
        if (part.getPartitionNumber() == laneNumber) {
          if (part.getPool() != null) {
            Pool<? extends Poolable> pool = part.getPool();
            for (Dilution d : pool.getDilutions()) {
              Library l = d.getLibrary();
              if (!l.getTagBarcodes().isEmpty()) {
                for (TagBarcode tb : l.getTagBarcodes().values()) {
                  map.remove(RunProperty.barcode);
                  try {
                    map.put(RunProperty.barcode, tb.getSequence());
                    rt = reports.getAverageValues(map);
                    if (rt != null) {
                      partition.put(tb.getSequence(), JSONArray.fromObject(rt.toJSON()));
                    }
                  }
                  catch (SQLException e) {
                    e.printStackTrace();
                  }
View Full Code Here

TOP

Related Classes of uk.ac.bbsrc.tgac.qc.run.ReportTable

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.