Package picard.illumina

# Class BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD>

java.lang.Object
picard.illumina.BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD>

Type Parameters:
  `CLUSTER_OUTPUT_RECORD` - The type of records that the built converter will output.

public class BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD> extends Object
BasecallsConverterBuilder creates and configures BasecallsConverter objects. It builds and returns a BasecallsConverter that includes record sorting.

## Constructor Summary

Constructors
Constructor
Description
`BasecallsConverterBuilder(File basecallsDir, int[] lanes, ReadStructure readStructure, Map<String,? extends htsjdk.io.Writer<CLUSTER_OUTPUT_RECORD>> barcodeRecordWriterMap)`
Constructs a new builder used for creating BasecallsConverter objects.

## Method Summary

Modifier and Type
Method
Description
`BasecallsConverter<CLUSTER_OUTPUT_RECORD>`
`build()`
Builds a basecalls converter
`BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD>`
`firstTile(Integer firstTile)`
Configures the first tile that the converter will begin processing at.
`BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD>`
`numProcessors(int numProcessors)`
Configures how many processors this converter will use.
`BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD>`
`tileLimit(Integer tileLimit)`
Configures the total number of tiles that the converter will process.
`BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD>`
`withApplyEamssFiltering(boolean applyEamssFiltering)`
Configures whether or not the converter will apply EAMSS filtering.
`BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD>`
`withAsyncWriterPool(htsjdk.io.AsyncWriterPool writerPool)`
`BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD>`
`withBarcodeExtractor(BarcodeExtractor barcodeExtractor)`
`BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD>`
`withBarcodesDir(File barcodesDir)`
Configure the director used to find barcode files created by ExtractIlluminaBarcodes.
`BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD>`
`withBclQualityEvaluationStrategy(BclQualityEvaluationStrategy bclQualityEvaluationStrategy)`
Configures the bcl quality evaluation strategy that the converter will apply.
`BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD>`
`withDemultiplex(boolean demultiplex)`
Configures whether or not the converter will demultiplex reads by barcode.
`BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD>`
`withIgnoreUnexpectedBarcodes(boolean ignoreUnexpectedBarcodes)`
Configures whether or not the converter will ignore unexpected barcodes or throw an exception if one is found.
`BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD>`
`withIncludeNonPfReads(boolean includeNonPfReads)`
Configures whether or not the converter will ignore non-PF reads.
`BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD>`
`withMaxRecordsInRam(int maxReadsInRam)`
Specify the max number of records in RAM.
`BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD>`
`withSorting(Comparator<CLUSTER_OUTPUT_RECORD> outputRecordComparator, htsjdk.samtools.util.SortingCollection.Codec<CLUSTER_OUTPUT_RECORD> codecPrototype, Class<CLUSTER_OUTPUT_RECORD> outputRecordClass, List<File> tmpDirs)`
Builds a new sorting basecalls converter.

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

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

## Constructor Details

### BasecallsConverterBuilder

public BasecallsConverterBuilder(File basecallsDir, int[] lanes, ReadStructure readStructure, Map<String,? extends htsjdk.io.Writer<CLUSTER_OUTPUT_RECORD>> barcodeRecordWriterMap)
Constructs a new builder used for creating BasecallsConverter objects.

Parameters:
  `basecallsDir` - Where to read basecalls from.
  `lanes` - What lanes to process.
  `readStructure` - How to interpret each cluster.
  `barcodeRecordWriterMap` - Map from barcode to CLUSTER_OUTPUT_RECORD writer. If demultiplex is false, must contain one writer stored with key=null.

## Method Details

### withSorting

public BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD> withSorting(Comparator<CLUSTER_OUTPUT_RECORD> outputRecordComparator, htsjdk.samtools.util.SortingCollection.Codec<CLUSTER_OUTPUT_RECORD> codecPrototype, Class<CLUSTER_OUTPUT_RECORD> outputRecordClass, List<File> tmpDirs)
Builds a new sorting basecalls converter.

Parameters:
  `outputRecordComparator` - For sorting output records within a single tile.
  `codecPrototype` - For spilling output records to disk.
  `outputRecordClass` - Class needed to create SortingCollections.
  `tmpDirs` - For SortingCollection spilling.
