Represents a path to directory.
Represents a path to a file (not a directory) that doesn't have a more specific type.
A String that represents the prefix or basename of a filename.
Represents a full path including directories, that is intended to be used as a prefix for generating file paths.
Represents a path to a BAM (or SAM or CRAM) file.
Represents a path to a Reference FASTA file.
Represents a path to a FASTQ file (optionally gzipped).
Represents a path to an intervals file (IntervalList or BED).
Represents a path to a VCF/BCF/VCF.gz.
Implicit class that wraps a closeable and provides a safelyClose method that will not throw any exception.
Performs the unit of work on a resource of type A cleaning up the resource in the case of an exception or upon completion, and ultimately returning a Try of type B.
Performs the unit of work on a resource of type A cleaning up the resource in the case of an exception or upon completion, and ultimately returning a Try of type B. An exception during cleanup does not change the success of the work. If a logger is provided, the exception is logged, otherwise the exception is ignored.
An example would be:
tryWith(Io.toWriter("/path/does/not/exists")(_.close()) { writer => writer.write("Hello World!")) }
which throws an exception since the path is not found, but this exception is ignored, and a Failure is returned.
the resource type.
the result type of the work performed.
the resource upon which work is performed.
the clean up method to apply to the resource when the work is complete.
the work to perform on the resource, returning a result of type B.
Success if the work was performed successfully, Failure otherwise.
Performs the unit of work on a closeable resource of type A closing up the resource in the case of an exception or upon completion, and ultimately returning a Try.
Performs the unit of work on a closeable resource of type A closing up the resource in the case of an exception or upon completion, and ultimately returning a Try. An exception during closing does not change the success of the work. If a logger is provided, the exception is logged, otherwise the exception is ignored.
An example would be:
tryWith(Io.toWriter("/path/does/not/exists") { writer => writer.write("Hello World!")) }
which throws an exception since the path is not found, but this exception is ignored, and a Failure is returned.
the resource type.
the resource upon which work is performed.
the work to perform on the resource.
Success if the work was performed successfully, Failure otherwise.
A terse way to throw an UnreachableException
that can be used where any type is expected,
e.g.
A terse way to throw an UnreachableException
that can be used where any type is expected,
e.g. Option(thing) getOrElse unreachable("my thing is never null")
an optional message
Construct to capture a value, execute some code, and then returned the captured value.
Construct to capture a value, execute some code, and then returned the captured value. Allows
code like:
val x = foo; foo +=1; return x
to be replaced with
yieldAndThen(foo) {foo +=1}
the type of thing to be returned (usually inferred)
the value to be returned/yielded
a block of code to be evaluated
it
Object that is designed to be imported with
import CommonsDef._
in any/all classes much like the way that scala.PreDef is imported in all files automatically.New methods, types and objects should not be added to this class lightly as they will pollute the namespace of any classes which import it.