Package picard.flow
Class FlowBasedKeyCodec
java.lang.Object
picard.flow.FlowBasedKeyCodec
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic int[]
baseArrayToKey
(byte[] bases, String flowOrder) Converts base space sequence to flow spacestatic 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 flowstatic int[]
getKeyToBase
(int[] key) For every flow of the key output the index of the last base that was output prior to this flowstatic FlowReadGroupInfo
getReadGroupInfo
(htsjdk.samtools.SAMFileHeader hdr, htsjdk.samtools.SAMRecord read) static String
keyAsString
(int[] ints) Prints the key as character-encoded string
-
Constructor Details
-
FlowBasedKeyCodec
public FlowBasedKeyCodec()
-
-
Method Details
-
baseArrayToKey
Converts base space sequence to flow space- Parameters:
bases
- base space sequenceflowOrder
- 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
For every flow of the key output the nucleotide that is being read for this flow- Parameters:
flowOrder
- given flow orderexpectedLength
- the length of the key (key is not provided)- Returns:
- array of bases
-
keyAsString
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 sequencekeyLength
- size of the converted bases array in flow-spacebaseSpacedArrayToConvert
- Array of base-space scores to be conformed to flow spacedefaultQual
- default quality to use at the head of the array for non-covered flowsflowOrder
- 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)
-