Package picard.flow

Class FlowBasedKeyCodec

java.lang.Object
picard.flow.FlowBasedKeyCodec

public class FlowBasedKeyCodec extends Object
Utility class for working with flow-based reads The main member static class is ReadGroupInfo that contains methods that allow working with headers of flow based reads and extracting the flow order and the maximal hmer class called. It also contains methods to check how the read was clipped (readEndMarkedUnclipped, readEndMarkedUncertain) Lastly, FlowBasedReadUtils.isFlowPlatform is **the** function to determine if the data are flow-based
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int[]
    baseArrayToKey(byte[] bases, String flowOrder)
    Converts base space sequence to flow space
    static byte[]
    baseArrayToKeySpace(byte[] bases, int keyLength, byte[] baseSpacedArrayToConvert, byte defaultQual, String flowOrder)
    Converts a numerical array into flow space by flattening per-base elements to fill empty flows based on minimum scores.
    static int[]
    findLeftClipping(int baseClipping, int[] flow2base, int[] key)
     
    static int[]
    findRightClipping(int baseClipping, int[] rFlow2Base, int[] rKey)
     
    static byte[]
    getFlowToBase(String flowOrder, int expectedLength)
    For every flow of the key output the nucleotide that is being read for this flow
    static int[]
    getKeyToBase(int[] key)
    For every flow of the key output the index of the last base that was output prior to this flow
    getReadGroupInfo(htsjdk.samtools.SAMFileHeader hdr, htsjdk.samtools.SAMRecord read)
     
    static String
    keyAsString(int[] ints)
    Prints the key as character-encoded string

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FlowBasedKeyCodec

      public FlowBasedKeyCodec()
  • Method Details

    • baseArrayToKey

      public static int[] baseArrayToKey(byte[] bases, String flowOrder)
      Converts base space sequence to flow space
      Parameters:
      bases - base space sequence
      flowOrder - flow order
      Returns:
      Array of flow values
    • getKeyToBase

      public static int[] getKeyToBase(int[] key)
      For every flow of the key output the index of the last base that was output prior to this flow
      Parameters:
      key - given key
      Returns:
      array
    • getFlowToBase

      public static byte[] getFlowToBase(String flowOrder, int expectedLength)
      For every flow of the key output the nucleotide that is being read for this flow
      Parameters:
      flowOrder - given flow order
      expectedLength - the length of the key (key is not provided)
      Returns:
      array of bases
    • keyAsString

      public static String keyAsString(int[] ints)
      Prints the key as character-encoded string
      Parameters:
      ints - (key array)
      Returns:
      encoded string
    • baseArrayToKeySpace

      public static byte[] baseArrayToKeySpace(byte[] bases, int keyLength, byte[] baseSpacedArrayToConvert, byte defaultQual, String flowOrder)
      Converts a numerical array into flow space by flattening per-base elements to fill empty flows based on minimum scores. This is intended to make it easier to transform per-base read statistics that are computed on the read in base-space sanely into flow-space reads in a reasonable fashion that makes sense for parameters like indel-likelihoods. The rules are as follows: - For every run of homopolymers, the minimum score for any given base is translated to cover the whole run - For every 0 base flow, the score from the previous filled flow is copied into place. - For the beginning of the array (in the case of preceding 0-flows) the given default value is used. Example: A read with the following bases with a base-space calculated into flow space (ACTG) as: TTTATGC -> 0030101101 With an input array like this: byte[]{1,2,3,4,5,6,7} We should expect the following result array (Which matches the key array in length) byte[]{defaultQual,defaultQual,1,1,4,4,5,6,6,7}
      Parameters:
      bases - base space sequence
      keyLength - size of the converted bases array in flow-space
      baseSpacedArrayToConvert - Array of base-space scores to be conformed to flow space
      defaultQual - default quality to use at the head of the array for non-covered flows
      flowOrder - flow order
      Returns:
      Array of translated bases comparable to the keyLength
    • getReadGroupInfo

      public static FlowReadGroupInfo getReadGroupInfo(htsjdk.samtools.SAMFileHeader hdr, htsjdk.samtools.SAMRecord read)
    • findLeftClipping

      public static int[] findLeftClipping(int baseClipping, int[] flow2base, int[] key)
    • findRightClipping

      public static int[] findRightClipping(int baseClipping, int[] rFlow2Base, int[] rKey)