public class ReadNameParser
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_READ_NAME_REGEX
The read name regular expression (regex) is used to extract three pieces of information from the read name: tile, x location,
and y location.
|
Constructor and Description |
---|
ReadNameParser()
Creates are read name parser using the default read name regex and optical duplicate distance.
|
ReadNameParser(java.lang.String readNameRegex)
Creates are read name parser using the given read name regex.
|
ReadNameParser(java.lang.String readNameRegex,
htsjdk.samtools.util.Log log)
Creates are read name parser using the given read name regex.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addLocationInformation(java.lang.String readName,
PhysicalLocation loc)
Method used to extract tile/x/y from the read name and add it to the PhysicalLocationShort so that it
can be used later to determine optical duplication
|
static int |
getLastThreeFields(java.lang.String readName,
char delim,
int[] tokens)
Given a string, splits the string by the delimiter, and returns the the last three fields parsed as integers.
|
static int |
rapidParseInt(java.lang.String input)
Very specialized method to rapidly parse a sequence of digits from a String up until the first
non-digit character.
|
public static final java.lang.String DEFAULT_READ_NAME_REGEX
getLastThreeFields(String, char, int[])
) by searching for the last
three fields, ignoring any trailing non-digit characters, assuming the delimiter ':'. This should consider correctly read names
where we have 5 or 7 field with the last three fields being tile/x/y, as is the case for the majority of read names produced by
Illumina technology.public ReadNameParser()
DEFAULT_READ_NAME_REGEX
for an explanation on how the read name is parsed.public ReadNameParser(java.lang.String readNameRegex)
DEFAULT_READ_NAME_REGEX
for an explanation on how to
format the regular expression (regex) string.readNameRegex
- the read name regular expression string to parse read names, null to never parse location information.public ReadNameParser(java.lang.String readNameRegex, htsjdk.samtools.util.Log log)
DEFAULT_READ_NAME_REGEX
for an explanation on how to
format the regular expression (regex) string.readNameRegex
- the read name regular expression string to parse read names, null to never parse location information..log
- the log to which to write messages.public boolean addLocationInformation(java.lang.String readName, PhysicalLocation loc)
readName
- the name of the read/clusterloc
- the object to add tile/x/y topublic static int getLastThreeFields(java.lang.String readName, char delim, int[] tokens) throws java.lang.NumberFormatException
java.lang.NumberFormatException
- if any of the tokens that should contain numbers do not start with parsable numberspublic static int rapidParseInt(java.lang.String input) throws java.lang.NumberFormatException
java.lang.NumberFormatException
- if the String does not start with an optional - followed by at least on digit