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 FilebaseIf 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 booleanDefaultSkipEmptyFilesprotected StringextensionThe file extension for this class, file extension does not have the standard meaning in this instance.protected FileFakerfakerprotected intlaneprotected PatternmatchPatternA pattern that will match files of this type for this lanestatic StringPER_TILE_PATTERN_STRINGprotected booleanskipEmptyFilesprotected 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
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancheckTileCount()static StringescapePeriods(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 booleanfilesAvailable()Determine whether or not files are availableprotected IntegerfileToTile(String fileName)Returns only lane and tile information as PerTileFt's do not have End information.protected FilegetRunFile(File baseDirectory, Pattern pattern)protected picard.illumina.parser.IlluminaFileMapgetTiledFiles(File baseDirectory, Pattern pattern)Return all files that match pattern of the given file type in the given base directoryList<Integer>getTiles()Return a list of all tiles available for this file format and runstatic StringmakeBarcodeRegex(int lane)static StringmakeLaneTileRegex(String fileNameEndPattern, int lane)Return a regex string for finding Lane and Tile given a file extension patternvoidsetTiles(List<Integer> tiles)voidsetTilesForPerRunFile(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
-
-
-
Field Detail
-
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
-
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 Detail
-
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)
-
-
Method Detail
-
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 numbersexpectedCycles- 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 numberscycles- An ordered list of cycle numbers that may contain gapsformat- 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
-
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
-
checkTileCount
public boolean checkTileCount()
-
makeBarcodeRegex
public static String makeBarcodeRegex(int lane)
-
-