Returns:
  A basecalls converter that will output sorted records.

### build

public BasecallsConverter<CLUSTER_OUTPUT_RECORD> build()
Builds a basecalls converter

Returns:
  A basecalls converter that will output records according to the parameters set.

### withIgnoreUnexpectedBarcodes

public BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD> withIgnoreUnexpectedBarcodes(boolean ignoreUnexpectedBarcodes)
Configures whether or not the converter will ignore unexpected barcodes or throw an exception if one is found.

Parameters:
  `ignoreUnexpectedBarcodes` - If true, will ignore reads whose called barcode is not found in barcodeRecordWriterMap.
Returns:
  A builder that will create a converter with the ignoreUnexpectedBarcodes boolean set.

### withApplyEamssFiltering

public BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD> withApplyEamssFiltering(boolean applyEamssFiltering)
Configures whether or not the converter will apply EAMSS filtering.

Parameters:
  `applyEamssFiltering` - If true, apply EAMSS filtering if parsing BCLs for bases and quality scores.
Returns:
  A builder that will create a converter with the applyEamssFiltering boolean set.

### withIncludeNonPfReads

public BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD> withIncludeNonPfReads(boolean includeNonPfReads)
Configures whether or not the converter will ignore non-PF reads.

Parameters:
  `includeNonPfReads` - If true, will include ALL reads (including those which do not have PF set). This option does nothing for instruments that output cbcls (Novaseqs)
Returns:
  A builder that will create a converter with the includeNonPfReads boolean set.

### withBclQualityEvaluationStrategy

public BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD> withBclQualityEvaluationStrategy(BclQualityEvaluationStrategy bclQualityEvaluationStrategy)
Configures the bcl quality evaluation strategy that the converter will apply.

Parameters:
  `bclQualityEvaluationStrategy` - The mechanism for revising and evaluating qualities read from a BCL file
Returns:
  A builder that will create a converter with the bclQualityEvaluationStrategy set.

### tileLimit

public BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD> tileLimit(Integer tileLimit)
Configures the total number of tiles that the converter will process.

Parameters:
  `tileLimit` - If non-null, process no more than this many tiles.
Returns:
  A builder that will create a converter with tileLimit set.

### firstTile

public BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD> firstTile(Integer firstTile)
Configures the first tile that the converter will begin processing at.

Parameters:
  `firstTile` - If non-null, start processing at this tile.
Returns:
  A builder that will create a converter with firstTile set.

### numProcessors

public BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD> numProcessors(int numProcessors)
Configures how many processors this converter will use.

Parameters:
  `numProcessors` - Controls number of threads. If <= 0, the number of threads allocated is available cores - numProcessors.
Returns:
  A builder that will create a converter with numProcessors set.

### withDemultiplex

public BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD> withDemultiplex(boolean demultiplex)
Configures whether or not the converter will demultiplex reads by barcode.

Parameters:
  `demultiplex` - If true, output is split by barcode, otherwise all are written to the same output stream.
Returns:
  A builder that will create a converter with demultiplex set.

### withBarcodesDir

public BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD> withBarcodesDir(File barcodesDir)
Configure the director used to find barcode files created by ExtractIlluminaBarcodes. These files are used to demultiplex reads.

Parameters:
  `barcodesDir` - Where to read barcodes from (optional; use basecallsDir if not specified).
Returns:
  A builder that will create a converter with barcodesDir set.

### withMaxRecordsInRam

public BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD> withMaxRecordsInRam(int maxReadsInRam)
Specify the max number of records in RAM. This is divided by the number of tile processing threads and sets the max number of records in RAM per tile.

Parameters:
  `maxReadsInRam` - The maximum number of records in RAM to store for each tile before spilling to disk.
Returns:
  A builder that will create a converter with the maximum records in RAM set to `maxReadsInRam/numThreads`

### withAsyncWriterPool

public BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD> withAsyncWriterPool(htsjdk.io.AsyncWriterPool writerPool)

### withBarcodeExtractor

public BasecallsConverterBuilder<CLUSTER_OUTPUT_RECORD> withBarcodeExtractor(BarcodeExtractor barcodeExtractor)