|
takane
Validators for ArtifactDB file formats
|
takane validation functions. More...
Classes | |
| struct | ObjectMetadata |
| Object metadata, including the type and other fields. More... | |
| struct | Options |
| Validation options. More... | |
Functions | |
| bool | derived_from (const std::string &type, const std::string &base, const Options &options) |
| std::vector< std::size_t > | dimensions (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::vector< size_t > | dimensions (const std::filesystem::path &path, const Options &options) |
| std::vector< size_t > | dimensions (const std::filesystem::path &path) |
| std::size_t | height (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height (const std::filesystem::path &path, const Options &options) |
| std::size_t | height (const std::filesystem::path &path) |
| bool | satisfies_interface (const std::string &type, const std::string &interface, const Options &options) |
| void | validate (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate (const std::filesystem::path &path, const Options &options) |
| void | validate (const std::filesystem::path &path) |
| void | validate_atomic_vector (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_atomic_vector (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_atomic_vector_list (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_atomic_vector_list (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_bam_file (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_bcf_file (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_bed_file (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_bigbed_file (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_bigwig_file (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_bumpy_atomic_array (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_bumpy_atomic_array (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::vector< std::size_t > | dimensions_of_bumpy_atomic_array (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_bumpy_data_frame_array (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_bumpy_data_frame_array (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::vector< std::size_t > | dimensions_of_bumpy_data_frame_array (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_compressed_sparse_matrix (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_compressed_sparse_matrix (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::vector< size_t > | dimensions_of_compressed_sparse_matrix (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_data_frame (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_data_frame (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::vector< std::size_t > | dimensions_of_data_frame (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_data_frame_factor (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_data_frame_factor (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_data_frame_list (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_data_frame_list (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_delayed_array (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_delayed_array (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::vector< std::size_t > | dimensions_of_delayed_array (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_dense_array (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_dense_array (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::vector< std::size_t > | dimensions_of_dense_array (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_fasta_file (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_fastq_file (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_genomic_ranges (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_genomic_ranges (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_genomic_ranges_list (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_genomic_ranges_list (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_gff_file (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_gmt_file (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_image_file (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_multi_sample_dataset (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_ranged_summarized_experiment (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_rds_file (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_sequence_information (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_sequence_string_set (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_sequence_string_set (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_simple_list (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_simple_list (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_single_cell_experiment (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_spatial_experiment (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_string_factor (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_string_factor (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| void | validate_summarized_experiment (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_summarized_experiment (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::vector< std::size_t > | dimensions_of_summarized_experiment (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| ObjectMetadata | reformat_object_metadata (millijson::Base *raw) |
| ObjectMetadata | read_object_metadata (const std::filesystem::path &path) |
| void | validate_vcf_experiment (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::size_t | height_of_vcf_experiment (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
| std::vector< std::size_t > | dimensions_of_vcf_experiment (const std::filesystem::path &path, const ObjectMetadata &metadata, const Options &options) |
takane validation functions.
|
inline |
Check whether a particular object type is derived from a base object type. Derived types satisfy the same file requirements of the base type, but usually add more files to represent additional functionality. This can be used by specifications to check whether arbitrary objects satisfy the file structure expectations for a particular base type.
Applications can add their own derived types for a given base class in Options::custom_derived_from. This extends the default relationships whereby derived_from() will take the union of all derived object types in the default and custom sets. Note that derived types must be manually included in every base type's set, e.g., if B is derived from A and C is derived from B, C must be added to the sets for both A and B.
| type | Object type. |
| base | Base object type. |
| options | Validation options, containing custom derived/base relationships. |
type is derived from base or is equal to base.
|
inline |
Overload of dimensions() with default settings.
| path | Path to a directory containing an object. |
|
inline |
Get the dimensions of a multi-dimensional object in a subdirectory, based on the supplied object type.
Applications can supply custom dimension functions for a given type via Options::custom_dimensions. If available, the supplied custom function will be used instead of the default.
| path | Path to a directory representing an object. |
| metadata | Metadata for the object, typically determined from its OBJECT file. |
| options | Validation options. |
|
inline |
Get the dimensions of an object in a subdirectory, using its OBJECT file to automatically determine the type.
| path | Path to a directory containing an object. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing an bumpy atomic array. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing an bumpy data frame array. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing a compressed sparse matrix. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing a data frame. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing a delayed array. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing a dense array. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing a summarized experiment. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing a VCF experiment. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
Overload of height() with default settings.
| path | Path to a directory containing an object. |
|
inline |
Get the height of an object in a subdirectory, based on the supplied object type.
height() is used to check the shape of objects stored in vertical containers, e.g., columns of a data_frame. For vectors or other 1-dimensional objects, the height is usually just the length of the object (for some object-specific definition of "length"). For higher-dimensional objects, the height is usually the extent of the first dimension.
Applications can supply custom height functions for a given type via Options::custom_height. If available, the supplied custom function will be used instead of the default.
| path | Path to a directory representing an object. |
| metadata | Metadata for the object, typically determined from its OBJECT file. |
| options | Validation options. |
|
inline |
Get the height of an object in a subdirectory, using its OBJECT file to automatically determine the type.
| path | Path to a directory containing an object. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the atomic vector. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing an atomic vector list. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing an bumpy atomic array. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing an bumpy data frame array. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing a compressed sparse matrix. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing a data frame. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the data frame factor. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing an data frame list. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing a delayed array. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing a dense array. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing genomic ranges. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing an genomic ranges list. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing a sequence string set. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the simple list. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the string factor. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing a summarized experiment. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing a VCF experiment. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
Reads the OBJECT file inside a directory to determine the object type.
| path | Path to a directory containing an object. |
|
inline |
Parses a JSON object to obtain the object metadata.
| raw | Raw JSON object, typically obtained by millijson::parse_file. Note that raw is consumed by this function and should no longer be used by the caller. |
|
inline |
Check whether a particular object type satisfies a particular object interface. This can be used by specifications to check that child components satisfy certain user-level expectations for an abstract object (e.g., data frames, lists).
Applications can extend the takane framework by adding custom types to Options::custom_satisfies_interface. This extends the default relationships whereby satisfies_interface() will take the union of all object types in the default and custom sets. Note that, if a type is included in a particular set, it is not necessary to add its derived types, as satisfies_interface() will automatically call derived_from().
| type | Object type. |
| interface | Interface type. |
| options | Validation options, containing custom object interface relationships. |
type satisfies interface.
|
inline |
Overload of validate() with default settings.
| path | Path to a directory containing an object. |
|
inline |
Validate an object in a subdirectory, based on the supplied object type.
Applications can supply custom validation functions for a given type via Options::custom_validate. If available, the supplied custom function will be used instead of the default.
| path | Path to a directory representing an object. |
| metadata | Metadata for the object, typically determined from its OBJECT file. |
| options | Validation options. |
|
inline |
Validate an object in a subdirectory, using its OBJECT file to automatically determine the type.
| path | Path to a directory containing an object. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the atomic vector. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the atomic vector list. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
If Options::bam_file_strict_check is provided, it is used to perform stricter checking of the BAM file contents and indices. By default, we don't look past the magic number to verify the files as this requires a dependency on heavy-duty libraries like, e.g., HTSlib.
| path | Path to the directory containing the BAM file. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
If Options::bcf_file_strict_check is provided, it is used to perform stricter checking of the BCF file contents and indices. By default, we don't look past the magic number to verify the files as this requires a dependency on heavy-duty libraries like, e.g., HTSlib.
| path | Path to the directory containing the BCF file. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
If Options::bed_file_strict_check is provided, it is used to perform stricter checking of the BED file contents and indices. Currently, we don't look past the magic number to verify the files as this requires a dependency on heavy-duty libraries like, e.g., HTSlib.
| path | Path to the directory containing the BED file. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
If Options::bigbed_file_strict_check is provided, it is used to perform stricter checking of the bigBed file contents. By default, we don't look past the magic number to verify the files as this requires a dependency on heavy-duty libraries like, e.g., HTSlib.
| path | Path to the directory containing the bigBed file. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
If Options::bigwig_file_strict_check is provided, it is used to perform stricter checking of the bigWig file contents. By default, we don't look past the magic number to verify the files as this requires a dependency on heavy-duty libraries like, e.g., HTSlib.
| path | Path to the directory containing the bigWig file. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the bumpy atomic array. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the bumpy data frame array. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing a compressed sparse matrix. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the data frame. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
If Options::data_frame_factor_any_duplicated is set, it enables stricter checking of the uniqueness of the data frame levels. Currently, we don't provide a default method for data_frame objects, as it's kind of tedious and we haven't gotten around to it yet.
| path | Path to the directory containing the data frame factor. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the data frame list. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing a delayed array. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing a dense array. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
If Options::fasta_file_strict_check is provided, this enables stricter checking of the FASTA file contents and indices. By default, we just look at the first few bytes to verify the files.
| path | Path to the directory containing the FASTA file. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
If Options::fastq_file_strict_check is provided, this enables stricter checking of the FASTQ file contents and indices. By default, we just look at the first few bytes to verify the files.
| path | Path to the directory containing the FASTQ file. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the genomic ranges. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the genomic ranges list. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
If Options::gff_file_strict_check is provided, this enables stricter checking of the GFF file contents. By default, we just look at the first few bytes to verify the files.
| path | Path to the directory containing the GFF file. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
If Options::gmt_file_strict_check is provided, this enables stricter checking of the GMT file contents. By default, we just look at the first few bytes to verify the files.
| path | Path to the directory containing the GMT file. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
If Options::image_file_strict_check is provided, it is used to perform stricter checking of the image file contents. By default, we don't look past the magic number to verify the files as this requires a dependency on heavy-duty libraries like, e.g., Magick.
| path | Path to the directory containing the image file. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the multi-sample dataset. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the ranged summarized experiment. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
If Options::rds_file_strict_check is provided, this enables stricter checking of the RDS file contents. By default, we just look at the first few bytes to verify the files.
| path | Path to the directory containing the RDS file. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the data frame. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to a directory containing a sequence string set. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the simple list. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the single cell experiment. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the spatial experiment. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the string factor. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the summarized experiment. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |
|
inline |
| path | Path to the directory containing the VCF experiment. |
| metadata | Metadata for the object, typically read from its OBJECT file. |
| options | Validation options. |