{
    "$id": "bumpy_matrix/v1.json",
    "$schema": "http://json-schema.org/draft-07/schema",
    "_attributes": {
        "format": "text/csv",
        "restore": {
            "R": "alabaster.bumpy::loadBumpyDataFrameMatrix"
        }
    },
    "additionalProperties": false,
    "description": "A virtual \"bumpy\" matrix of vector-like objects of the same type, corresponding to the BumpyMatrix class from the [BumpyMatrix](https://www.bioconductor.org/packages/BumpyMatrix) package. Each entry of the matrix contains a vector-like object with a variable number of subelements.For efficient storage, all matrix elements are concatenated into a single object of the same type, with length equal to the total number of subelements across all vector-like objects.\n\n To reconstitute the bumpy matrix, we can inspect the partitioning information in the data frame, which is saved to `path` as a CSV file under the [**comservatory**](https://artifactdb.github.io/comservatory) specification (version 1). Each row of the data frame corresponds to an vector-like object in the bumpy matrix. The columns `row`, `column` and `number` are present in this data frame, specifying the 1-based row index, 1-based column index and length of the vector-like object. Subelements of the concatenated object are partitioned by assigning the specified `number` of consecutive subelements into a series of contiguous vector-like objects, each of which correspond to successive rows in the data frame.Matrix entries not listed in the data frame are assumed to be length-0 vector-like objects of the same type.\n\n If row or column names are present on the bumpy matrix, they are in separate files.These child objects should be referenced by the `bumpy_matrix.row_names` and `bumpy_matrix.column_names` properties.\n\n Concrete subclasses are expected to provide a `concatenated` property that points to the concatenated object.\n\nDerived from `array/v1.json`: some kind of multi-dimensional array, where we store metadata about the dimensions and type of data. The exact implementation of the array is left to concrete subclasses.",
    "properties": {
        "$schema": {
            "description": "The schema to use.",
            "type": "string"
        },
        "array": {
            "additionalProperties": false,
            "properties": {
                "dimensions": {
                    "description": "Dimensions of an n-dimensional array.",
                    "items": {
                        "type": "integer"
                    },
                    "maxItems": 2,
                    "minItems": 2,
                    "type": "array"
                },
                "type": {
                    "description": "Type of data stored in this array.",
                    "enum": [
                        "boolean",
                        "number",
                        "integer",
                        "string",
                        "other"
                    ],
                    "type": "string"
                }
            },
            "required": [
                "dimensions"
            ],
            "type": "object"
        },
        "bumpy_matrix": {
            "additionalProperties": false,
            "properties": {
                "column_names": {
                    "description": "Pointer to a string vector containing the column names for the bumpy matrix. This should be of length equal to the number of columns.If omitted, no column names were present.\n\n In minor version 1, this is instead a 1-column data frame where the only column contains the column names.",
                    "properties": {
                        "resource": {
                            "_children": {
                                "contains": [
                                    "data_frame",
                                    "atomic_vector"
                                ]
                            },
                            "properties": {
                                "path": {
                                    "description": "Relative path of the resource from the root of the project directory.",
                                    "type": "string"
                                },
                                "type": {
                                    "description": "Type of file. Local files should be present in the same project directory.",
                                    "enum": [
                                        "local"
                                    ],
                                    "type": "string"
                                }
                            },
                            "required": [
                                "type",
                                "path"
                            ],
                            "type": "object"
                        }
                    },
                    "required": [
                        "resource"
                    ],
                    "type": "object"
                },
                "compression": {
                    "description": "Type of compression applied to the file.",
                    "enum": [
                        "none",
                        "gzip",
                        "bzip2"
                    ],
                    "type": "string"
                },
                "object_count": {
                    "description": "Number of vector-like objects in the bumpy matrix, where each object is represented by a row in the data frame at `path`. If this is less than the product of the matrix dimensions, it is assumed that the entries missing from the CSV correspond to empty vector-like objects in the bumpy matrix.",
                    "minimum": 0,
                    "type": "integer"
                },
                "object_names": {
                    "default": false,
                    "description": "Whether the individual vector-like objects are named. If `true`, the first column of the CSV is called `names` and contains the name for the object corresponding to each row. Note that this does not represent the row or column names of the bumpy matrix itself, but instead of the individual (non-empty) vector-like objects.",
                    "type": "boolean"
                },
                "row_names": {
                    "description": "Pointer to a string vector containing the row names for the bumpy matrix. This should be of length equal to the number of rows.If omitted, no row names were present.\n\n In minor version 1, this is instead a 1-column data frame where the only column contains the row names.",
                    "properties": {
                        "resource": {
                            "_children": {
                                "contains": [
                                    "data_frame",
                                    "atomic_vector"
                                ]
                            },
                            "properties": {
                                "path": {
                                    "description": "Relative path of the resource from the root of the project directory.",
                                    "type": "string"
                                },
                                "type": {
                                    "description": "Type of file. Local files should be present in the same project directory.",
                                    "enum": [
                                        "local"
                                    ],
                                    "type": "string"
                                }
                            },
                            "required": [
                                "type",
                                "path"
                            ],
                            "type": "object"
                        }
                    },
                    "required": [
                        "resource"
                    ],
                    "type": "object"
                }
            },
            "required": [
                "compression",
                "object_count"
            ],
            "type": "object"
        },
        "is_child": {
            "default": false,
            "description": "Is this a child document, only to be interpreted in the context of the parent document from which it is linked? This may have implications for search and metadata requirements.",
            "type": "boolean"
        },
        "md5sum": {
            "description": "MD5 checksum for the file.",
            "type": "string"
        },
        "path": {
            "description": "Path to the file in the project directory.",
            "type": "string"
        },
        "version": {
            "default": 1,
            "description": "Minor version of this schema.",
            "maximum": 2,
            "type": "integer"
        }
    },
    "required": [
        "$schema",
        "array",
        "bumpy_matrix",
        "md5sum",
        "path"
    ],
    "title": "Bumpy Matrix",
    "type": "object"
}
