Skip to content
Snippets Groups Projects
Commit 700bfa35 authored by bow's avatar bow
Browse files

Precompile regex for splitting read IDs

parent 20dab674
No related branches found
No related tags found
No related merge requests found
......@@ -90,9 +90,12 @@ class FastqSync(val root: Configurable) extends BiopetJavaCommandLineFunction {
object FastqSync extends ToolCommand {
/** Regex for capturing read ID ~ taking into account its read pair mark (if present) */
private val idRegex = "[_/][12]\\s??|\\s".r
/** Implicit class to allow for lazy retrieval of FastqRecord ID without any read pair mark */
private implicit class FastqPair(fq: FastqRecord) {
lazy val fragId = fq.getReadHeader.split("[_/][12]\\s??|\\s")(0)
lazy val fragId = idRegex.split(fq.getReadHeader)(0)
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment