Package picard.illumina.parser

# Class ParameterizedFileUtil

java.lang.Object
picard.illumina.parser.ParameterizedFileUtil

Direct Known Subclasses:
  `MultiTileBclFileUtil`, `MultiTileFileUtil`, `PerTileFileUtil`, `PerTilePerCycleFileUtil`

public abstract class ParameterizedFileUtil extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final File`
`base`
If you think of the file system as a tree, this is the deepest directory(node) on the tree that still contains all of the files for this given type (e.g.
`protected static final boolean`
`DefaultSkipEmptyFiles`
`protected final String`
`extension`
The file extension for this class, file extension does not have the standard meaning in this instance.
`protected final FileFaker`
`faker`
`protected final int`
`lane`
`protected Pattern`
`matchPattern`
A pattern that will match files of this type for this lane
`static final String`
`PER_TILE_PATTERN_STRING`
`protected final boolean`
`skipEmptyFiles`
`protected List<Integer>`
`tiles`

## Constructor Summary

Constructors
Constructor
Description
`ParameterizedFileUtil(boolean laneTileRegex, String extension, File base, FileFaker faker, int lane)`
`ParameterizedFileUtil(boolean laneTileRegex, String extension, File base, FileFaker faker, int lane, boolean skipEmptyFiles)`
`ParameterizedFileUtil(String pattern, String extension, File base, FileFaker faker, int lane)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`checkTileCount()`
`static String`
`escapePeriods(String preEscaped)`
Escape the period character.
`abstract List<String>`
`fakeFiles(List<Integer> expectedTiles, int[] cycles, IlluminaFileUtil.SupportedIlluminaFormat format)`
Given the expected tiles/expected cycles for this file type create a set of fake files such that the verification criteria are met.
`abstract boolean`
`filesAvailable()`
Determine whether or not files are available
`protected Integer`
`fileToTile(String fileName)`
Returns only lane and tile information as PerTileFt's do not have End information.
`protected File`
`getRunFile(File baseDirectory, Pattern pattern)`
`protected picard.illumina.parser.IlluminaFileMap`
`getTiledFiles(File baseDirectory, Pattern pattern)`
Return all files that match pattern of the given file type in the given base directory
`List<Integer>`
`getTiles()`
Return a list of all tiles available for this file format and run
`static String`
`makeBarcodeRegex(int lane)`
`static String`
`makeLaneTileRegex(String fileNameEndPattern, int lane)`
Return a regex string for finding Lane and Tile given a file extension pattern
`void`
`setTiles(List<Integer> tiles)`
`void`
`setTilesForPerRunFile(List<Integer> tiles)`
`abstract List<String>`
`verify(List<Integer> expectedTiles, int[] expectedCycles)`
Given the expected tiles/expected cycles for this file type, return a list of error messages describing any missing/or malformed files

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

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

## Field Details

### PER_TILE_PATTERN_STRING

public static final String PER_TILE_PATTERN_STRING

See Also:
  - Constant Field Values

### extension

protected final String extension
The file extension for this class, file extension does not have the standard meaning in this instance. It means, all the characters that come after the identifying portion of the file (after lane, tile, and end that is). So _qseq.txt and .filter are both file extensions

### matchPattern

protected Pattern matchPattern
A pattern that will match files of this type for this lane

### lane

protected final int lane

### tiles

protected List<Integer> tiles

### base

protected final File base
If you think of the file system as a tree, this is the deepest directory(node) on the tree that still contains all of the files for this given type (e.g. If we're talking about BCLs the directory structure is:

BaseCall Dir | L001 | | | C1.1 C2.1 ... Cn.1 | | | bcl Files ... bclFiles

L001 is the base because it contains every BCL file in the run (though those files are nested in other folders).

### faker

protected final FileFaker faker

### DefaultSkipEmptyFiles

protected static final boolean DefaultSkipEmptyFiles

See Also:
  - Constant Field Values

### skipEmptyFiles

protected final boolean skipEmptyFiles

## Constructor Details

### ParameterizedFileUtil

public ParameterizedFileUtil(boolean laneTileRegex, String extension, File base, FileFaker faker, int lane, boolean skipEmptyFiles)

### ParameterizedFileUtil

public ParameterizedFileUtil(boolean laneTileRegex, String extension, File base, FileFaker faker, int lane)

### ParameterizedFileUtil

public ParameterizedFileUtil(String pattern, String extension, File base, FileFaker faker, int lane)

## Method Details

### filesAvailable

public abstract boolean filesAvailable()
Determine whether or not files are available

Returns:
  return true if files are found matching this types pattern, false otherwise

### getTiles

public List<Integer> getTiles()
Return a list of all tiles available for this file format and run

Returns:
  A List of tile integers

### verify

public abstract List<String> verify(List<Integer> expectedTiles, int[] expectedCycles)
Given the expected tiles/expected cycles for this file type, return a list of error messages describing any missing/or malformed files

Parameters:
  `expectedTiles` - An ordered list of tile numbers
  `expectedCycles` - An ordered list of cycle numbers that may contain gaps
Returns:
  A list of error messages for this format

### fakeFiles

public abstract List<String> fakeFiles(List<Integer> expectedTiles, int[] cycles, IlluminaFileUtil.SupportedIlluminaFormat format)
Given the expected tiles/expected cycles for this file type create a set of fake files such that the verification criteria are met.

Parameters:
  `expectedTiles` - An ordered list of tile numbers
  `cycles` - An ordered list of cycle numbers that may contain gaps
  `format` - The format of the files that are to be faked
Returns:
  A list of error messages for this format

### fileToTile

protected Integer fileToTile(String fileName)
Returns only lane and tile information as PerTileFt's do not have End information.

Parameters:
  `fileName` - Filename to analyze for data
Returns:
  A LaneTile object with the discovered Lane and Tile information and a null end field.

### makeLaneTileRegex

public static String makeLaneTileRegex(String fileNameEndPattern, int lane)
Return a regex string for finding Lane and Tile given a file extension pattern

### escapePeriods

public static String escapePeriods(String preEscaped)
Escape the period character.

### getRunFile

protected File getRunFile(File baseDirectory, Pattern pattern)

### getTiledFiles

protected picard.illumina.parser.IlluminaFileMap getTiledFiles(File baseDirectory, Pattern pattern)
Return all files that match pattern of the given file type in the given base directory

### setTiles

public void setTiles(List<Integer> tiles)

### setTilesForPerRunFile

public void setTilesForPerRunFile(List<Integer> tiles)

### checkTileCount

public boolean checkTileCount()

### makeBarcodeRegex

public static String makeBarcodeRegex(int lane)