Package picard.util

Class IlluminaUtil


  • public class IlluminaUtil
    extends Object
    Misc utilities for working with Illumina specific files and data
    • Constructor Detail

      • IlluminaUtil

        public IlluminaUtil()
    • Method Detail

      • getTileFromReadName

        public static Integer getTileFromReadName​(String readName)
        Parse the tile # from the read name. If we find that there are other elements needed from the read name, it might be a good idea to put makeReadName() and various get..() methods into a new class.
        Parameters:
        readName - As produced by IlluminaUtil.makeReadName()
        Returns:
        tile number, or null if read name is not in correct format.
      • makePhredBinaryFromSolexaQualityAscii_1_3

        public static byte[] makePhredBinaryFromSolexaQualityAscii_1_3​(String solexaQualities)
        Convert from Solexa-scaled ASCII qualities to Phred-scaled binary. The only difference is Solexa qualities have 64 added to the phred binary to make them printable.
        Parameters:
        solexaQualities - Printable ASCII qualities.
        Returns:
        binary Phred-scaled qualities.
      • makePhredBinaryFromSolexaQualityAscii_1_3

        public static byte[] makePhredBinaryFromSolexaQualityAscii_1_3​(String solexaQualities,
                                                                       int offset,
                                                                       int length)
        Convert from Solexa-scaled ASCII qualities to Phred-scaled binary. The only difference is Solexa qualities have 64 added to the phred binary to make them printable.
        Parameters:
        solexaQualities - Printable ASCII qualities.
        offset - Character at which to start conversion.
        length - Number of characters to convert.
        Returns:
        binary Phred-scaled qualities.
      • convertSolexaQualityAscii_1_1_ToPhredBinary

        public static void convertSolexaQualityAscii_1_1_ToPhredBinary​(byte[] solexaQualities)
        Converts from Solexa ASCII to Phred binary in place. These are the older-style qualities rather than Phred qualities with a different addend to make them printable.
      • getSolexaQualityCharFromFourQualities

        public static byte getSolexaQualityCharFromFourQualities​(String[] qualities,
                                                                 int cycleNumber,
                                                                 htsjdk.samtools.util.FormatUtil formatter)
        Get a Solexa ASCII quality value from an array of strings that are integer qualities in this order: [cycle-1-A, cycle-1-C, cycle-1-G, cycle-1-T, cycle-2-A, ...]. The best quality from the 4 qualities for the cycle is found, and then it is ASCII-ized by adding 64.
        Parameters:
        qualities - Array of integer quality strings.
        cycleNumber - Which cycle to get quality for.
        formatter - For converting decimal strings to ints.
        Returns:
        best quality for the given cycle.
        Throws:
        PicardException - if the best quality ASCII value is > 255.
      • barcodeSeqsToString

        public static String barcodeSeqsToString​(List<String> barcodes)
        Concatenates all the barcode sequences with BARCODE_DELIMITER
        Parameters:
        barcodes -
        Returns:
        A single string representation of all the barcodes
      • barcodeSeqsToString

        public static String barcodeSeqsToString​(String[] barcodes)
        Concatenates all the barcode sequences with BARCODE_DELIMITER
        Parameters:
        barcodes -
        Returns:
        A single string representation of all the barcodes
      • barcodeSeqsToString

        public static String barcodeSeqsToString​(byte[][] barcodes)
        Concatenates all the barcode sequences with BARCODE_DELIMITER
        Parameters:
        barcodes -
        Returns:
        A single string representation of all the barcodes
      • stringSeqsToString

        public static String stringSeqsToString​(String[] barcodes,
                                                String delim)
      • byteArrayToString

        public static String byteArrayToString​(byte[][] barcodes,
                                               String delim)
        Concatenates all the barcode sequences with BARCODE_DELIMITER
        Parameters:
        barcodes -
        Returns:
        A single string representation of all the barcodes