Package op
Class StorageFactory
java.lang.Object
op.StorageFactory
Factory class for creating and loading
Storage
objects.-
Method Summary
-
Method Details
-
fromPath
Reads aStorage
object from the specified file path.This method validates the file, determines if it is GZIP-compressed based on its extension, and reads its contents. The contents are then deserialized into a
Storage
object using Gson.- Parameters:
path
- ThePath
to the file containing the serializedStorage
object.- Returns:
- The deserialized
Storage
object. - Throws:
IOException
- If the file cannot be read or deserialized.
-
fromCli
Constructs aStorage
object from definitions inCLIBuild
.This method initializes a
Storage
object using parameters provided via theCLIBuild
instance. It sets up the storage parameters, optionally populates contigs from a reference, and loads features and sample information from the CLI parameters.- Parameters:
cli
- TheCLIBuild
instance containing the parameters and definitions for constructing theStorage
object.- Returns:
- A
Storage
object representing the loaded data. - Throws:
IOException
- If an error occurs while reading files or parsing data.
-