Example #1
0
  public static ClusterData makeCd(
      final int lane,
      final int tile,
      final int xCoord,
      final int yCoord,
      final boolean pf,
      final byte[] bases,
      final byte[] qualities,
      final String matchedBarcode) {
    final ReadData rd = new ReadData();
    rd.setBases(Arrays.copyOf(bases, bases.length));
    rd.setQualities(Arrays.copyOf(qualities, bases.length));
    rd.setReadType(
        ReadType.T); // This will be ignored, as the cluster will be chopped up by ReadStructure

    final ClusterData cd = new ClusterData(rd);
    cd.setLane(lane);
    cd.setTile(tile);
    cd.setX(xCoord);
    cd.setY(yCoord);
    cd.setPf(pf);
    cd.setMatchedBarcode(matchedBarcode);

    return cd;
  }
Example #2
0
  public static ClusterData selectiveCopyCd(
      final ClusterData toCopy, final String readStructure, final IlluminaDataType... dataTypes) {
    final ReadStructure rs = new ReadStructure(readStructure);
    final ReadData[] rd = copyReadData(rs, dataTypes, toCopy);
    final ClusterData cd = new ClusterData(rd);
    cd.setTile(toCopy.getTile());
    cd.setLane(toCopy.getLane());

    for (final IlluminaDataType idt : dataTypes) {
      switch (idt) {
        case Position:
          cd.setX(toCopy.getX());
          cd.setY(toCopy.getY());
          break;

        case PF:
          cd.setPf(toCopy.isPf());
          break;

        case Barcodes:
          cd.setMatchedBarcode(toCopy.getMatchedBarcode());
          break;

        default:
          break;
      }
    }

    return cd;
  }