Class ParameterizedFileUtil

java.lang.Object
picard.illumina.parser.ParameterizedFileUtil
Direct Known Subclasses:
MultiTileBclFileUtil, MultiTileFileUtil, PerTileFileUtil, PerTilePerCycleFileUtil

public abstract class ParameterizedFileUtil extends Object
  • Field Details

    • PER_TILE_PATTERN_STRING

      public static final String PER_TILE_PATTERN_STRING
      See Also:
    • 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:
    • 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)