diff --git a/README.md b/README.md index c50b95c..fb46c50 100644 --- a/README.md +++ b/README.md @@ -116,18 +116,21 @@ http://samtools.github.io/hts-specs/SAMv1.pdf ``` -The random access method to be described next limits the uncompressed contents of each BGZF block -to a maximum of 216 bytes of data. Thus while ISIZE is stored as a uint32 t as per the gzip format, in -BGZF it is limited to the range [0, 65536]. BSIZE can represent BGZF block sizes in the range [1, 65536], +The random access method to be described next limits the uncompressed contents +of each BGZF block to a maximum of 216 bytes of data. Thus while ISIZE is +stored as a uint32 t as per the gzip format, in BGZF it is limited to the range +[0, 65536]. BSIZE can represent BGZF block sizes in the range [1, 65536], though typically BSIZE will be rather less than ISIZE due to compression. 4.1.1 Random access -BGZF files support random access through the BAM file index. To achieve this, the BAM file index uses -virtual file offsets into the BGZF file. Each virtual file offset is an unsigned 64-bit integer, defined as: -coffset<<16|uoffset, where coffset is an unsigned byte offset into the BGZF file to the beginning of a -BGZF block, and uoffset is an unsigned byte offset into the uncompressed data stream represented by that -BGZF block. Virtual file offsets can be compared, but subtraction between virtual file offsets and addition -between a virtual offset and an integer are both disallowed. +BGZF files support random access through the BAM file index. To achieve this, +the BAM file index uses virtual file offsets into the BGZF file. Each virtual +file offset is an unsigned 64-bit integer, defined as: coffset<<16|uoffset, +where coffset is an unsigned byte offset into the BGZF file to the beginning of +a BGZF block, and uoffset is an unsigned byte offset into the uncompressed data +stream represented by that BGZF block. Virtual file offsets can be compared, +but subtraction between virtual file offsets and addition between a virtual +offset and an integer are both disallowed. ``` TABIX @@ -204,6 +207,7 @@ Schema ------ https://jsonschema.net/home +https://www.jsonschemavalidator.net/ Example output @@ -213,44 +217,78 @@ JSON ```JSON { - "__format_name__": "TBJ", - "__format_ver__": 2, - "n_ref": 1, - "format": 2, - "col_seq": 1, - "col_beg": 2, - "col_end": 0, - "meta": "#", - "skip": 0, - "l_nm": 11, - "names": [ - "SL2.50ch00" + "n_ref": 1, + "format": 2, + "col_seq": 1, + "col_beg": 2, + "col_end": 0, + "meta": "#", + "skip": 0, + "l_nm": 11, + "names": [ + "SL2.50ch00" + ], + "refs": [ + { + "ref_n": 0, + "ref_name": "SL2.50ch00", + "n_bin": 86, + "bins": [ + { + "bin_n": 0, + "bin": 4681, + "n_chunk": 1, + "chunks": { + "chunk_begin": [ + { + "real": 0, + "bytes": 29542, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + } + ], + "chunk_end": [ + { + "real": 124525, + "bytes": 19630, + "bin_pos": 16388, + "first_pos": 16141, + "last_pos": 17808 + } + ] + } + } ], - "refs": [{ - "ref_n": 0, - "ref_name": "SL2.50ch00", - "n_bin": 86, - "bins": [{ - "bin_n": 0, - "bin": 4681, - "n_chunk": 1, - "chunks": [ - [29542, 8160890030] - ] - }, - { - "bin_n": 85, - "bin": 4766, - "n_chunk": 1, - "chunks": [ - [460168303127, 461352730624] - ] - } - ], - "n_intv": 86, - "intvs": [29542, 460168303127] - }], - "n_no_coor": null + "bins_begin": { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + }, + "bins_end": { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + }, + "n_intv": 86, + "intvs": [ + { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + } + ] + } + ], + "n_no_coor": null, + "__format_name__": "TBJ", + "__format_ver__": 4 } ``` diff --git a/examples/example.v2.schema.json b/examples/example.v2.schema.json index 0aac29c..9196283 100644 --- a/examples/example.v2.schema.json +++ b/examples/example.v2.schema.json @@ -111,7 +111,7 @@ "type": "integer", "title": "The format schema", "description": "Format (0: generic; 1: SAM; 2: VCF).", - "default": 0, + "default": 2, "examples": [ 2 ] @@ -131,7 +131,7 @@ "type": "integer", "title": "The col_beg schema", "description": "Column for the start of a region.", - "default": 0, + "default": 2, "examples": [ 2 ] @@ -151,7 +151,7 @@ "type": "string", "title": "The meta schema", "description": "Leading character for comment lines.", - "default": "", + "default": "#", "examples": [ "#" ] diff --git a/examples/example.v4.json b/examples/example.v4.json new file mode 100644 index 0000000..73bd66b --- /dev/null +++ b/examples/example.v4.json @@ -0,0 +1,106 @@ +{ + "n_ref": 1, + "format": 2, + "col_seq": 1, + "col_beg": 2, + "col_end": 0, + "meta": "#", + "skip": 0, + "l_nm": 11, + "names": [ + "SL2.50ch00" + ], + "refs": [ + { + "ref_n": 0, + "ref_name": "SL2.50ch00", + "n_bin": 86, + "bins": [ + { + "bin_n": 0, + "bin": 4681, + "n_chunk": 1, + "chunks": { + "chunk_begin": [ + { + "real": 0, + "bytes": 29542, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + } + ], + "chunk_end": [ + { + "real": 124525, + "bytes": 19630, + "bin_pos": 16388, + "first_pos": 16141, + "last_pos": 17808 + } + ] + } + }, + { + "bin_n": 85, + "bin": 4766, + "n_chunk": 1, + "chunks": { + "chunk_begin": [ + { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + } + ], + "chunk_end": [ + { + "real": 7039684, + "bytes": 0, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + } + ] + } + } + ], + "bins_begin": { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + }, + "bins_end": { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + }, + "n_intv": 86, + "intvs": [ + { + "real": 0, + "bytes": 29542, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + }, + { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + } + ] + } + ], + "n_no_coor": null, + "__format_name__": "TBJ", + "__format_ver__": 4 + } \ No newline at end of file diff --git a/examples/example.v4.schema.json b/examples/example.v4.schema.json new file mode 100644 index 0000000..e43965b --- /dev/null +++ b/examples/example.v4.schema.json @@ -0,0 +1,897 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://raw.githubusercontent.com/bejobioinformatics/tabixpy/master/examples/example.v4.json", + "type": "object", + "title": "JSON Tabix", + "description": "JSON encoded Tabix File.", + + "definitions": { + "coordinate": { + "$id": "#/definitions/coordinate", + "type": "object", + "title": "The first anyOf schema", + "description": "Coordinate information in the file.", + "default": {}, + "examples": [ + { + "real": 0, + "bytes": 29542, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + } + ], + "required": [ + "real", + "bytes", + "bin_pos", + "first_pos", + "last_pos" + ], + "additionalProperties": true, + "properties": { + "real": { + "$id": "#/definitions/coordinate/properties/real", + "type": "integer", + "title": "The real schema", + "description": "Position in the compressed, BGZip, stream of the begning of the 64Kb block.", + "default": 0, + "examples": [ + 0 + ] + }, + "bytes": { + "$id": "#/definitions/coordinate/properties/bytes", + "type": "integer", + "title": "The bytes schema", + "description": "Position in the decompressed stream where the bin begins.", + "default": 0, + "examples": [ + 29542 + ] + }, + "bin_pos": { + "$id": "#/definitions/coordinate/properties/bin_pos", + "type": "integer", + "title": "The bin_pos schema", + "description": "Chromosome position in which the bin starts.", + "default": 0, + "examples": [ + -1 + ] + }, + "first_pos": { + "$id": "#/definitions/coordinate/properties/first_pos", + "type": "integer", + "title": "The first_pos schema", + "description": "Chromosome position in which the 64 Kb block starts.", + "default": 0, + "examples": [ + -1 + ] + }, + "last_pos": { + "$id": "#/definitions/coordinate/properties/last_pos", + "type": "integer", + "title": "The last_pos schema", + "description": "Chromosome position in which the 64 Kb block ends.", + "default": 0, + "examples": [ + -1 + ] + } + } + } + }, + + "default": {}, + "examples": [ + { + "n_ref": 1, + "format": 2, + "col_seq": 1, + "col_beg": 2, + "col_end": 0, + "meta": "#", + "skip": 0, + "l_nm": 11, + "names": [ + "SL2.50ch00" + ], + "refs": [ + { + "ref_n": 0, + "ref_name": "SL2.50ch00", + "n_bin": 86, + "bins": [ + { + "bin_n": 0, + "bin": 4681, + "n_chunk": 1, + "chunks": { + "chunk_begin": [ + { + "real": 0, + "bytes": 29542, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + } + ], + "chunk_end": [ + { + "real": 124525, + "bytes": 19630, + "bin_pos": 16388, + "first_pos": 16141, + "last_pos": 17808 + } + ] + } + }, + { + "bin_n": 85, + "bin": 4766, + "n_chunk": 1, + "chunks": { + "chunk_begin": [ + { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + } + ], + "chunk_end": [ + { + "real": 7039684, + "bytes": 0, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + } + ] + } + } + ], + "bins_begin": { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + }, + "bins_end": { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + }, + "n_intv": 86, + "intvs": [ + { + "real": 0, + "bytes": 29542, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + }, + { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + } + ] + } + ], + "n_no_coor": null, + "__format_name__": "TBJ", + "__format_ver__": 4 + } + ], + "required": [ + "n_ref", + "format", + "col_seq", + "col_beg", + "col_end", + "meta", + "skip", + "l_nm", + "names", + "refs", + "n_no_coor", + "__format_name__", + "__format_ver__" + ], + "additionalProperties": true, + "properties": { + "n_ref": { + "$id": "#/properties/n_ref", + "type": "integer", + "title": "The n_ref schema", + "description": "# sequences.", + "default": 1, + "examples": [ + 1 + ] + }, + "format": { + "$id": "#/properties/format", + "type": "integer", + "title": "The format schema", + "description": "Format (0: generic; 1: SAM; 2: VCF).", + "default": 2, + "examples": [ + 2 + ] + }, + "col_seq": { + "$id": "#/properties/col_seq", + "type": "integer", + "title": "The col_seq schema", + "description": "Column for the sequence name.", + "default": 1, + "examples": [ + 1 + ] + }, + "col_beg": { + "$id": "#/properties/col_beg", + "type": "integer", + "title": "The col_beg schema", + "description": "Column for the start of a region.", + "default": 2, + "examples": [ + 2 + ] + }, + "col_end": { + "$id": "#/properties/col_end", + "type": "integer", + "title": "The col_end schema", + "description": "Column for the end of a region.", + "default": 0, + "examples": [ + 0 + ] + }, + "meta": { + "$id": "#/properties/meta", + "type": "string", + "title": "The meta schema", + "description": "Leading character for comment lines.", + "default": "#", + "examples": [ + "#" + ] + }, + "skip": { + "$id": "#/properties/skip", + "type": "integer", + "title": "The skip schema", + "description": "# lines to skip at the beginning.", + "default": 0, + "examples": [ + 0 + ] + }, + "l_nm": { + "$id": "#/properties/l_nm", + "type": "integer", + "title": "The l_nm schema", + "description": "Length of concatenated sequence names.", + "default": 0, + "examples": [ + 11 + ] + }, + "names": { + "$id": "#/properties/names", + "type": "array", + "title": "The names schema", + "description": "Sequence names.", + "default": [], + "examples": [ + [ + "SL2.50ch00" + ] + ], + "additionalItems": true, + "items": { + "anyOf": [ + { + "$id": "#/properties/names/items/anyOf/0", + "type": "string", + "title": "The first anyOf schema", + "description": "Sequence name.", + "default": "", + "examples": [ + "SL2.50ch00" + ] + } + ], + "$id": "#/properties/names/items" + } + }, + "refs": { + "$id": "#/properties/refs", + "type": "array", + "title": "The refs schema", + "description": "List of indices (n=n_ref).", + "default": [], + "examples": [ + [ + { + "ref_n": 0, + "ref_name": "SL2.50ch00", + "n_bin": 86, + "bins": [ + { + "bin_n": 0, + "bin": 4681, + "n_chunk": 1, + "chunks": { + "chunk_begin": [ + { + "real": 0, + "bytes": 29542, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + } + ], + "chunk_end": [ + { + "real": 124525, + "bytes": 19630, + "bin_pos": 16388, + "first_pos": 16141, + "last_pos": 17808 + } + ] + } + }, + { + "bin_n": 85, + "bin": 4766, + "n_chunk": 1, + "chunks": { + "chunk_begin": [ + { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + } + ], + "chunk_end": [ + { + "real": 7039684, + "bytes": 0, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + } + ] + } + } + ], + "bins_begin": { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + }, + "bins_end": { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + }, + "n_intv": 86, + "intvs": [ + { + "real": 0, + "bytes": 29542, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + }, + { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + } + ] + } + ] + ], + "additionalItems": true, + "items": { + "anyOf": [ + { + "$id": "#/properties/refs/items/anyOf/0", + "type": "object", + "title": "The first anyOf schema", + "description": "An Reference data.", + "default": {}, + "examples": [ + { + "ref_n": 0, + "ref_name": "SL2.50ch00", + "n_bin": 86, + "bins": [ + { + "bin_n": 0, + "bin": 4681, + "n_chunk": 1, + "chunks": { + "chunk_begin": [ + { + "real": 0, + "bytes": 29542, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + } + ], + "chunk_end": [ + { + "real": 124525, + "bytes": 19630, + "bin_pos": 16388, + "first_pos": 16141, + "last_pos": 17808 + } + ] + } + }, + { + "bin_n": 85, + "bin": 4766, + "n_chunk": 1, + "chunks": { + "chunk_begin": [ + { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + } + ], + "chunk_end": [ + { + "real": 7039684, + "bytes": 0, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + } + ] + } + } + ], + "bins_begin": { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + }, + "bins_end": { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + }, + "n_intv": 86, + "intvs": [ + { + "real": 0, + "bytes": 29542, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + }, + { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + } + ] + } + ], + "required": [ + "ref_n", + "ref_name", + "n_bin", + "bins", + "bins_begin", + "bins_end", + "n_intv", + "intvs" + ], + "additionalProperties": true, + "properties": { + "ref_n": { + "$id": "#/properties/refs/items/anyOf/0/properties/ref_n", + "type": "integer", + "title": "The ref_n schema", + "description": "Sequence position.", + "default": 0, + "examples": [ + 0 + ] + }, + "ref_name": { + "$id": "#/properties/refs/items/anyOf/0/properties/ref_name", + "type": "string", + "title": "The ref_name schema", + "description": "Sequence name.", + "default": "", + "examples": [ + "SL2.50ch00" + ] + }, + "n_bin": { + "$id": "#/properties/refs/items/anyOf/0/properties/n_bin", + "type": "integer", + "title": "The n_bin schema", + "description": "# distinct bins (for the binning index).", + "default": 0, + "examples": [ + 86 + ] + }, + "bins": { + "$id": "#/properties/refs/items/anyOf/0/properties/bins", + "type": "array", + "title": "The bins schema", + "description": "List of distinct bins (n=n_bin).", + "default": [], + "examples": [ + [ + { + "bin_n": 0, + "bin": 4681, + "n_chunk": 1, + "chunks": { + "chunk_begin": [ + { + "real": 0, + "bytes": 29542, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + } + ], + "chunk_end": [ + { + "real": 124525, + "bytes": 19630, + "bin_pos": 16388, + "first_pos": 16141, + "last_pos": 17808 + } + ] + } + }, + { + "bin_n": 85, + "bin": 4766, + "n_chunk": 1, + "chunks": { + "chunk_begin": [ + { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + } + ], + "chunk_end": [ + { + "real": 7039684, + "bytes": 0, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + } + ] + } + } + ] + ], + "additionalItems": true, + "items": { + "anyOf": [ + { + "$id": "#/properties/refs/items/anyOf/0/properties/bins/items/anyOf/0", + "type": "object", + "title": "The first anyOf schema", + "description": "Distinct Bin data.", + "default": {}, + "examples": [ + { + "bin_n": 0, + "bin": 4681, + "n_chunk": 1, + "chunks": { + "chunk_begin": [ + { + "real": 0, + "bytes": 29542, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + } + ], + "chunk_end": [ + { + "real": 124525, + "bytes": 19630, + "bin_pos": 16388, + "first_pos": 16141, + "last_pos": 17808 + } + ] + } + } + ], + "required": [ + "bin_n", + "bin", + "n_chunk", + "chunks" + ], + "additionalProperties": true, + "properties": { + "bin_n": { + "$id": "#/properties/refs/items/anyOf/0/properties/bins/items/anyOf/0/properties/bin_n", + "type": "integer", + "title": "The bin_n schema", + "description": "Bin position.", + "default": 0, + "examples": [ + 0 + ] + }, + "bin": { + "$id": "#/properties/refs/items/anyOf/0/properties/bins/items/anyOf/0/properties/bin", + "type": "integer", + "title": "The bin schema", + "description": "Distinct bin number.", + "default": 0, + "examples": [ + 4681 + ] + }, + "n_chunk": { + "$id": "#/properties/refs/items/anyOf/0/properties/bins/items/anyOf/0/properties/n_chunk", + "type": "integer", + "title": "The n_chunk schema", + "description": "# chunks.", + "default": 1, + "examples": [ + 1 + ] + }, + "chunks": { + "$id": "#/properties/refs/items/anyOf/0/properties/bins/items/anyOf/0/properties/chunks", + "type": "object", + "title": "The chunks schema", + "description": "List of chunks (n=n_chunk).", + "default": {}, + "examples": [ + { + "chunk_begin": [ + { + "real": 0, + "bytes": 29542, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + } + ], + "chunk_end": [ + { + "real": 124525, + "bytes": 19630, + "bin_pos": 16388, + "first_pos": 16141, + "last_pos": 17808 + } + ] + } + ], + "required": [ + "chunk_begin", + "chunk_end" + ], + "additionalProperties": true, + "properties": { + "chunk_begin": { + "$id": "#/properties/refs/items/anyOf/0/properties/bins/items/anyOf/0/properties/chunks/properties/chunk_begin", + "type": "array", + "title": "The chunk_begin schema", + "description": "Coordinates of the begining of the chunks.", + "default": [], + "examples": [ + [ + { + "real": 0, + "bytes": 29542, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + } + ] + ], + "additionalItems": true, + "items": { + "anyOf": [ + { + "$id": "#/properties/refs/items/anyOf/0/properties/bins/items/anyOf/0/properties/chunks/properties/chunk_begin/items/anyOf/0", + "type": "object", + "title": "The first anyOf schema", + "description": "Coordinates of the begining of each chunk.", + "$ref": "#/definitions/coordinate" + } + ], + "$id": "#/properties/refs/items/anyOf/0/properties/bins/items/anyOf/0/properties/chunks/properties/chunk_begin/items" + } + }, + "chunk_end": { + "$id": "#/properties/refs/items/anyOf/0/properties/bins/items/anyOf/0/properties/chunks/properties/chunk_end", + "type": "array", + "title": "The chunk_end schema", + "description": "Coordinates of the end of the chunks.", + "default": [], + "examples": [ + [ + { + "real": 124525, + "bytes": 19630, + "bin_pos": 16388, + "first_pos": 16141, + "last_pos": 17808 + } + ] + ], + "additionalItems": true, + "items": { + "anyOf": [ + { + "$id": "#/properties/refs/items/anyOf/0/properties/bins/items/anyOf/0/properties/chunks/properties/chunk_end/items/anyOf/0", + "type": "object", + "title": "The first anyOf schema", + "description": "Coordinates of the end of each chunk.", + "$ref": "#/definitions/coordinate" + } + ], + "$id": "#/properties/refs/items/anyOf/0/properties/bins/items/anyOf/0/properties/chunks/properties/chunk_end/items" + } + } + } + } + } + } + ], + "$id": "#/properties/refs/items/anyOf/0/properties/bins/items" + } + }, + "bins_begin": { + "$id": "#/properties/refs/items/anyOf/0/properties/bins_begin", + "type": "object", + "title": "The bins_begin schema", + "description": "First coordinate of first chunk.", + "$ref": "#/definitions/coordinate" + }, + "bins_end": { + "$id": "#/properties/refs/items/anyOf/0/properties/bins_end", + "type": "object", + "title": "The bins_end schema", + "description": "Last coordinate of last chunk.", + "$ref": "#/definitions/coordinate" + }, + "n_intv": { + "$id": "#/properties/refs/items/anyOf/0/properties/n_intv", + "type": "integer", + "title": "The n_intv schema", + "description": "# 16kb intervals (for the linear index).", + "default": 0, + "examples": [ + 86 + ] + }, + "intvs": { + "$id": "#/properties/refs/items/anyOf/0/properties/intvs", + "type": "array", + "title": "The intvs schema", + "description": "List of distinct intervals (n=n_intv).", + "default": [], + "examples": [ + [ + { + "real": 0, + "bytes": 29542, + "bin_pos": -1, + "first_pos": -1, + "last_pos": -1 + }, + { + "real": 7021611, + "bytes": 4631, + "bin_pos": 1392700, + "first_pos": 1392519, + "last_pos": 1393971 + } + ] + ], + "additionalItems": true, + "items": { + "anyOf": [ + { + "$id": "#/properties/refs/items/anyOf/0/properties/intvs/items/anyOf/0", + "type": "object", + "title": "The first anyOf schema", + "description": "File offset of the first record in the interval.", + "$ref": "#/definitions/coordinate" + } + ], + "$id": "#/properties/refs/items/anyOf/0/properties/intvs/items" + } + } + } + } + ], + "$id": "#/properties/refs/items" + } + }, + "n_no_coor": { + "$id": "#/properties/n_no_coor", + "type": "null", + "title": "The n_no_coor schema", + "description": "# unmapped reads without coordinates set.", + "default": null, + "examples": [ + null + ] + }, + "__format_name__": { + "$id": "#/properties/__format_name__", + "type": "string", + "title": "The __format_name__ schema", + "description": "File format name.", + "default": "TBJ", + "examples": [ + "TBJ" + ] + }, + "__format_ver__": { + "$id": "#/properties/__format_ver__", + "type": "integer", + "title": "The __format_ver__ schema", + "description": "File format version.", + "default": 4, + "examples": [ + 4 + ] + } + } +} \ No newline at end of file diff --git a/tests/test.py b/tests/test.py index 703e9e7..2690008 100644 --- a/tests/test.py +++ b/tests/test.py @@ -8,11 +8,11 @@ infile = sys.argv[1] ingz, inid = tabixpy.get_filenames(infile) - tabixpy.logger.setLevel(tabixpy.logging.DEBUG) + # tabixpy.logger.setLevel(tabixpy.logging.DEBUG) data = tabixpy.read_tabix(ingz) - tabixpy.save(data, ingz, compress=False) + tabixpy.save(data, ingz, compress=True) # for p in range(999999999900,1000000000000):