Package picard.illumina

## Class ExtractIlluminaBarcodes.PerTileBarcodeExtractor

- java.lang.Object
- - picard.illumina.ExtractIlluminaBarcodes.PerTileBarcodeExtractor

- All Implemented Interfaces:
    `Runnable`
  Enclosing class:
    ExtractIlluminaBarcodes

      public static class ExtractIlluminaBarcodes.PerTileBarcodeExtractor
      extends Object
      implements Runnable

  Extracts barcodes and accumulates metrics for an entire tile.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `ExtractIlluminaBarcodes.PerTileBarcodeExtractor.BarcodeMatch` | Utility class to hang onto data about the best match for a given barcode

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PerTileBarcodeExtractor​(int tile, File barcodeFile, Map<String,​ExtractIlluminaBarcodes.BarcodeMetric> barcodeToMetrics, ExtractIlluminaBarcodes.BarcodeMetric noMatchMetric, IlluminaDataProviderFactory factory, int minimumBaseQuality, int maxNoCalls, int maxMismatches, int minMismatchDelta)` | Constructor
    `PerTileBarcodeExtractor​(int tile, File barcodeFile, Map<String,​ExtractIlluminaBarcodes.BarcodeMetric> barcodeToMetrics, ExtractIlluminaBarcodes.BarcodeMetric noMatchMetric, IlluminaDataProviderFactory factory, int minimumBaseQuality, int maxNoCalls, int maxMismatches, int minMismatchDelta, List<File> cbcls, List<AbstractIlluminaPositionFileReader.PositionInfo> locs, File[] filterFiles)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---

    `static ExtractIlluminaBarcodes.PerTileBarcodeExtractor.BarcodeMatch`

    `findBestBarcodeAndUpdateMetrics​(byte[][] readSubsequences, byte[][] qualityScores, boolean passingFilter, Map<String,​ExtractIlluminaBarcodes.BarcodeMetric> metrics, ExtractIlluminaBarcodes.BarcodeMetric noMatchBarcodeMetric, int maxNoCalls, int maxMismatches, int minMismatchDelta, int minimumBaseQuality)`

    Find the best barcode match for the given read sequence, and accumulate metrics

    `Exception` | `getException()` |
    `Map<String,​ExtractIlluminaBarcodes.BarcodeMetric>` | `getMetrics()` |
    `ExtractIlluminaBarcodes.BarcodeMetric` | `getNoMatchMetric()` |
    `void` | `run()` | run method which extracts barcodes and accumulates metrics for an entire tile

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PerTileBarcodeExtractor

          public PerTileBarcodeExtractor​(int tile,
                                         File barcodeFile,
                                         Map<String,​ExtractIlluminaBarcodes.BarcodeMetric> barcodeToMetrics,
                                         ExtractIlluminaBarcodes.BarcodeMetric noMatchMetric,
                                         IlluminaDataProviderFactory factory,
                                         int minimumBaseQuality,
                                         int maxNoCalls,
                                         int maxMismatches,
                                         int minMismatchDelta,
                                         List<File> cbcls,
                                         List<AbstractIlluminaPositionFileReader.PositionInfo> locs,
                                         File[] filterFiles)

    - #### PerTileBarcodeExtractor

          public PerTileBarcodeExtractor​(int tile,
                                         File barcodeFile,
                                         Map<String,​ExtractIlluminaBarcodes.BarcodeMetric> barcodeToMetrics,
                                         ExtractIlluminaBarcodes.BarcodeMetric noMatchMetric,
                                         IlluminaDataProviderFactory factory,
                                         int minimumBaseQuality,
                                         int maxNoCalls,
                                         int maxMismatches,
                                         int minMismatchDelta)

      Constructor
      Parameters:
        `tile` - The number of the tile being processed; used for logging only.
        `barcodeFile` - The file to write the barcodes to
        `noMatchMetric` - A "template" metric that is cloned and the clone is stored internally for accumulating data
        `barcodeToMetrics` - A "template" metric map whose metrics are cloned, and the clones are stored internally for accumulating data

  - ### Method Detail

    - #### getMetrics

          public Map<String,​ExtractIlluminaBarcodes.BarcodeMetric> getMetrics()

    - #### getNoMatchMetric

          public ExtractIlluminaBarcodes.BarcodeMetric getNoMatchMetric()

    - #### getException

          public Exception getException()

    - #### run

          public void run()

      run method which extracts barcodes and accumulates metrics for an entire tile
      Specified by:
        `run` in interface `Runnable`

    - #### findBestBarcodeAndUpdateMetrics

          public static ExtractIlluminaBarcodes.PerTileBarcodeExtractor.BarcodeMatch findBestBarcodeAndUpdateMetrics​(byte[][] readSubsequences,
                                                                                                                     byte[][] qualityScores,
                                                                                                                     boolean passingFilter,
                                                                                                                     Map<String,​ExtractIlluminaBarcodes.BarcodeMetric> metrics,
                                                                                                                     ExtractIlluminaBarcodes.BarcodeMetric noMatchBarcodeMetric,
                                                                                                                     int maxNoCalls,
                                                                                                                     int maxMismatches,
                                                                                                                     int minMismatchDelta,
                                                                                                                     int minimumBaseQuality)

      Find the best barcode match for the given read sequence, and accumulate metrics
      Parameters:
        `readSubsequences` - portion of read containing barcode
        `passingFilter` - PF flag for the current read
      Returns:
        perfect barcode string, if there was a match within tolerance, or null if not.